Damian Conway <[EMAIL PROTECTED]> writes:
> Larry explained:
>
>> : Umm. didn't you say bare blocks were going away?
>>
>> Rule #2 was invoked.
>>
>> The current thinking is that any bare block will never be interpreted
>> as returning a closure. You have to use explicit C or C
>> to retur
Larry explained:
> : Umm. didn't you say bare blocks were going away?
>
> Rule #2 was invoked.
>
> The current thinking is that any bare block will never be interpreted
> as returning a closure. You have to use explicit C or C
> to return a closure.
Or the equivalent of a C, namely:
Larry wrote:
>
> [EMAIL PROTECTED] writes:
> : On 4/3/02 6:44 PM, Damian Conway wrote:
> : > Larry has said very clearly that in Perl 6 there are no "magical" lexical
> : > scopes.
> :
> : Shouldn't this be: "Larry has said very clearly that in Perl 6 there is only
> : one 'magical' lexical scope
[EMAIL PROTECTED] writes:
: On Wednesday 03 April 2002 18:24, Larry Wall wrote:
: >
: > Sure, just say
: >
: > { loop (my $i = intializer(); condition($i); $i = advance($i)) { ... }
: }
: >
: > : Perhaps something like:
: > :
: > : initalizer() -> $i { LOOP: NEXT { $i = advance($i); redo
[EMAIL PROTECTED] writes:
: On 4/3/02 6:44 PM, Damian Conway wrote:
: > Larry has said very clearly that in Perl 6 there are no "magical" lexical
: > scopes.
:
: Shouldn't this be: "Larry has said very clearly that in Perl 6 there is only
: one 'magical' lexical scope: sub() or ->"
It's specific
Luke Palmer writes:
: So, does the new =~ commute now, except for regexps; i.e.
:
: $a =~ $b
: is the same as
: $b =~ $a
:
: unless one or both are regexps?
I believe I marked which ones commute in A4.
: Additionally, can you chain statement modifiers?
:
: do_this() if $a unless $b;
: print f
So, does the new =~ commute now, except for regexps; i.e.
$a =~ $b
is the same as
$b =~ $a
unless one or both are regexps?
Additionally, can you chain statement modifiers?
do_this() if $a unless $b;
print for @mylist if $debug;
or less efficiently,
print if $debug for @mylist;
print "$
> {
> my @subs;
> loop (my $x = 0; $x < 10; $x++) {
> push @subs, { $^a + $x };
> }
> $x--;
> # ...
> }
>
> This certainly does *not* DWIM in the current thought. And the silence
> would be much more confusing than a simple syntax error the traditiona
> Larry has said very clearly that in Perl 6 there are no "magical" lexical scopes.
> That is, variables declared in a C control aren't magically in the
> following block.
However, I don't agree with him. It may be more intuitive to newcomers,
but it is a common programming idiom that is used a
On 4/3/02 6:44 PM, Damian Conway wrote:
> Larry has said very clearly that in Perl 6 there are no "magical" lexical
> scopes.
Shouldn't this be: "Larry has said very clearly that in Perl 6 there is only
one 'magical' lexical scope: sub() or ->"
-John
On Wednesday 03 April 2002 18:24, Larry Wall wrote:
>
> Sure, just say
>
> { loop (my $i = intializer(); condition($i); $i = advance($i)) { ... }
}
>
> : Perhaps something like:
> :
> : initalizer() -> $i { LOOP: NEXT { $i = advance($i); redo LOOP if
> : condition($i);} ... }
> :
> : ex
Mark J. Reed wrote:
>
> # Perl 5 code
> for (my $i=0; 1; $i++) {
>
> which would translate into Perl 6 as:
>
>
> loop (my $i=0; 1; $i++) {
>
>
> May I infer from this the return of loop-scoped variables (in
> which the loop control variab
On Thu, Apr 04, 2002 at 09:37:19AM +1000, Damian Conway wrote:
Ah yes, that makes a lot of sense. Thank you.
Andrew
Andrew Wilson wrote:
> I'm sure I'm missing something fairly fundamental, but could someone
> shed more light on the example:
>
> # reduce list three-at-a-time
> $sum_of_powers = reduce { $^partial_sum + $^x ** $^y } 0, @xs_and_ys;
>
> specifically what is being iterated over, what gets bound
Piers Cawley wrote:
>
> Jonathan Scott Duff <[EMAIL PROTECTED]> writes:
>
> > On Wed, Apr 03, 2002 at 11:27:10AM -0800, Larry Wall wrote:
> >> They are assumed to be declared in alphabetical order. Whoa! you say,
> >> that could get confusing. It surely can. But if you're doing
> >> something
Buddha Buck writes:
: At 07:57 AM 04-03-2002 -0800, Larry Wall wrote:
: >Mark J. Reed writes:
: >: loop (my $i=0; 1; $i++) {
: >:
: >
: >No, the scope of $i stays outside, per the previous decision. If you
: >want it inside you can always make $i an official formal parameter:
: >
: >
Jonathan Scott Duff wrote:
>
> On Wed, Apr 03, 2002 at 12:41:13PM -0500, John Siracusa wrote:
> > Reading EX4 and seeing those "place-holder" variables made me wonder what
> > happens when someone (probably Damian ;) wants to use more than 26 of them.
> > Do the place-holder names scale up as if
Piers Cawley writes:
: Jonathan Scott Duff <[EMAIL PROTECTED]> writes:
:
: > On Wed, Apr 03, 2002 at 11:27:10AM -0800, Larry Wall wrote:
: >> They are assumed to be declared in alphabetical order. Whoa! you say,
: >> that could get confusing. It surely can. But if you're doing
: >> something c
Jonathan Scott Duff <[EMAIL PROTECTED]> writes:
> On Wed, Apr 03, 2002 at 11:27:10AM -0800, Larry Wall wrote:
>> They are assumed to be declared in alphabetical order. Whoa! you say,
>> that could get confusing. It surely can. But if you're doing
>> something complicated enough that alphabetic
On Wed, Apr 03, 2002 at 11:27:10AM -0800, Larry Wall wrote:
> They are assumed to be declared in alphabetical order. Whoa! you say,
> that could get confusing. It surely can. But if you're doing
> something complicated enough that alphabetical order would be
> confusing, don't use this shorthan
[EMAIL PROTECTED] writes:
: On Wed, Apr 03, 2002 at 12:41:13PM -0500, John Siracusa wrote:
: > Reading EX4 and seeing those "place-holder" variables made me wonder what
: > happens when someone (probably Damian ;) wants to use more than 26 of them.
: > Do the place-holder names scale up as if they
On Wed, Apr 03, 2002 at 12:19:13PM -0700, Luke Palmer wrote:
> On Wed, Apr 03, 2002 at 12:41:13PM -0500, John Siracusa wrote:
> > Reading EX4 and seeing those "place-holder" variables made me wonder what
>
> Where is EX4? It's not at perl.org... so... ??
Well, it's linked to from use.perl.org an
On Wed, Apr 03, 2002 at 12:41:13PM -0500, John Siracusa wrote:
> Reading EX4 and seeing those "place-holder" variables made me wonder what
Where is EX4? It's not at perl.org... so... ??
Hi
I'm sure I'm missing something fairly fundamental, but could someone
shed more light on the example:
# reduce list three-at-a-time
$sum_of_powers = reduce { $^partial_sum + $^x ** $^y } 0, @xs_and_ys;
specifically what is being iterated over, what gets bound and what does
it return?
I tho
On Wed, Apr 03, 2002 at 12:41:13PM -0500, John Siracusa wrote:
> Reading EX4 and seeing those "place-holder" variables made me wonder what
> happens when someone (probably Damian ;) wants to use more than 26 of them.
> Do the place-holder names scale up as if they're being automagically
> incremen
On Wed, Apr 03, 2002 at 12:53:33PM -0500, John Siracusa wrote:
> So it's the order that they appear that determines their binding? How would
> something like this (Perl 5 code) be represented:
>
> sub reverse_minus { $_[1] - $_[0] }
>
> I would have guessed it'd be:
>
> { $^b - $^a }
>
At 07:50 AM 4/3/2002 -0800, Larry Wall wrote:
>Piers Cawley writes:
>: Just a thought, I assume that something like the following will be legal:
>: Yeah, it's not good style; I should really be doing
>:
>: $msg.dispatch_to($self)
For some people (OO purists), switch statements are message dis
On 4/3/02 12:49 PM, Jonathan Scott Duff wrote:
> On Wed, Apr 03, 2002 at 12:41:13PM -0500, John Siracusa wrote:
>> Reading EX4 and seeing those "place-holder" variables made me wonder what
>> happens when someone (probably Damian ;) wants to use more than 26 of them.
>> Do the place-holder names s
On Wed, Apr 03, 2002 at 12:41:13PM -0500, John Siracusa wrote:
> Reading EX4 and seeing those "place-holder" variables made me wonder what
> happens when someone (probably Damian ;) wants to use more than 26 of them.
> Do the place-holder names scale up as if they're being automagically
> incremen
Reading EX4 and seeing those "place-holder" variables made me wonder what
happens when someone (probably Damian ;) wants to use more than 26 of them.
Do the place-holder names scale up as if they're being automagically
incremented? (e.g. ..., y, z, aa, ab, ...)
-John
On 4/3/02 12:07 PM, Brent Dax wrote:
> John Siracusa:
> # On 4/3/02 3:44 AM, Damian Conway wrote:
> # > Larry indicated to me that blockless declarations of
> # methods and subs would be illegal.
> #
> # What's the motivation for this?
>
> I assume it's to support the Perl 5 blockless style.
Ah
John Siracusa:
# On 4/3/02 3:44 AM, Damian Conway wrote:
# > Larry indicated to me that blockless declarations of
# methods and subs
# > would be illegal.
#
# What's the motivation for this? It seems to me that
# pre-declarations would
# be just as nice (or nicer) as:
#
# module Alpha;
#
At 07:57 AM 04-03-2002 -0800, Larry Wall wrote:
>Mark J. Reed writes:
>: loop (my $i=0; 1; $i++) {
>:
>
>No, the scope of $i stays outside, per the previous decision. If you
>want it inside you can always make $i an official formal parameter:
>
> for 0 .. Inf -> $i { ... }
>
>I t
On 4/3/02 3:44 AM, Damian Conway wrote:
> Larry indicated to me that blockless declarations of methods and subs
> would be illegal.
What's the motivation for this? It seems to me that pre-declarations would
be just as nice (or nicer) as:
module Alpha;
package Beta;
method Gamma::del
Mark J. Reed writes:
:
: # Perl 5 code
: for (my $i=0; 1; $i++) {
:
: which would translate into Perl 6 as:
:
:
: loop (my $i=0; 1; $i++) {
:
:
: May I infer from this the return of loop-scoped variables (in
: which the loop control v
Piers Cawley writes:
: Just a thought, I assume that something like the following will be legal:
:
: given $msg {
: when Message::ACK {
: $msg_store.fetch( $msg.acknowledged_msg ).set_state($msg);
: }
: when Message::SMS {
: when .is_incoming
# Perl 5 code
for (my $i=0; 1; $i++) {
which would translate into Perl 6 as:
loop (my $i=0; 1; $i++) {
May I infer from this the return of loop-scoped variables (in
which the loop control variable is magically inser
Damian Conway <[EMAIL PROTECTED]> writes:
>> > Eventually, of course, we'll have to go back and make eveything
>> > copacetic, but at the moment I think most folks would rather have us
>> > working on writing unwritten A's and E's, rather than rewriting
>> > written ones. ;-)
>>
>> Point. Maybe
Just a thought, I assume that something like the following will be legal:
given $msg {
when Message::ACK {
$msg_store.fetch( $msg.acknowledged_msg ).set_state($msg);
}
when Message::SMS {
when .is_incoming { ... }
when .is_outgoin
> So, I've been looking at the stuff in the Apocalypses and Exegeses so
> far and I think I've reached the point where I can have a crack at
> using perl 6 to implement another programming language. Coming
> (possibly) to a mailing list near you, Perl6::Scheme...
"Be afraid. Be very afraid." ;-)
> > Eventually, of course, we'll have to go back and make eveything
> > copacetic, but at the moment I think most folks would rather have us
> > working on writing unwritten A's and E's, rather than rewriting
> > written ones. ;-)
>
> Point. Maybe someone will step up to plate and do Perl 6 so fa
Damian Conway <[EMAIL PROTECTED]> writes:
>> Good oh. BTW, (and apologies for repeating the question I asked
>> elsewhere) are we going to see an updated Apocalypse 4 incorporating
>> all the changes made to get E4 to work?
>
> Probably not any time soon. Previous Apocalypses haven't been
> updat
So, I've been looking at the stuff in the Apocalypses and Exegeses so
far and I think I've reached the point where I can have a crack at
using perl 6 to implement another programming language. Coming
(possibly) to a mailing list near you, Perl6::Scheme...
--
Piers
"It is a truth universally
Uri asked:
> but what if there are multiple bound variables like this example:
>
> for %phonebook.kv -> $name, $number {
> print "$name: $number\n"
> }
>
> is $_ aliased to either/both/neither of the two topics? are those now
> not topics but just aliased variabl
> Good oh. BTW, (and apologies for repeating the question I asked
> elsewhere) are we going to see an updated Apocalypse 4 incorporating
> all the changes made to get E4 to work?
Probably not any time soon. Previous Apocalypses haven't been updated
when changes were made.
Eventually, of course,
Damian Conway <[EMAIL PROTECTED]> writes:
> Piers wrote:
>
>> Over on use.perl, someone spotted what looks like a bug in the example
>> program which (if it *is* a bug) is fixed by using unary '*', but
>> that's not what I'm writing about here.
>
> I'll admit I'm not sure whether it is a bug or n
from exegesis 4:
In Perl 6, the current topic -- whatever its name and however
you make it the topic -- is always aliased to $_.
and one of the examples is:
for @list -> $next {# iterate @list, aliasing each element to
# $next (and
Piers wrote:
> Over on use.perl, someone spotted what looks like a bug in the example
> program which (if it *is* a bug) is fixed by using unary '*', but
> that's not what I'm writing about here.
I'll admit I'm not sure whether it is a bug or not. I've asked Larry for
clarification and will post
Over on use.perl, someone spotted what looks like a bug in the example
program which (if it *is* a bug) is fixed by using unary '*', but
that's not what I'm writing about here.
In the discussion of the yadda yadda yadda operator, Damian says that
... in this example, Err::BadData is *never*
49 matches
Mail list logo