Nobuyoshi Nakada
9/26/2006 5:07:00 AM
Hi,
At Tue, 26 Sep 2006 04:09:54 +0900,
Rich Morin wrote in [ruby-talk:216346]:
> At 3:10 AM +0900 9/26/06, James Edward Gray II wrote:
> >> Use '' by default:
> >>
> >> - It's less work for the interpreter.
> >
> > What makes you say this?
>
> If the interpreter sees a single-quoted string, it knows
> that it doesn't need to scan the string for things (such
> as escape sequences) to expand. I agree that this effect
> will be lost in the noise, in most cases, but why make the
> interpreter do extra work?
It knows that it does need to scan the string always for the
terminator, and even escaped quotes.
--
Nobu Nakada