eqivalent for 'eq'

For the Compleat Fan
Locked
HPW
Posts: 1390
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany
Contact:

eqivalent for 'eq'

Post by HPW »

Is there a eqivalent for a alisp command 'eq' in newLISP?

(eq expr1 expr2)

eq gives true when both expr are connected to the same object.

Code: Select all

(setq f1 '(a b c))
(setq f2 '(a b c))
(setq f3 f2)

(eq f1 f3) => nil  {not the sane lists}
(eq f3 f2) => true {the same lists}
Hans-Peter

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

Everything is referenced only once in newLISP, so there is no need for several operators testing on equality. Read here: http://newlisp.org/index.cgi?page=Diffe ... ther_LISPs the points (8) and (10)

Lutz

HPW
Posts: 1390
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany
Contact:

Post by HPW »

Oops, it happens from times to times that I think in alisp instead of newLISP! ;-)
Hans-Peter

Locked