ISO standard question 
Author Message
 ISO standard question

Is there anybody out there who has access to a copy of the
official Prolog standard and can tell me exactly which
escape-sequences (those starting with backslash within
quoted items) are defined/required by the standard?
My (secondary) sources are somewhat ambiguous...

Thanks,
--
 Joachim Schimpf              /             phone: +44 20 7594 8187

 London SW7 2AZ, UK         /     http://www.*-*-*.com/



Mon, 21 Apr 2003 01:59:07 GMT  
 ISO standard question

Quote:

> Is there anybody out there who has access to a copy of the
> official Prolog standard and can tell me exactly which
> escape-sequences (those starting with backslash within
> quoted items) are defined/required by the standard?
> My (secondary) sources are somewhat ambiguous...

\<RETURN>
\'
\"
\`
\\

\a \b \r \f \t \n \v

\<OCTAL>\    with <OCTAL> ::= [0-7]+
\<HEXA>\     with  <HEXA> ::= [0-9A-Fa-f]+
(don't overlook the terminating backslash)

'' stands for ' inside 'strings'
"" stands for " inside "strings"
`` stands for ` inside `strings`

HTH
--
Pascal



Mon, 21 Apr 2003 04:54:39 GMT  
 ISO standard question

Quote:


> > Is there anybody out there who has access to a copy of the
> > official Prolog standard and can tell me exactly which
> > escape-sequences (those starting with backslash within
> > quoted items) are defined/required by the standard?
> > My (secondary) sources are somewhat ambiguous...

> \<RETURN>
> \'
> \"
> \`
> \\

> \a \b \r \f \t \n \v

> \<OCTAL>\    with <OCTAL> ::= [0-7]+
> \<HEXA>\     with  <HEXA> ::= [0-9A-Fa-f]+

that should be
  \x<HEXA>\    with  <HEXA> ::= [0-9A-Fa-f]+

Mats Carlsson



Mon, 21 Apr 2003 17:13:05 GMT  
 ISO standard question
...

Quote:
> > \<HEXA>\     with  <HEXA> ::= [0-9A-Fa-f]+

> that should be
>   \x<HEXA>\    with  <HEXA> ::= [0-9A-Fa-f]+

Oups...  (t'was a copy/paste :-))

Thanks.

--
Pascal



Mon, 21 Apr 2003 17:45:19 GMT  
 ISO standard question
Thanks for your answers!

Quote:

> '' stands for ' inside 'strings'
> "" stands for " inside "strings"
> `` stands for ` inside `strings`

Is it allowed to redundantly escape quotes within
different quotes, e.g. "peter\'s"  ?

--
 Joachim Schimpf              /             phone: +44 20 7594 8187

 London SW7 2AZ, UK         /    http://www.icparc.ic.ac.uk/eclipse



Mon, 21 Apr 2003 20:51:13 GMT  
 ISO standard question

Quote:

> Thanks for your answers!


> > '' stands for ' inside 'strings'
> > "" stands for " inside "strings"
> > `` stands for ` inside `strings`

> Is it allowed to redundantly escape quotes within
> different quotes, e.g. "peter\'s"  ?

Yes.

--
Pascal



Mon, 21 Apr 2003 21:35:48 GMT  
 ISO standard question

Quote:

> Thanks for your answers!


> > '' stands for ' inside 'strings'
> > "" stands for " inside "strings"
> > `` stands for ` inside `strings`

> Is it allowed to redundantly escape quotes within
> different quotes, e.g. "peter\'s"  ?

And further, what would be the interpretation of the following:

        '\'\''
        "\"\""
        `\`\``

