Atoms Symbols etc

For the Compleat Fan
Locked
netytan
Posts: 19
Joined: Tue Dec 06, 2005 8:22 pm

Atoms Symbols etc

Post by netytan »

I was wondering if somone could tell me what an atom and what an Symbol is, they seem to be used intemitently and I just can't figure it out. I assumed that a Sybol was like a variable but an Atom I have no idea, is a Cons an Atom?

Thanks a lot guys :),

Mark.

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

Post by Lutz »

Code: Select all

> (map atom? '(a 1 1.2 (1 2 3) (x y z) (define (foo) ) (lambda (x)) "hello" nil true))
(true true true nil nil nil nil true true true)
> 
lists (includes lambda expressions) are not atoms everything else is an atom. A 'cons' operation in newLISP always returns a list, there is no dotted cons cell in newLISP. See also: http://newlisp.org/index.cgi?page=Diffe ... ther_LISPs in paragraph 4.

Lutz

netytan
Posts: 19
Joined: Tue Dec 06, 2005 8:22 pm

Post by netytan »

Oh ok, so even symbols are atoms in Lisp? Lisp in general not just NewLisp

Thanks Lutz,

Mark.

Locked