HaloO,
Larry Wall wrote:
In general, we're trying to get away from want-based context dependency
and instead attempting to encourage lazy semantic constructs such
as Captures that can behave with a wide dynamic range when actually
bound later.
Shouldn't we then change the heading of the
HaloO,
John M. Dlugosz wrote:
How about sub foo (-- Seq^Item) {...}?
Interesting idea, but that doesn't tell the compiler that the return is
keyed to the context. The compiler should know what return type to
expect, if only I could explain it.
Sorry, the type has nothing to do with how
HaloO,
John M. Dlugosz wrote:
Great. So the flip side is, what do I return from a function so that it
gives a single value if called simply, but provides optional named
returns that are there if you catch them? As a capture with one
positional and one named argument?
Yeah, just that.
TSa Thomas.Sandlass-at-barco.com |Perl 6| wrote:
I guess with strong you mean as lossless as possible?
I think the type is just :( $: :named$ ) if you want to extract the
invocant with a $ prefix. Otherwise it would be :( $, :named$ ) and you
extract the item positionally with prefix @ or
HaloO,
John M. Dlugosz wrote:
I don't want to have to extract it. I want to be able to say
$x = foo
I guess that does not collapse the capture that foo returns. So
it goes into $x unaltered. If you later use $x as an invocant
of a method this extracts the invocant slot from the
On Apr 21, 2008, at 9:39 , John M. Dlugosz wrote:
TSa Thomas.Sandlass-at-barco.com |Perl 6| wrote:
I think the type is just :( $: :named$ ) if you want to extract
the invocant with a $ prefix. Otherwise it would be :( $, :named
$ ) and you
extract the item positionally with prefix @ or
Brandon S. Allbery KF8NH allbery-at-ece.cmu.edu |Perl 6| wrote:
my ($x, :$named) = foo; # or something like that
That looks to me like a form of positional extraction. (Of course, my
hit rate on p6 stuff has been remarkably low of late...)
It's not just positional, but allows
HaloO John,
your inquiry rate is quite high. I try to keep-up as good
as I can. Without being authoritative, of course.
you wrote:
If a function returns different things if called in list context or
item context, how do you define the of type (outer return type) to
make the function strongly
On Fri, Apr 18, 2008 at 05:34:25AM -0500, John M. Dlugosz wrote:
If a function returns different things if called in list context or item
context, how do you define the of type (outer return type) to make the
function strongly typed?
You can't. An of type forces the function into a single
If a function returns different things if called in list context or
item context, how do you define the of type (outer return type) to
make the function strongly typed?
How about sub foo (-- Seq^Item) {...}?
Interesting idea, but that doesn't tell the compiler that the return is
keyed to
Great. So the flip side is, what do I return from a function so that it
gives a single value if called simply, but provides optional named
returns that are there if you catch them? As a capture with one
positional and one named argument?
And how do you declare =that= return type (of type)
11 matches
Mail list logo