Lazyness and IO

2005-07-29 Thread David Formosa \(aka ? the Platypus\)
I was thinking about lazyness and IO and worked out this potenial gotcha. In essence its quite simmler to the pipe buffering problems you sometimes can get in perl5. my IO $news = io("nntp://nntp.perl.org",:rw); # Open a nntp connection my $banner = =$news # Throw away the banner. So far so goo

Re: The Use and Abuse of Liskov

2005-07-29 Thread Damian Conway
Luke wrote: A variant a is said to be _more specific than_ a variant b if: * Every type in a's signature is a subset (derived from or equal) of the corresponding type in b's signature. * At least one of these is a proper subset (not an equality). A variant is dispatched i

Re: Curious use of .assuming in S06

2005-07-29 Thread Autrijus Tang
On Fri, Jul 29, 2005 at 12:53:03PM -0700, Brent 'Dax' Royal-Gordon wrote: > Autrijus Tang <[EMAIL PROTECTED]> wrote: > > In S06's Currying section, there are some strange looking examples: > > > > &textfrom := &substr.assuming(:str($text) :len(Inf)); > > > > &textfrom := &substr.assuming:

Re: Curious use of .assuming in S06

2005-07-29 Thread Brent 'Dax' Royal-Gordon
Autrijus Tang <[EMAIL PROTECTED]> wrote: > In S06's Currying section, there are some strange looking examples: > > &textfrom := &substr.assuming(:str($text) :len(Inf)); > > &textfrom := &substr.assuming:str($text):len(Inf); > > &woof ::= &bark:(Dog).assuming :pitch; > > Why is it al

Curious use of .assuming in S06

2005-07-29 Thread Autrijus Tang
In S06's Currying section, there are some strange looking examples: &textfrom := &substr.assuming(:str($text) :len(Inf)); &textfrom := &substr.assuming:str($text):len(Inf); &woof ::= &bark:(Dog).assuming :pitch; Why is it allowed to omit comma between adverbial pairs, and even omit

Re: lazy list syntax?

2005-07-29 Thread Flavio S. Glock
Just wondering - would 'reverse =$foo' call '$foo.previous()' ? - Flavio 2005/7/29, Aankhen <[EMAIL PROTECTED]>: > On 7/29/05, Flavio S. Glock <[EMAIL PROTECTED]> wrote: > > Is "for =" only for filehandles? I tried: > > No, it's for anything that supports iteration... `=$foo` == > `$foo.next()`,

Re: Slurpy "is rw" arrays ([EMAIL PROTECTED] is rw)

2005-07-29 Thread TSa (Thomas Sandlaß)
HaloO, Adriano Ferreira wrote: Only sub foobar (@args) { push @args, 42 } would change @some_array in foobar @some_array; That is how I undestood that. Can someone confirm this belief? I share your belief. It's up to others to confirm it. I just want to add that I f

Complete type inferencing

2005-07-29 Thread Autrijus Tang
On Fri, Jul 29, 2005 at 04:59:21AM +0800, Autrijus Tang wrote: > However, my intuition is that a soft-typed system, with clearly defined > dynamic parts translated to runtime coerce and dependent types, that can > work exactly as Perl 5 did at first, but provide sensible inferencing > and compile-t

Re: Slurpy "is rw" arrays ([EMAIL PROTECTED] is rw)

2005-07-29 Thread Adriano Ferreira
On 7/29/05, Ingo Blechschmidt <[EMAIL PROTECTED]> wrote: > Or is @args always readonly and the declaration ([EMAIL PROTECTED] is rw) is > an > error? The declaration ([EMAIL PROTECTED] is rw) can't be outlawed as it is how Perl 5 default sig translates to Perl 6. IMHO @args as a parameter works

Re: An idea for doing pack.

2005-07-29 Thread David Formosa \(aka ? the Platypus\)
On Thu, 28 Jul 2005 15:46:14 +0300, Yuval Kogman <[EMAIL PROTECTED]> wrote: [...] > I like your Pack object - that is the parsed template, but I'd also > like to be able to generate these templates with a programmatic > interface that isn't string concatenation... > > Is it just a simple data st

Slurpy "is rw" arrays ([EMAIL PROTECTED] is rw)

2005-07-29 Thread Ingo Blechschmidt
Hi, are the following assumptions correct? sub foo ([EMAIL PROTECTED]) { push @args, 42 } sub bar ([EMAIL PROTECTED] is rw) { push @args, 42 } foo @some_array; # dies ("Can't modify constant array...") bar @some_array; # works, but does not change @some_array, as the

Re: lazy list syntax?

2005-07-29 Thread Aankhen
On 7/29/05, Flavio S. Glock <[EMAIL PROTECTED]> wrote: > Is "for =" only for filehandles? I tried: No, it's for anything that supports iteration... `=$foo` == `$foo.next()`, if I recall correctly. It's probably not yet implemented. Aankhen