users-prolog
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Flag atom_no_escape has no effect?


From: Daniel Diaz
Subject: Re: Flag atom_no_escape has no effect?
Date: Thu, 23 May 2013 16:02:28 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130510 Thunderbird/17.0.6

Hi,

it is not a bug, the flag controls back quoted tokens, i.e. surrounded with a backquote ` not a quote '.
So you should use:


| ?- atom_chars(`\'`, CS).

CS = [\,'''']


Daniel


Le 23/05/2013 15:08, Yi Dai a écrit :
Hi,


I am using gprolog 1.4.4.  According to the manual, by default, the flag `back_quotes` is set to ` atom_no_escape`, which means no escape sequence is supported inside back quotes.  But I surprisingly find that it is not the case.  Below is a dialog of an interactive session:


GNU Prolog 1.4.4 (32 bits)
Compiled Apr 29 2013, 20:41:58 with gcc
By Daniel Diaz
Copyright (C) 1999-2013 Daniel Diaz
| ?- current_prolog_flag(back_quotes, X).

X = atom_no_escape

yes
| ?- atom_chars('''', CS).

CS = ['''']

yes
| ?- atom_chars('\'', CS).

CS = ['''']

yes
| ?- atom_chars('\\', CS).

CS = [\]

yes
| ?- atom_chars('\n', CS).

CS = ['\n']

yes
| ?- atom_chars('\''', CS).
uncaught exception: error(syntax_error('user_input:6 (char:23) unexpected newline'),read_term/3)


Apparently escape sequences are still allowed.  How can I disable it?  Note that turning on the flag ` strict_iso` does not help.  Is this a bug?


Regards,


Yi

--
Ce message a été vérifié par MailScanner pour des virus ou des polluriels et rien de suspect n'a été trouvé.

_______________________________________________
Users-prolog mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/users-prolog


--
Ce message a été vérifié par MailScanner pour des virus ou des polluriels et rien de suspect n'a été trouvé.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]