Re: RFC 47 (v1) Universal Asynchronous I/O

2000-08-08 Thread Ken Fox
Buddha Buck wrote: > They represent the -entire- future history of the program. You imply that the entire current state of a program is captured in a continuation. Is that really true? In a pure functional language it is (side-effect free). In Perl (and Scheme) assignments to global variables pro

Re: RFC 120 (v2) Implicit counter in for statements, possibly $#.

2000-08-19 Thread Ken Fox
"Christopher J. Madsen" wrote: > foreach $item $index (@array) { > print $item, " is at index ", $index, "\n"; > } That's useful syntax, but I'd rather it mean stepping pair-wise through @array. Then we could scan through a hash with foreach $key $value (%hash) { ... } (Hashes are

Re: RFC 178 (v1) Lightweight Threads

2000-08-31 Thread Ken Fox
Perl6 RFC Librarian wrote: > =head2 Each thread gets its own copy of block-scoped lexicals upon > execution of C > > Example 8 > > #!/my/path/to/perl > foo(); > Thread->new(\&foo); > > sub foo > { > my $a = 1; > print $a++; > } [prints "11"] This must b

Re: RFC 178 (v1) Lightweight Threads

2000-08-31 Thread Ken Fox
[cc'd to internals to check a possible performance problem.] Steven W McDougall wrote: > > The more interesting case is this: > > > > #!/my/path/to/perl > > sub foo_generator { my $a = shift; sub { print $a++ } } > > my $foo = foo_generator(1); > > $foo->(); > > Thread->new($f

Re: RFC 178 (v1) Lightweight Threads

2000-09-08 Thread Ken Fox
Steven W McDougall wrote: > How do `our' and `my' control mutex locking? I was assuming that all global (or "non-my" rather) variables would by default be shared when using a thread-enabled perl. That seems like a sensible default. If we're going to require the :shared modifier, then ignore my co

Re: RFC 178 (v1) Lightweight Threads

2000-09-08 Thread Ken Fox
Steven W McDougall wrote: > Question: Can the interpreter determine when a variable becomes > shared? > > Answer: No. Then neglecting to put a :shared attribute on a shared > variable will crash the interpreter. This doesn't seem very Perlish. If the variable isn't :shared then how can it be sha