Re: [svn:perl6-synopsis] r13495 - doc/trunk/design/syn

2006-12-20 Thread Smylers
[EMAIL PROTECTED] writes:

 New Revision: 13495
doc/trunk/design/syn/S12.pod
 
 +In addition to Cnext METHOD, the special functions Ccallsame,
 +Ccallwith, Cnextsame, and Cnextwith dispatch to the next
 +candidate, possibly with a new argument list, and if the next
 +variant is used, without returning:
 +
 +callsame;   # call with the original arguments (return here)
 +callwith(); # call with no arguments (return here)
 +callwith(1,2,3);# call with a new set of arguments (return here)
 +nextsame;   # redispatch with the original arguments (no return)
 +nextwith(); # redispatch with no arguments (no return)
 +nextwith(1,2,3);# redispatch with a new set of arguments (no return)

So Cnext sometimes has the meaning of jumping to the next iteration of
the current loop (as in Perl 5), and sometimes means to invoke a
different method in place of the current one; nextsame and nextwith are
related to the latter meaning.

Won't that be confusing?  Or hard to teach?

The 'loop' use of Cnext is likely to be encountered by learning
programmers far earlier than 'method' use, leaving the latter as
something to trip them up when they finally meet it.

Smylers


Re: [svn:perl6-synopsis] r13495 - doc/trunk/design/syn

2006-12-20 Thread Larry Wall
On Wed, Dec 20, 2006 at 10:24:55PM +, Smylers wrote:
: [EMAIL PROTECTED] writes:
: 
:  New Revision: 13495
: doc/trunk/design/syn/S12.pod
:  
:  +In addition to Cnext METHOD, the special functions Ccallsame,
:  +Ccallwith, Cnextsame, and Cnextwith dispatch to the next
:  +candidate, possibly with a new argument list, and if the next
:  +variant is used, without returning:
:  +
:  +callsame;   # call with the original arguments (return here)
:  +callwith(); # call with no arguments (return here)
:  +callwith(1,2,3);# call with a new set of arguments (return here)
:  +nextsame;   # redispatch with the original arguments (no 
return)
:  +nextwith(); # redispatch with no arguments (no return)
:  +nextwith(1,2,3);# redispatch with a new set of arguments (no 
return)
: 
: So Cnext sometimes has the meaning of jumping to the next iteration of
: the current loop (as in Perl 5), and sometimes means to invoke a
: different method in place of the current one; nextsame and nextwith are
: related to the latter meaning.
: 
: Won't that be confusing?  Or hard to teach?
: 
: The 'loop' use of Cnext is likely to be encountered by learning
: programmers far earlier than 'method' use, leaving the latter as
: something to trip them up when they finally meet it.

Fact is, there *is* a loop there, at least for method dispatch.  That's
how next METHOD works, after all.

And if every word we put into Perl prevents us from using longer words
that start with the same letters, we're in deep yogurt.

Larry