Chinaunix首页 | 论坛 | 博客
  • 博客访问: 482998
  • 博文数量: 120
  • 博客积分: 3052
  • 博客等级: 中校
  • 技术积分: 1755
  • 用 户 组: 普通用户
  • 注册时间: 2007-06-01 09:43
文章分类

全部博文(120)

文章存档

2011年(20)

2010年(3)

2009年(52)

2008年(45)

我的朋友

分类: LINUX

2011-05-02 23:34:42

转自


In Lisp, there is a set of functions which work for different kind of object:

EQ EQL EQUAL EQUALP

The function with the shorter name  support stricter definition of equality. The functions with the longer implement less restrictive, perhaps more intuitive, definitions of equality.

EQ is true for identical symbols. In fact, it’s true for any identical object. You can consider that EQ compare the memory address of objects. For example, you have a list, this list is EQ to itself, but it not EQ to another list with identical items. You also can use EQ to compare number and character, but this is not a good idea to do it.

EQL keeps EQ’s feature, and extends it to identical numbers and character. But EQL requires the identical type, thus 0.0 is not EQL to 0. EQL is case sensitive.

EQUAL is true for things that print the same.  EQ and EQL are not true for lists have the same structure and items.  EQUAL is true for those list.

EQUALP ignores number type and character case. EQUALP is the most permissive of the core comparison functions.Everything that is EQUAL is also EQUALP. But EQUALP ignores case distinctions between characters, and applies the (typeless) mathematical concept of equality to numbers; thus 0.0 is EQUALP to 0
阅读(453) | 评论(0) | 转发(0) |
0

上一篇:# 的一些总结

下一篇:字符串处理

给主人留下些什么吧!~~