Does the '' convention apply to the single-character syntax?  What is the
standard interpretation of

        0'''

I ass-u-me that these would be, respectively,

   - An atom whose name contains two ' characters.
   - A list containing two char_codes or characters (depending on flag
     settings) for the character ".
   - A string which is implementation defined but contains two instances
     of something which represents the ` character.
   - The char_code for ' followed by a quote (i.e., not a single
     lexeme like the other examples).
--

  http://www.bawue.de/~jjk/          fax:+49-7031-464-7351
PGP:       06 04 1C 35 7B DC 1F 26 As the air to a bird, or the sea to a fish,
0x555DA8B5 BB A2 F0 66 77 75 E1 08 so is contempt to the contemptible. [Blake]



Tue, 22 Apr 2003 18:15:54 GMT  
 ISO standard question

Quote:

> And further, what would be the interpretation of the following:

>    '\'\''
>    "\"\""
>    `\`\``

> Does the '' convention apply to the single-character syntax?  What is the
> standard interpretation of

>    0'''

> I ass-u-me that these would be, respectively,

>    - An atom whose name contains two ' characters.
>    - A list containing two char_codes or characters (depending on flag
>      settings) for the character ".
>    - A string which is implementation defined but contains two instances
>      of something which represents the ` character.

I agree.

Quote:
>    - The char_code for ' followed by a quote (i.e., not a single
>      lexeme like the other examples).

I disagree.  It is read as the char_code for the ' character only.

Mats Carlsson



Tue, 22 Apr 2003 19:44:02 GMT  
 ISO standard question

Quote:


> > Thanks for your answers!


> > > '' stands for ' inside 'strings'
> > > "" stands for " inside "strings"
> > > `` stands for ` inside `strings`

> > Is it allowed to redundantly escape quotes within
> > different quotes, e.g. "peter\'s"  ?

> And further, what would be the interpretation of the following:

>         '\'\''
>         "\"\""
>         `\`\``

> Does the '' convention apply to the single-character syntax?  What is the
> standard interpretation of

Double-thing has a special meaning only in a same-thing'd-string, where
thing belongs to {' " `}.
Except one case: 0'<single_quoted_char> where <single_quoted_char> is any
sequence representing a char you can put in single quote strings (as '' \' \n etc.)
(but not \<RETURN> since it doesn't represente a char).

Quote:

>         0'''

> I ass-u-me that these would be, respectively,

>    - An atom whose name contains two ' characters.

Yes.

Quote:
>    - A list containing two char_codes or characters (depending on flag
>      settings) for the character ".

It may also be the 2 chars atom "", depending the double-quote flag.

Quote:
>    - A string which is implementation defined but contains two instances
>      of something which represents the ` character.

Yes.

Quote:
>    - The char_code for ' followed by a quote (i.e., not a single
>      lexeme like the other examples).

No, 0''' is the char_code for ' , nothing more.
(yes, it is surprising at first ;-)

--
Pascal



Tue, 22 Apr 2003 20:17:38 GMT  
 ISO standard question

Quote:

> No, 0''' is the char_code for ' , nothing more.
> (yes, it is surprising at first ;-)

At first ??!  Sounds like a brain damage
to rival ansi C trigraphs :-)

-- Joachim



Tue, 22 Apr 2003 22:50:25 GMT  
 ISO standard question

Quote:

> No, 0''' is the char_code for ' , nothing more.
> (yes, it is surprising at first ;-)

It's not *that* surprising, but I'll have to check it in my pet parser...
--

  http://www.bawue.de/~jjk/          fax:+49-7031-464-7351
PGP:       06 04 1C 35 7B DC 1F 26 As the air to a bird, or the sea to a fish,
0x555DA8B5 BB A2 F0 66 77 75 E1 08 so is contempt to the contemptible. [Blake]


Fri, 25 Apr 2003 03:00:00 GMT  
 
 [ 11 post ] 

 Relevant Pages 

1. An ISO Standard Question

2. Standards questions, from ISO Convener

3. branching in proposed ISO standard

4. ISO Standards Documents

5. ISO International Standard IS8485

6. ISO Standard for Headless Images?

7. ISO Standard Forth

8. ISO Standard for Software Revisions

9. ISO Standard Approved

10. ISO standard for EBNF

11. Oberon ISO-Standard?

12. Static scoping in BCPL (was Re: Are nested functions legal in ANSI/ISO Standard C)

 

 
Powered by phpBB® Forum Software