On 10/9/06, Jonathan Lang [EMAIL PROTECTED] wrote:
Smylers wrote:
To be consistent your proposal should also suggest that these become
equivalent:
* { function() }
* qq[ {function() }]
* qq{ function() }
* eval function()
How so? AFAIK, string literal syntax requires you to prepend a
Markus Laire wrote:
According to S02 bare curlies do interpolate in double-quoted strings:
Yeah; that was subsequently pointed out to me. Oops.
--
Jonathan Dataweaver Lang
Larry Wall wrote:
On Sat, Oct 07, 2006 at 07:49:48PM -0700, Jonathan Lang wrote:
: Another possibility: make it work. Add a delayed parameter trait
: that causes evaluation of that trait to be postponed until the first
: time that the parameter actually gets used in the routine. If it
: never
Jonathan Lang writes:
Translating this to perl 6, I'm hoping that perl6 is smart enough to
let me say:
s(pattern) { doit() }
Instead of
s(pattern) { { doit() } }
That special case is nasty if you don't know about it -- you
inadvertently execute as code something which you just
Smylers wrote:
Jonathan Lang writes:
Translating this to perl 6, I'm hoping that perl6 is smart enough to
let me say:
s(pattern) { doit() }
Instead of
s(pattern) { { doit() } }
That special case is nasty if you don't know about it -- you
inadvertently execute as code something
Jonathan Lang writes:
Smylers wrote:
Jonathan Lang writes:
Translating this to perl 6, I'm hoping that perl6 is smart enough
to let me say:
s(pattern) { doit() }
Instead of
s(pattern) { { doit() } }
That special case is nasty if you don't know about it
Smylers schreef:
in
this particular case the particular behaviour involves _executing as
Perl code something which the programmer never intended to be code in
the first place_. That's crazily dangerous.
I wouldn't mind eval() to be off by default, so to have to put a use
eval in every block
Smylers wrote:
Jonathan Lang writes:
If you expected it to be a string, why did you use curly braces?
Because it isn't possible to learn of all Perl (5 or 6) in one go. And
in general you learn rules before exceptions to rules.
Agreed.
In general in Perl the replacement part of a
S5 says:
There is no /e evaluation modifier on substitutions; instead use:
s/pattern/{ doit() }/
Instead of /ee say:
s/pattern/{ eval doit() }/
In my perl5 code, I would occasionally take advantage of the pairs of
brackets quoting mechanism to do something along the lines of:
Jonathan Lang skribis 2006-10-07 15:07 (-0700):
Translating this to perl 6, I'm hoping that perl6 is smart enough to let me
say:
s(pattern) { doit() }
Instead of
s(pattern) { { doit() } }
I would personally hope that Perl isn't that clever, but treats all
bracketing delimiters the
On Sat, Oct 07, 2006 at 03:07:49PM -0700, Jonathan Lang wrote:
: S5 says:
: There is no /e evaluation modifier on substitutions; instead use:
:
: s/pattern/{ doit() }/
:
: Instead of /ee say:
:
: s/pattern/{ eval doit() }/
:
: In my perl5 code, I would occasionally take advantage of
Larry Wall wrote:
Jonathan Lang wrote:
: Translating this to perl 6, I'm hoping that perl6 is smart enough to let me
: say:
:
:s(pattern) { doit() }
Well, the () are illegal without intervening whitespace because that
makes s() a function call, but we'll leave that alone.
Thank you; I
Larry Wall wrote:
As a unary lazy prefix, you could even just say
s[pattern] doit();
Of course, then people will wonder why
.subst(/pattern/, doit())
doesn't work.
Another possibility: make it work. Add a delayed parameter trait
that causes evaluation of that trait to be postponed
Jonathan Lang wrote:
Another possibility: make it work. Add a delayed parameter trait...
...although lazy might be a better name for it. :)
--
Jonathan Dataweaver Lang
On Sat, Oct 07, 2006 at 07:49:48PM -0700, Jonathan Lang wrote:
: Another possibility: make it work. Add a delayed parameter trait
: that causes evaluation of that trait to be postponed until the first
: time that the parameter actually gets used in the routine. If it
: never gets used, then it
15 matches
Mail list logo