Larry Wall wrote:
On Wed, Jun 08, 2005 at 12:37:22PM +0200, TSa (Thomas Sandlaß) wrote:
: BTW, is - on the 'symbolic unary' precedence level
: as its read-only companion \ ?.
No, - introduces a term that happens to consist of a formal signature
and a block. There are no ordinary expressions
On Mon, Jul 04, 2005 at 07:01:00PM +0200, TSa (Thomas Sandlaß) wrote:
: Larry Wall wrote:
: On Wed, Jun 08, 2005 at 12:37:22PM +0200, TSa (Thomas Sandlaß) wrote:
: : BTW, is - on the 'symbolic unary' precedence level
: : as its read-only companion \ ?.
:
: No, - introduces a term that happens to
Luke Palmer [EMAIL PROTECTED] writes:
On 6/8/05, Piers Cawley [EMAIL PROTECTED] wrote:
In other words, it outputs:
Foo
Foo
# dies
Yep. My mistake.
If that works, then I think it means we can write:
sub call-with-current-continuation(Code $code) {
my $cc =
Larry Wall [EMAIL PROTECTED] writes:
On Wed, Jun 08, 2005 at 10:51:34PM +, Luke Palmer wrote:
: Yeah, that's pretty. But that will bite people who don't understand
: continuations; it will bite people who don't understand return; it
: will even bite people who understand continuations,
On 6/8/05, Piers Cawley [EMAIL PROTECTED] wrote:
In other words, it outputs:
Foo
Foo
# dies
Yep. My mistake.
If that works, then I think it means we can write:
sub call-with-current-continuation(Code $code) {
my $cc = - $retval { return $retval }
TSa (Thomas Sandlaß) [EMAIL PROTECTED] writes:
Piers Cawley wrote:
My preference is for:
Boo
Boo
Can't dereferene literal numeric literal 42 as a coderef.
How do you reach the second 'Boo'? Iff - does not create a Sub
but a Block instance then Luke's code can be interpreted as
Piers Cawley [EMAIL PROTECTED] writes:
TSa (Thomas Sandlaß) [EMAIL PROTECTED] writes:
Piers Cawley wrote:
My preference is for:
Boo
Boo
Can't dereferene literal numeric literal 42 as a coderef.
How do you reach the second 'Boo'? Iff - does not create a Sub
but a Block
Piers Cawley wrote:
TSa (Thomas Sandlaß) [EMAIL PROTECTED] writes:
Piers Cawley wrote:
My preference is for:
Boo
Boo
Can't dereferene literal numeric literal 42 as a coderef.
How do you reach the second 'Boo'? Iff - does not create a Sub
but a Block instance then Luke's code can
TSa (Thomas Sandlaß) [EMAIL PROTECTED] writes:
Piers Cawley wrote:
[..] then I think it means we can write:
sub call-with-current-continuation(Code $code) {
my $cc = - $retval { return $retval }
For the records: the return here is the essential ingredient, right?
Without it the
Piers Cawley wrote:
[..] then I think it means we can write:
sub call-with-current-continuation(Code $code) {
my $cc = - $retval { return $retval }
For the records: the return here is the essential ingredient, right?
Without it the block would be evaluated or optimized away to an
Luke Palmer wrote:
Says not:
Boo
Boo
Boo
...
This is clear, but I would expect the output
Boo
42
because the return value of foo is a ref to a block that
makes the caller return 42. This is written in my current
Perl6 as
foo:( : -- Block -- 42)
The question is when
On Wed, Jun 08, 2005 at 12:37:22PM +0200, TSa (Thomas Sandlaß) wrote:
: BTW, is - on the 'symbolic unary' precedence level
: as its read-only companion \ ?.
No, - introduces a term that happens to consist of a formal signature
and a block. There are no ordinary expressions involved until you
get
Luke Palmer [EMAIL PROTECTED] writes:
On 6/7/05, Matt Fowles [EMAIL PROTECTED] wrote:
On 6/7/05, Ingo Blechschmidt [EMAIL PROTECTED] wrote:
Hi,
sub foo (Code $code) {
my $return_to_caller = - $ret { return $ret };
$code($return_to_caller);
return 23;
}
sub
Well,
does using - as blockref creator also give anonymous scalars?
$y = - $x { $x = 3; $x }; # $y:(Ref of Block of Int)
BTW, is - on the 'symbolic unary' precedence level
as its read-only companion \ ?. Are they pure macros?
--
TSa (Thomas Sandlaß)
Piers Cawley wrote:
My preference is for:
Boo
Boo
Can't dereferene literal numeric literal 42 as a coderef.
How do you reach the second 'Boo'? Iff - does not create a Sub
but a Block instance then Luke's code can be interpreted as a
much smarter version of
sub foo()
{
On Wed, Jun 08, 2005 at 10:51:34PM +, Luke Palmer wrote:
: Yeah, that's pretty. But that will bite people who don't understand
: continuations; it will bite people who don't understand return; it
: will even bite people who understand continuations, because they can
: be made in such an
Hi,
sub foo (Code $code) {
my $return_to_caller = - $ret { return $ret };
$code($return_to_caller);
return 23;
}
sub bar (Code $return) { $return(42) }
say foo bar; # 42 or 23?
I think it should output 42, as the return() in the pointy
block $return_to_caller
Ingo~
On 6/7/05, Ingo Blechschmidt [EMAIL PROTECTED] wrote:
Hi,
sub foo (Code $code) {
my $return_to_caller = - $ret { return $ret };
$code($return_to_caller);
return 23;
}
sub bar (Code $return) { $return(42) }
say foo bar; # 42 or 23?
I think it should
Ingo Blechschmidt [EMAIL PROTECTED] writes:
Hi,
sub foo (Code $code) {
my $return_to_caller = - $ret { return $ret };
$code($return_to_caller);
return 23;
}
sub bar (Code $return) { $return(42) }
say foo bar; # 42 or 23?
I think it should output
) {
$moo(13);
save_the_world();
}
it would not have gotten to save the world. One might argue that $moo
could throw an exception, but bar has a way to catch that.
yep. $moo(13) will never return.
But this is not specific to pointy blocks: Consider
bar return;
It seems to me that what
On 6/7/05, Matt Fowles [EMAIL PROTECTED] wrote:
On 6/7/05, Ingo Blechschmidt [EMAIL PROTECTED] wrote:
Hi,
sub foo (Code $code) {
my $return_to_caller = - $ret { return $ret };
$code($return_to_caller);
return 23;
}
sub bar (Code $return) { $return(42) }
On 6/7/05, Luke Palmer [EMAIL PROTECTED] wrote:
Then let's put it this way:
sub foo () {
for 0..10 {
when 6 { return 42 }
}
return 26;
}
And if that didn't do it, then let's write it equivalently as:
sub foo () {
map(- $_ { return 42
All~
On 6/7/05, Luke Palmer [EMAIL PROTECTED] wrote:
On 6/7/05, Matt Fowles [EMAIL PROTECTED] wrote:
On 6/7/05, Ingo Blechschmidt [EMAIL PROTECTED] wrote:
Hi,
sub foo (Code $code) {
my $return_to_caller = - $ret { return $ret };
$code($return_to_caller);
23 matches
Mail list logo