Dan Sugalski <[EMAIL PROTECTED]> wrote:
> At 3:53 PM + 2/14/02, Dave Mitchell wrote:
> >My outstanding niggle is when a typed variable is undef. I guess we
> >need a generic Perl_Undef_But_Typed vtable type, which behaves mostly
> >like the PerlUndef type, but saves a pointer to its 'real' vta
At 3:53 PM + 2/14/02, Dave Mitchell wrote:
>My outstanding niggle is when a typed variable is undef. I guess we
>need a generic Perl_Undef_But_Typed vtable type, which behaves mostly
>like the PerlUndef type, but saves a pointer to its 'real' vtable in
>self->data or whatever. When it's assign
TECTED]
Subject: Re: PMCs, setting,
and suchlike things
02/14/2002 10
At 3:48 PM + 2/14/02, Alex Gough wrote:
>On Thu, 14 Feb 2002, Melvin Smith wrote:
>
>> >my Dog $spot = Dog.new("waggly tail");
>> >$spot = Cat.new();
>>
>> In this case all types are known at compile time. Why would
>> we relegate this to a runtime vtable check or bit flag?
>
>There's no r
Dan Sugalski <[EMAIL PROTECTED]> wrote:
> There's a flag in the flags field to mark the PMC as a permanent type
> or not. It's insufficient for "Type X or child of X" things, though.
>
> >Or to put it another way, is the type of a PMC determined purely by
> >it's current vtable pointer, and if s
On Thu, 14 Feb 2002, Melvin Smith wrote:
> >my Dog $spot = Dog.new("waggly tail");
> >$spot = Cat.new();
>
> In this case all types are known at compile time. Why would
> we relegate this to a runtime vtable check or bit flag?
There's no reason to suspect that Dog::new will actually return a Dog
3 cc:
AM Subject: Re: PMCs, setting, and
suc
At 11:46 AM + 2/14/02, Dave Mitchell wrote:
>Dan Sugalski <[EMAIL PROTECTED]> wrote:
>> Right, for typed variables. Most variables (i.e. anything you
>> declared with a plain "my $foo" or "our @bar") are untyped and can
>> change their types as needed.
>>
>> If you did:
>>
>> my $foo;
On Thu, Feb 14, 2002 at 02:10:20PM +, Dave Mitchell wrote:
> 2. If so, how do we distinguish between two PMCs, both of whose
> vtable pointers currently point to the 'Dog' vtable, but one of whom has
> been delared as type Dog and so should never have it's vatble pointer
> updated, and the oth
Alex Gough <[EMAIL PROTECTED]> wrote:
> On Thu, 14 Feb 2002, Dave Mitchell wrote:
> > > $foo would first be a Dog, then a FireHydrant. When it changed to a
> > > FireHydrant the previous contents would get blown away.
> >
> > Hmmm - how do we distinguish between a plain scalar that is temporarily
On Thu, 14 Feb 2002, Dave Mitchell wrote:
> > $foo would first be a Dog, then a FireHydrant. When it changed to a
> > FireHydrant the previous contents would get blown away.
>
> Hmmm - how do we distinguish between a plain scalar that is temporarily
> typed, and a 'proper' permanently-typed scala
Dan Sugalski <[EMAIL PROTECTED]> wrote:
> Right, for typed variables. Most variables (i.e. anything you
> declared with a plain "my $foo" or "our @bar") are untyped and can
> change their types as needed.
>
> If you did:
>
> my $foo;
> $foo = Dog.new();
> $foo = FireHydrant.new();
>> my $plain = $c - $d : Math::Complex # 3.0 + 0i
>> sqrt(2 : Math::Integers) # -> exception or not-a-number
>Not a bad idea,. I beleive that the perl6 adjective operator
>(for functions) will be a semicolon, not a colon. I'm not
>sure how it is planned to apply it to operators.
>
>Its a
: This might be even more "Complex" than that - what if Complex can be
: reduced? Should it? for instance:
:
: my Complex $c = 3+4i;
: my Complex $d = 4i;
: my $plain = $c / $d;
:
: Does $plain (which is actually '3' after reducing) get promoted to Complex,
: or does the result from the division
> In a related matter, computer languages with Symbolic Mathematics
> capabilities, like Mapple, let you explicitly demand where do
> you want the operation to take place.
>
> This could be done naturally in perl6 using the colon meta-operator:
>
> my $plain = $c - $d : Math::Complex # 3.0 + 0
> my Complex $c = 3+4i;
> my Complex $d = 4i;
> my $plain = $c / $d;
>
> Does $plain (which is actually '3' after reducing) get promoted to
> Complex, or does the result from the division get demoted?
In a related matter, computer languages with Symbolic Mathematics
capabilities, like Mapple, le
At 3:43 PM + 2/13/02, Dave Mitchell wrote:
>Dan Sugalski <[EMAIL PROTECTED]> wrote:
>> >So in the following:
>> >
>> >my Complex $c = 3+4i;
>> >my $plain = 1.1;
>> >$plain = $c;
>> >
>> >I presume that $plain ends up as type Complex (with value 3+4i)?
>>
>> Yup.
>>
>> >If so, how does
At 11:12 AM -0500 2/13/02, Buddha Buck wrote:
>At 03:43 PM 02-13-2002 +, Dave Mitchell you wrote:
>>Dan Sugalski <[EMAIL PROTECTED]> wrote:
>>> >So in the following:
>>> >
>>> >my Complex $c = 3+4i;
>>> >my $plain = 1.1;
>>> >$plain = $c;
>>> >
>>> >I presume that $plain ends up as type
> "W" == Wizard <[EMAIL PROTECTED]> writes:
>> my Complex $c = 3+4i;
>> my $plain = 1.1;
>> $plain = $c;
W> This might be even more "Complex" than that - what if Complex can be
W> reduced? Should it? for instance:
W> my Complex $c = 3+4i;
W> my Complex $d = 4i;
W> my $plain
"Wizard" <[EMAIL PROTECTED]> writes:
> This came up on perl6-internals, and Dan liked the "try" suggestion and
> suggested That I post it here for comments. I'm not subscribed to
> p6-language, so you'll need to include me in any replies where you want a
> response from me.
> =
This came up on perl6-internals, and Dan liked the "try" suggestion and
suggested That I post it here for comments. I'm not subscribed to
p6-language, so you'll need to include me in any replies where you want a
response from me.
=
Dave M
At 03:43 PM 02-13-2002 +, Dave Mitchell you wrote:
>Dan Sugalski <[EMAIL PROTECTED]> wrote:
> > >So in the following:
> > >
> > >my Complex $c = 3+4i;
> > >my $plain = 1.1;
> > >$plain = $c;
> > >
> > >I presume that $plain ends up as type Complex (with value 3+4i)?
> >
> > Yup.
> >
> > >If so
Dan Sugalski wrote:
> >my Complex $c = 3+4i;
> >my Complex $d = 4i;
> >my $plain = $c / $d;
> >
> >Does $plain get promoted, or does the result from the division
> get demoted?
>
> Since $plain's not a fixed scalar type, it should be whatever the
> division of $c and $d produces, presumably a comp
At 7:16 AM -0800 2/13/02, Wizard wrote:
> > my Complex $c = 3+4i;
>> my $plain = 1.1;
>> $plain = $c;
>
>This might be even more "Complex" than that - what if Complex can be
>reduced? Should it? for instance:
>
>my Complex $c = 3+4i;
>my Complex $d = 4i;
>my $plain = $c / $d;
>
>Does $plain get
Dan Sugalski <[EMAIL PROTECTED]> wrote:
> >So in the following:
> >
> >my Complex $c = 3+4i;
> >my $plain = 1.1;
> >$plain = $c;
> >
> >I presume that $plain ends up as type Complex (with value 3+4i)?
>
> Yup.
>
> >If so, how does $plain know how to "morph itself into the RHS's type"?
>
> The g
At 10:48 AM + 2/13/02, Dave Mitchell wrote:
>Dan Sugalski <[EMAIL PROTECTED]> wrote:
>> #2 is what you get with normal assignment. $foo = $bar, for example.
>> $foo's assign vtable method is called with $bar as a parameter. $foo
>> figures out what it should do--if it's a tied variable of s
> my Complex $c = 3+4i;
> my $plain = 1.1;
> $plain = $c;
This might be even more "Complex" than that - what if Complex can be
reduced? Should it? for instance:
my Complex $c = 3+4i;
my Complex $d = 4i;
my $plain = $c / $d;
Does $plain get promoted, or does the result from the division get demo
Dan Sugalski <[EMAIL PROTECTED]> wrote:
> #2 is what you get with normal assignment. $foo = $bar, for example.
> $foo's assign vtable method is called with $bar as a parameter. $foo
> figures out what it should do--if it's a tied variable of some sort
> it should perform its assign action. (Thi
Dan Sugalski:
# So, what about the ramifications of:
#
# $foo = @bar
#
# @bar's get_integer method is called, and $foo's set_integer method is
# called. No temp PMCs.
Huh? Assigning an array to a scalar yields a reference to an array. In
integer context that yields the length. In string c
At 11:39 PM + 2/12/02, Simon Cozens wrote:
>Dan Sugalski:
>> So, what about the ramifications of:
>
>No. You've glossed over the details of how we know that
>
>this assignment is integer, and
>
>this assignment is string,
>
>and this assignment is integer.
>
>Parrot can't know this, surely.
Dan Sugalski:
> So, what about the ramifications of:
No. You've glossed over the details of how we know that
> $foo = @bar
> @bar's get_integer method is called, and $foo's set_integer method is
> called. No temp PMCs.
this assignment is integer, and
> $foo = %bar
> calls %bar's get_s
We've been going around a bit about how PMCs should be set and
assigned to and suchlike things. So, here's the scoop.
There are three sorts of assignment:
1) Pointer assignment
2) Requests to get a value
3) Forced value sets
#1 is essentially a sort of bookkeeping. A pointer to one sort of PMC
32 matches
Mail list logo