1. Rob: Minor special character glitch?

Rob,

I noticed that you can use a single quote with print, printf, puts, so on.
without needing to use a special character backslash. Was this intentional or
just a uncaught glitch?

puts(1, "''''''''''") -- works ?
puts(1, "\'\'\'\'\'\'\'\'\'\'") -- works

This isn't a problem or anything but maybe deviates from expected behavor?


Regards,
Vincent

new topic     » topic index » view message » categorize

2. Re: Rob: Minor special character glitch?

Vincent wrote:
> 
> Rob,
> 
> I noticed that you can use a single quote with print, printf, puts, so on.
> without
> needing to use a special character backslash. Was this intentional or just a
> uncaught glitch?
> 
> puts(1, "''''''''''") -- works ?
> puts(1, "\'\'\'\'\'\'\'\'\'\'") -- works
> 
> This isn't a problem or anything but maybe deviates from expected behavor?
> 
> 
> Regards,
> Vincent

Hi,


What are you saying?  Single quote is just another printable char right?
Should print just like any other char when it's part of a string right?


Take care,
Al

And, good luck with your Euphoria programming!

My bumper sticker: "I brake for LED's"

new topic     » goto parent     » topic index » view message » categorize

3. Re: Rob: Minor special character glitch?

Vincent wrote:
> I noticed that you can use a single quote with print, printf, puts, so on.
> without
> needing to use a special character backslash. Was this intentional or just a
> uncaught glitch?
> 
> puts(1, "''''''''''") -- works ?
> puts(1, "\'\'\'\'\'\'\'\'\'\'") -- works
> 
> This isn't a problem or anything but maybe deviates from expected behavor?

That was intentional.
Inside a double-quote string you can use a single quote
directly without escaping it, since there is no confusion.
Similarly, inside a sinqle-quote character you can use 
a double quote with or without escaping it. e.g. '"'

Regards,
   Rob Craig
   Rapid Deployment Software
   http://www.RapidEuphoria.com

new topic     » goto parent     » topic index » view message » categorize

4. Re: Rob: Minor special character glitch?

Al Getz wrote:

> What are you saying?  Single quote is just another printable char right?
> Should print just like any other char when it's part of a string right?

In Refman Part 1 - Section 2 :

2.1.2 Character Strings and Individual Characters 

Special characters may be entered using a back-slash: 

\n        newline
\r        carriage return
\t        tab
\\        backslash
\"        double quote
\'        single quote

I havent noticed this before. Perhaps this is normal.

I guess I'm thinking since we cant do this:

puts(1, """""""""")

Maybe I just dont understand. Hehe...


Regards,
Vincent

new topic     » goto parent     » topic index » view message » categorize

5. Re: Rob: Minor special character glitch?

Robert Craig wrote:

> That was intentional.
> Inside a double-quote string you can use a single quote
> directly without escaping it, since there is no confusion.
> Similarly, inside a sinqle-quote character you can use 
> a double quote with or without escaping it. e.g. '"'

Ahh ok... I understand now. Stupid me. :P


Regards,
Vincent

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu