Re: Concerns about "{...code...}"

2007-12-21 Thread Michael G Schwern
Larry Wall wrote: > But I will make one general remark at the start, which is that we > want Perl 6 programmer to look at curlies differently than Perl 5 > programmers do. In Perl 5, curlies were overloaded many different > ways, and rarely did they mean a closure by themselves. In Perl 6, > it's

Re: Concerns about "{...code...}"

2007-12-21 Thread Juerd Waalboer
Michael G Schwern skribis 2007-12-21 19:21 (-0800): > Normally I'd go on the side of the reader and say yes, when writing code you > should be picky about what quotes you use. But in this case I find that, on > the writing side, I find it a common annoyance when I chuck a variable into a > string

Re: Concerns about "{...code...}"

2007-12-21 Thread Michael G Schwern
John Siracusa wrote: > On 12/21/07 5:54 AM, Larry Wall wrote: >> To you and me, the fact that there are single quotes means there's >> something there to hide. But other people think the other way and >> see double quotes as indicating there's something to interpolate. >> I think PBP comes down on

Re: Concerns about "{...code...}"

2007-12-21 Thread Larry Wall
On Fri, Dec 21, 2007 at 01:51:19PM -0800, Dave Whipp wrote: > Larry Wall wrote: > >> As for the Q base form, it's not really there so much for end-use, > > For an operator not intended for end use, it has a remarkable low Huffman > rank... That's because some end-users will want to use Q anyway.

Re: Concerns about "{...code...}"

2007-12-21 Thread Jonathan Lang
Dave Whipp wrote: > If the construct is used only rarely then it should have a longer name, Actually, Huffman coding implies that if the construct is used regularly then it should have a short name. It does not mandate a long name for rare constructs; it merely says that if a given short name is

Re: Concerns about "{...code...}"

2007-12-21 Thread Dave Whipp
Chas. Owens wrote: On Dec 21, 2007 4:51 PM, Dave Whipp <[EMAIL PROTECTED]> wrote: Larry Wall wrote: As for the Q base form, it's not really there so much for end-use, For an operator not intended for end use, it has a remarkable low Huffman rank... But since it will be combined with adverbs

Re: Concerns about "{...code...}"

2007-12-21 Thread Chas. Owens
On Dec 21, 2007 4:51 PM, Dave Whipp <[EMAIL PROTECTED]> wrote: > Larry Wall wrote: > > > As for the Q base form, it's not really there so much for end-use, > > For an operator not intended for end use, it has a remarkable low > Huffman rank... > But since it will be combined with adverbs like my

Re: Concerns about "{...code...}"

2007-12-21 Thread Dave Whipp
Larry Wall wrote: As for the Q base form, it's not really there so much for end-use, For an operator not intended for end use, it has a remarkable low Huffman rank...

Re: Concerns about "{...code...}"

2007-12-21 Thread Larry Wall
On Fri, Dec 21, 2007 at 08:59:02AM -0500, Mark J. Reed wrote: : The single-quoted string literal has become such a habit that I frequently : make mistakes in other C-like languages that use the two types of quotation : marks to make the character/string distinction. Yeah, it might be my C backgrou

Re: Concerns about "{...code...}"

2007-12-21 Thread Brandon S. Allbery KF8NH
On Dec 21, 2007, at 5:54 , Larry Wall wrote: On Thu, Dec 20, 2007 at 03:24:30PM -0800, Michael G Schwern wrote: : Jonathan Scott Duff wrote: : [1] Note, I'm the sort of person that uses "" until I have a reason otherwise. Well, me too, but P6 just provides a different set of reasons. :) T

Re: Concerns about "{...code...}"

2007-12-21 Thread Mark J. Reed
On Dec 21, 2007 8:53 AM, John Siracusa <[EMAIL PROTECTED]> wrote: > FWIW, my reasoning in this area is based on Laziness: single quotes mean I > don't have to scan the string looking for interpolated stuff when reading > code. Double quotes mean I do, and I'm annoyed at the waste of time when > I

Re: Concerns about "{...code...}"

2007-12-21 Thread John Siracusa
On 12/21/07 5:54 AM, Larry Wall wrote: > To you and me, the fact that there are single quotes means there's > something there to hide. But other people think the other way and > see double quotes as indicating there's something to interpolate. > I think PBP comes down on that side, but to me, sing

Re: Concerns about "{...code...}"

2007-12-21 Thread Larry Wall
On Thu, Dec 20, 2007 at 03:24:30PM -0800, Michael G Schwern wrote: : Jonathan Scott Duff wrote: : > On Thu, Dec 20, 2007 at 07:58:51AM -0500, Mark J. Reed wrote: : >> I think the issue is that bare vars don't interpolate anymore, but : >> they still have sigils of their own, so adding to the defaul

Re: Concerns about "{...code...}"

2007-12-20 Thread Michael G Schwern
Mark J. Reed wrote: > No need to get snippy. I thought the "I'm just fucking around" emotey would be enough. > PHP may be the best argument out there for > namespace control, but that doesnt mean it doesnt also have some nice > bits. Im rather fond of its extended foreach syntax, for instance.

Re: Concerns about "{...code...}"

2007-12-20 Thread Mark J. Reed
Since i was mistaken about bare vars (scalars still interpolate), I agree with Mr. Schwern: plain curlies are insufficiently distinct for the interpolation syntax. Sigil+curlies would be better. On 12/20/07, Patrick R. Michaud <[EMAIL PROTECTED]> wrote: > On Thu, Dec 20, 2007 at 06:01:53PM -0500

Re: Concerns about "{...code...}"

2007-12-20 Thread Patrick R. Michaud
On Thu, Dec 20, 2007 at 06:01:53PM -0500, Mark J. Reed wrote: >On Dec 20, 2007 4:30 PM, Patrick R. Michaud <[EMAIL PROTECTED]> wrote: > > Just to add another perspective, PHP uses curlies inside of > double-quoted strings to indicate various forms of > interpolation, and it does

Re: Concerns about "{...code...}"

2007-12-20 Thread Michael G Schwern
Jonathan Scott Duff wrote: > On Thu, Dec 20, 2007 at 07:58:51AM -0500, Mark J. Reed wrote: >> I think the issue is that bare vars don't interpolate anymore, but >> they still have sigils of their own, so adding to the default interp >> syntax is too noisy: ${$var} is not really much improvement ov

Re: Concerns about "{...code...}"

2007-12-20 Thread Mark J. Reed
No need to get snippy. PHP may be the best argument out there for namespace control, but that doesnt mean it doesnt also have some nice bits. Im rather fond of its extended foreach syntax, for instance. (Though I disagree with the conflation of numeric and associative arrays, a flaw shared by Jav

Re: Concerns about "{...code...}"

2007-12-20 Thread Mark J. Reed
On Dec 20, 2007 4:30 PM, Patrick R. Michaud <[EMAIL PROTECTED]> wrote: > Just to add another perspective, PHP uses curlies inside of > double-quoted strings to indicate various forms of > interpolation, and it doesn't seem to cause major issues > there. But PHP's use of curlies is limited and co

Re: Concerns about "{...code...}"

2007-12-20 Thread Michael G Schwern
Patrick R. Michaud wrote: > Just to add another perspective, PHP uses curlies inside of > double-quoted strings to indicate various forms of > interpolation, and it doesn't seem to cause major issues > there. PHP has 8000 built in functions and it doesn't seem to cause issues there. I'll not be t

Re: Concerns about "{...code...}"

2007-12-20 Thread Patrick R. Michaud
On Thu, Dec 20, 2007 at 11:35:44AM -0600, Jonathan Scott Duff wrote: > On Thu, Dec 20, 2007 at 11:23:05AM -0600, Jonathan Scott Duff wrote: > > Adriano answered #1 I think: $yaml = Q:!c"{ $key: 42 }"; > > Er, I just looked over the spec again and realized that Q does > absolutely no interpolation

Re: Concerns about "{...code...}"

2007-12-20 Thread Dave Mitchell
On Thu, Dec 20, 2007 at 11:35:44AM -0600, Jonathan Scott Duff wrote: > On Thu, Dec 20, 2007 at 11:23:05AM -0600, Jonathan Scott Duff wrote: > > Adriano answered #1 I think: $yaml = Q:!c"{ $key: 42 }"; > > Er, I just looked over the spec again and realized that Q does > absolutely no interpolation

Re: Concerns about "{...code...}"

2007-12-20 Thread Jonathan Scott Duff
On Thu, Dec 20, 2007 at 11:23:05AM -0600, Jonathan Scott Duff wrote: > Adriano answered #1 I think: $yaml = Q:!c"{ $key: 42 }"; Er, I just looked over the spec again and realized that Q does absolutely no interpolation, so it would be more like this: $yaml = Q:qq:!c"{ $key: 42 }"; or perhap

Re: Concerns about "{...code...}"

2007-12-20 Thread Jonathan Scott Duff
On Thu, Dec 20, 2007 at 07:58:51AM -0500, Mark J. Reed wrote: > I think the issue is that bare vars don't interpolate anymore, but > they still have sigils of their own, so adding to the default interp > syntax is too noisy: ${$var} is not really much improvement over > ${\(expr)}. That's not qui

Re: Concerns about "{...code...}"

2007-12-20 Thread Mark J. Reed
I think the issue is that bare vars don't interpolate anymore, but they still have sigils of their own, so adding to the default interp syntax is too noisy: ${$var} is not really much improvement over ${\(expr)}. - Original message - I am not quite sure of all the implications in t... On 12/20/

Re: Concerns about "{...code...}"

2007-12-20 Thread Adriano Ferreira
On Dec 20, 2007 1:48 AM, Michael G Schwern <[EMAIL PROTECTED]> wrote: > I was reading an article about Perl 6, I forget which one, and it happened to > mention that code can be interpolated inside double quoted strings. That's > one thing, my concern is with the selected syntax. > > say "f

Concerns about "{...code...}"

2007-12-19 Thread Michael G Schwern
I was reading an article about Perl 6, I forget which one, and it happened to mention that code can be interpolated inside double quoted strings. That's one thing, my concern is with the selected syntax. say "foo { 1+1 }"; # "foo 2" The {...} construct seems far too common one in norma