From jan@swi.psy.uva.nl  Mon Nov 29 10:44:08 1999
Received: from gollem.swi.psy.uva.nl (root@gollem [145.18.114.15])
	by swi.psy.uva.nl (8.9.3/8.9.3) with ESMTP id KAA07972
	for <prolog@swi.psy.uva.nl>; Mon, 29 Nov 1999 10:44:08 +0100 (MET)
Received: from localhost (localhost [[UNIX: localhost]])
	by gollem.swi.psy.uva.nl (8.9.3/8.9.3) id KAA07011;
	Mon, 29 Nov 1999 10:44:08 +0100
From: Jan Wielemaker <jan@swi.psy.uva.nl>
Organization: SWI, University of Amsterdam
To: prolog@swi.psy.uva.nl
Subject: Re: Please help me with strings
Date: Mon, 29 Nov 1999 10:30:15 +0100
X-Mailer: KMail [version 1.0.21]
Content-Type: text/plain
References: <384242BF.15AE3936@t-online.de>
Cc: prolog@gollem.swi.psy.uva.nl
MIME-Version: 1.0
Message-Id: <99112910440800.06861@gollem>
Content-Transfer-Encoding: 8bit

On Mon, 29 Nov 1999, Uwe Lesta wrote:
>Hello,
>
>assume that style_check(+string) is true.
>
>If i ask interactive in the toplevel window
>        20 ?- string("string").
>        Yes
>        21 ?-
>But this program fails cause "string" is readed as a list of chars.
>
>t_str:-
>    style_check(+string),
>    string_to_atom(Str, 'string'),
>    string(Str),

This succeeds (at least by me)

>    string("string"),
>    Str == "string".

But this will fail unless the style-check was active at read-time.
Please note that style-check(+string) is mapped to the prolog
flag double_quotes, which is module-local.

>What must I do that this is true ??
>
>t_str2:-
>    string_to_atom(Str, 'string'),
>    Str == "string".

As long as the prolog flag is fine, there is no problem.  In general
however stay away from strings.   This is especially true for 3.3.0
beta-4 that will have an atom-garbage collector.  There is just too
much confusion about how a string is represented.

	Regards --- Jan

