Re: Returning Arrays?

2008-04-18 Thread Larry Wall
On Wed, Apr 16, 2008 at 07:51:03PM -0500, John M. Dlugosz wrote: > No, *@ is the slurpy array parameter. I was thinking of > > (*,*,$x) = @array; # skips first two elements > > to suppose that @* might mean "no name" if the syntax would not allow for > bare @ there without an identifier.

Re: Returning Arrays?

2008-04-17 Thread Ilmari Vacklin
On Thu, Apr 17, 2008 at 03:41:06PM -0500, John M. Dlugosz wrote: > The multi-dictionary search didn't show this usage of covariance and > contravariance. But the series of articles on Type Theory in JOT uses > it to mean "in the same direction" and "in the opposite direction" but > doesn't d

Re: Returning Arrays?

2008-04-17 Thread John M. Dlugosz
TSa Thomas.Sandlass-at-barco.com |Perl 6| wrote: HaloO, John M. Dlugosz wrote: Variance? Yeah, the standard set of co-, contra-, in- and bivariance ;) Assume A <: B being subtypes. Then how should Foo[A] and Foo[B] relate? Foo[A] <: Foo[B] # covariance Foo[B] <: Foo[A] # contravar

Re: Returning Arrays?

2008-04-17 Thread TSa
HaloO, John M. Dlugosz wrote: Variance? Yeah, the standard set of co-, contra-, in- and bivariance ;) Assume A <: B being subtypes. Then how should Foo[A] and Foo[B] relate? Foo[A] <: Foo[B] # covariance Foo[B] <: Foo[A] # contravariance Invariance means there's no relation at all

Re: Returning Arrays?

2008-04-16 Thread John M. Dlugosz
TSa Thomas.Sandlass-at-barco.com |Perl 6| wrote: HaloO, John M. Dlugosz wrote: I seem to recall seeing sigils in a signature without names, but now I can't remember where. E.g. in S06 und section "The want function". Regards, TSa. Somewhere else, I think it discussed unnamed parameters to fu

Re: Returning Arrays?

2008-04-16 Thread John M. Dlugosz
TSa Thomas.Sandlass-at-barco.com |Perl 6| wrote: HaloO, John M. Dlugosz wrote: How do you declare a function that returns an array? Something like sub foo (blah) is Array of X { ... } I meant "of", not "is". In general the of keyword instanciates parametric types just like the direct

Re: Returning Arrays?

2008-04-16 Thread TSa
HaloO, John M. Dlugosz wrote: I seem to recall seeing sigils in a signature without names, but now I can't remember where. E.g. in S06 und section "The want function". Regards, TSa. -- "The unavoidable price of reliability is simplicity" -- C.A.R. Hoare

Re: Returning Arrays?

2008-04-16 Thread TSa
HaloO, John M. Dlugosz wrote: How do you declare a function that returns an array? Something like sub foo (blah) is Array of X { ... } The 'is' there is your invention, isn't it? The synopsis require 'of' or 'returns' depending if you want to specify the outer and/or inner type. The 'is'

Returning Arrays?

2008-04-16 Thread John M. Dlugosz
How do you declare a function that returns an array? Something like sub foo (blah) is Array of X { ... } seems right, but it has two problems. First is a real problem, and is a mistake seen a lot in C# and the .NET framework. A concrete type is used when it should be an interface. What