Re: What should +:21a produce?

2008-09-16 Thread Aristotle Pagaltzis
* Patrick R. Michaud [EMAIL PROTECTED] [2008-09-15 02:25]: So, I'm wondering what happens in the string-to-number case if there happen to be characters within the angles that are not valid digits for the given radix. A similar question holds for calling radix converters as functions Since

Re: How to define a new value type?

2008-09-16 Thread Stéphane Payrard
On Tue, Sep 16, 2008 at 6:11 AM, Patrick R. Michaud [EMAIL PROTECTED] wrote: On Mon, Sep 15, 2008 at 10:09:41PM -0500, John M. Dlugosz wrote: Darren Duncan darren-at-darrenduncan.net |Perl 6| wrote: So, how does one get an object to pretend to be a value type for purposes of assignment? I

Re: How to define a new value type?

2008-09-16 Thread Mark J. Reed
On Tue, Sep 16, 2008 at 4:26 AM, Stéphane Payrard [EMAIL PROTECTED] wrote: I don't understand how = differs with that semantic from := I would expect that = would make a copy (clone?) of the object. Assignment does copy the value between two containers, but in this case, the value just happens

Re: How to define a new value type?

2008-09-16 Thread TSa
HaloO, Darren Duncan wrote: If you are wanting to actually mutate a Dog in a user-visible way rather than deriving another Dog, then I don't think that calling Dog a value type is appropriate. I think that mutating methods of immutable value types just have to modify the identity. The

Re: How to define a new value type?

2008-09-16 Thread Moritz Lenz
TSa wrote: HaloO, Darren Duncan wrote: If you are wanting to actually mutate a Dog in a user-visible way rather than deriving another Dog, then I don't think that calling Dog a value type is appropriate. I think that mutating methods of immutable value types just have to modify the

Re: {SPAM} Re: How to define a new value type?

2008-09-16 Thread Daniel Ruoso
Ter, 2008-09-16 às 18:04 +0200, TSa escreveu: I think that mutating methods of immutable value types just have to modify the identity. The problem is how that relates to references. Take e.g. the Str type I really think we are looking at this problem from the wrong perspective. For an Object

Re: How to define a new value type?

2008-09-16 Thread John M. Dlugosz
Stéphane Payrard cognominal-at-gmail.com |Perl 6| wrote: I don't understand how = differs with that semantic from := I would expect that = would make a copy (clone?) of the object. For a mutable object, I don't know if that copy should be immediate or deffered by a mechanism of copy on write.

Re: How to define a new value type?

2008-09-16 Thread John M. Dlugosz
TSa Thomas.Sandlass-at-vts-systems.de |Perl 6| wrote: I think that mutating methods of immutable value types just have to modify the identity. The problem is how that relates to references. Take e.g. the Str type my $s = 'abc'; # $s points to 'abc' $s.reverse; where the reverse method

Re: How to define a new value type?

2008-09-16 Thread John M. Dlugosz
Daniel Ruoso daniel-at-ruoso.com |Perl 6| wrote: For an Object to be a value, it means that if you build an object with the same value, it will be seen as the same value that some other object with this value. Perl 6 formalizes this by defining a value type as one whose identity is keyed to