Is S05 correct?

2006-02-02 Thread Yiyi Hu
Hmm, There are sevral appears in S05 which use = instead of - in a for loop. So, Is this a typo? eg: for @{$pairs} = $pair { say Key: $pair[0]; say Val: $pair[1]; } Thanks, Xinming

Re: Is S05 correct?

2006-02-02 Thread Larry Wall
On Fri, Feb 03, 2006 at 03:02:12AM +0800, Yiyi Hu wrote: : Hmm, : There are sevral appears in S05 which use = instead of - in a for loop. : So, Is this a typo? : eg: : for @{$pairs} = $pair { : say Key: $pair[0]; : say Val: $pair[1]; : } Yes, that's a typo. Thanks. It is

Re: Macros?

2006-02-02 Thread Larry Wall
On Sun, Jan 29, 2006 at 08:13:44PM +, Luke Palmer wrote: : On 1/29/06, Yuval Kogman [EMAIL PROTECTED] wrote: : Aside from that they are normal perl 6 subroutines, that simply get : invoked during compile time instead of during runtime. : : With one extra feature. By default (my preference)

Re: Macros?

2006-02-02 Thread Larry Wall
After a little more cleanup, S06 now reads: =head2 Macros Macros are functions or operators that are called by the compiler as soon as their arguments are parsed (if not sooner). The syntactic effect of a macro declaration or importation is always lexically scoped, even if

something between state and my

2006-02-02 Thread Dave Whipp
(from p6i) Larry Wall wrote: On Thu, Feb 02, 2006 at 07:12:08PM +0100, Leopold Toetsch wrote: : ... Anyway, : the P6 model of state is more like a persistent lexical than like : C's static. : : Sorry for my dumb question - what's the difference then? (Besides that C : dosn't have closures

Re: something between state and my

2006-02-02 Thread Luke Palmer
On 2/3/06, Dave Whipp [EMAIL PROTECTED] wrote: sub factorial(Int $x) { temp state Int $result = 1; $result *= $x; factorial $x-1 if $x 2; return $result if want; } say factorial 6; That's precisely what env variables are for. The right way: sub