On Tue, Mar 08, 2005 at 05:49:54PM -0800, chromatic wrote:
: On Tue, 2005-03-08 at 17:39 -0800, Larry Wall wrote:
:
: > On Tue, Mar 08, 2005 at 03:23:14PM -0800, chromatic wrote:
:
: > : I could make the argument that it should be possible to decorate an
: > : object with a role. If that means g
On Tue, 2005-03-08 at 17:39 -0800, Larry Wall wrote:
> On Tue, Mar 08, 2005 at 03:23:14PM -0800, chromatic wrote:
> : I could make the argument that it should be possible to decorate an
> : object with a role. If that means generating a new anonymous class just
> : to have a vtable to munge, so
On Tue, Mar 08, 2005 at 03:23:14PM -0800, chromatic wrote:
: I could make the argument that it should be possible to decorate an
: object with a role. If that means generating a new anonymous class just
: to have a vtable to munge, so be it.
Er, how is that different from what we already said? O
On Mon, 2005-03-07 at 19:40 -0800, Larry Wall wrote:
> On Mon, Mar 07, 2005 at 05:56:12PM -0800, David Storrs wrote:
> : Actually, I guess they would have to be...can you apply a role to a
> : bare type?
> :
> : my int does SelectOutputFile; # I would expect this to fail
> : my Int d
On Mon, Mar 07, 2005 at 08:58:44PM -0800, David Storrs wrote:
: Ok, rewrite; is THIS legal?:
:
: sub foo( Int [EMAIL PROTECTED] is shape(3) ) { ... }
: foo(1, 2, undef);
Yes, since Int can represent undef.
: The sense I'm trying to convey is:
:
: "Here is my sub. It takes three
On Mon, Mar 07, 2005 at 07:50:47PM -0800, Larry Wall wrote:
> On Mon, Mar 07, 2005 at 05:37:53PM -0800, David Storrs wrote:
> : On Mon, Mar 07, 2005 at 04:58:29PM -0800, Larry Wall wrote:
> : Is
> : there is then any way to explicitly leave off an element. Can I do
> : this:
> :
> : sub foo(
On Mon, Mar 07, 2005 at 05:37:53PM -0800, David Storrs wrote:
: On Mon, Mar 07, 2005 at 04:58:29PM -0800, Larry Wall wrote:
: >
: > In fact, we really haven't specified what happens when you say
: >
: > my Int @a is shape(3) := [1,2];
: > my Int @b is shape(3) := [1,2,3,4];
: >
: [...]
:
On Mon, Mar 07, 2005 at 05:56:12PM -0800, David Storrs wrote:
: On Mon, Mar 07, 2005 at 05:15:14PM -0800, Larry Wall wrote:
: > On Mon, Mar 07, 2005 at 02:20:47PM -0800, David Storrs wrote:
: > : Yes, I know. That's what I meant by "...arrays are objects...(sort
: >
: > No, they're real objects.
On Mon, Mar 07, 2005 at 05:15:14PM -0800, Larry Wall wrote:
> On Mon, Mar 07, 2005 at 02:20:47PM -0800, David Storrs wrote:
> : Yes, I know. That's what I meant by "...arrays are objects...(sort
>
> No, they're real objects. (Though it's .elems rather than .length, since
> we've banished the "l"
On Mon, Mar 07, 2005 at 04:58:29PM -0800, Larry Wall wrote:
>
> In fact, we really haven't specified what happens when you say
>
> my Int @a is shape(3) := [1,2];
> my Int @b is shape(3) := [1,2,3,4];
>
[...]
> But I also have this nagging feeling that the user wouldn't have
> specified
On Mon, Mar 07, 2005 at 02:20:47PM -0800, David Storrs wrote:
: Yes, I know. That's what I meant by "...arrays are objects...(sort
: of)." They are objects in the sense that they are sort of references
: and sort of not and that they have behavior built into them
: (e.g. C<.length>). They won't a
On Mon, Mar 07, 2005 at 10:29:58PM +0100, Aldo Calpini wrote:
: Larry Wall wrote:
: >Or, assuming you might want to generalize to N dimensions someday, just
: >
: >sub bar ([EMAIL PROTECTED]) {...}
: >
: >and deal with it as in Perl 5 as a variadic list. I suppose one could say
: >
: >sub
On Mon, Mar 07, 2005 at 05:36:08PM +0100, Aldo Calpini wrote:
> David Storrs wrote:
> >Urk. I, for one, will definitely find this surprising. I would have
> >expected:
> >
> > x = ; $y = 1; z = 2 3
>
> to obtain what you have expected, you need to explicitly treat the array
> as a list of value
Larry Wall wrote:
Or, assuming you might want to generalize to N dimensions someday, just
sub bar ([EMAIL PROTECTED]) {...}
and deal with it as in Perl 5 as a variadic list. I suppose one could say
sub bar ([EMAIL PROTECTED] is shape(3)) {...}
and get checking on the argument count.
if I u
On Mon, Mar 07, 2005 at 05:36:08PM +0100, Aldo Calpini wrote:
: but then, you could define:
:
: multi sub bar($x, $y, $z) { ... }
: multi sub bar(@coords is shape(3)) {
: my($x, $y, $z) = @coords;
: return bar($x, $y, $z);
: }
:
: bar(@coords); # ok now
Or, assumi
David Storrs wrote:
Urk. I, for one, will definitely find this surprising. I would have
expected:
x = ; $y = 1; z = 2 3
to obtain what you have expected, you need to explicitly treat the array
as a list of values with the unary splat:
foo($x, [EMAIL PROTECTED]);
But I suppose it's all a qu
On Sun, Mar 06, 2005 at 11:58:43PM -0800, Larry Wall wrote:
> On Sun, Mar 06, 2005 at 02:13:09AM -0700, Luke Palmer wrote:
> : What is output:
> :
> : sub foo($x, ?$y, [EMAIL PROTECTED]) {
> : say "x = $x; y = $y; z = @z[]";
> : }
> :
> : my @a = (1,2,3);
> : foo($x, @a);
On Mon, Mar 07, 2005 at 03:03:08AM +0200, Yuval Kogman wrote:
: On Sun, Mar 06, 2005 at 02:13:09 -0700, Luke Palmer wrote:
: > What is output:
: >
: > sub foo($x, ?$y, [EMAIL PROTECTED]) {
: > say "x = $x; y = $y; z = @z[]";
: > }
: >
: > my @a = (1,2,3);
: > foo($x, @a);
On Sun, Mar 06, 2005 at 02:13:09AM -0700, Luke Palmer wrote:
: What is output:
:
: sub foo($x, ?$y, [EMAIL PROTECTED]) {
: say "x = $x; y = $y; z = @z[]";
: }
:
: my @a = (1,2,3);
: foo($x, @a);
I think it should say something like:
Use of undefined value at foo line
On Sun, Mar 06, 2005 at 02:13:09 -0700, Luke Palmer wrote:
> What is output:
>
> sub foo($x, ?$y, [EMAIL PROTECTED]) {
> say "x = $x; y = $y; z = @z[]";
> }
>
> my @a = (1,2,3);
> foo($x, @a);
And is
$a ==> foo $x;
The same?
--
() Yuval Kogman <[EMAIL PROTEC
Luke Palmer <[EMAIL PROTECTED]> wrote:
> What is output:
>
> sub foo($x, ?$y, [EMAIL PROTECTED]) {
> say "x = $x; y = $y; z = @z[]";
> }
>
> my @a = (1,2,3);
> foo($x, @a);
IANALarry, but I'd think
x = ($x's value); y = 1 2 3; z =
The $y is implicitly typed Any, and
What is output:
sub foo($x, ?$y, [EMAIL PROTECTED]) {
say "x = $x; y = $y; z = @z[]";
}
my @a = (1,2,3);
foo($x, @a);
Thanks,
Luke
22 matches
Mail list logo