| Brian Hulley 2005-02-28, 8:59 pm |
|
Jan Wielemaker wrote:
> I.e. [] denotes the empty list (as [ ], [/*comment*/], etc do), while
> '[]' denotes the atom. I.e. '[]' == [] fails. I still think there is
a
> point in this, but I got lots of comments this would really break
code
> and I think '[|]' isn't much different.
>
I think if you want [] to mean the empty list then the notation [H|T]
should also not be considered to be a compound term, but rather a
non-empty list.
This would also get rid of the messing about that implementations have
to do to maintain the fiction that [a,b] = .(a,b) when in fact [a,b]
has a completely different representation in the WAM from that of a
compound term.
But if it is necessary to allow [a,b] = .(a,b) then I think that [] =
'[]' is completely consistent with the idea that the list notation is
just syntactic sugar because in this convention there really is no such
thing as a list therefore there can be no empty list either :-)
Cheers, Brian.
|