From jan@swi.psy.uva.nl Thu Feb  8 10:26:06 2001
Received: from gollem.swi.psy.uva.nl (root@gollem [145.18.152.30])
	by swi.psy.uva.nl (8.11.2/8.11.2) with ESMTP id f189Q5Z09654;
	Thu, 8 Feb 2001 10:26:05 +0100 (MET)
Received: (from jan@localhost)
	by gollem.swi.psy.uva.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) id KAA15680;
	Thu, 8 Feb 2001 10:26:05 +0100
Date: Thu, 8 Feb 2001 10:26:05 +0100
Message-Id: <200102080926.KAA15680@gollem.swi.psy.uva.nl>
From: Jan Wielemaker <jan@swi.psy.uva.nl>
Subject: Re: [SWIPL] 
To: prolog@swi.psy.uva.nl, prolog-request@swi.psy.uva.nl
Phone: +31 - 20 - 525 6121

>  >How do you explain the confusion between a number N and a list of a number
>  >[N]?
>  > For instance, "?- [2]<3." succeeds and "?- X is [2]+3." leads to X=5.
>  >Jean-louis Bouquard
> 
> A set containing the element n is different from the element n. In Prolog, 
> the list containing a number n is denoted [n]. [n] is not a  number; it is 
> a list containing a number. Similarly, [] is different from  [[]]. The 
> first is the empty list and the second is the one element list which has 
> the empty list as its element.

All true, but the confusion might also be that [X] is treated as X by
arithmetic evaluation.  This is to allow using the following

is_ascii_lower_letter(X) :-
	X >= "a",
	X =< "z".

As "a" stands for [<code of 'a'>] this works nicely.  Alternatively you
can write

is_ascii_lower_letter(X) :-
	X >= 0'a,
	X =< 0'z.

I think this is nicer, though the 0'x syntax is a bit awkward for
syntax sensitive editors.

	--- Jan

