On Thu, Oct 30, 2008 at 08:03:17AM -0700, Ovid wrote:
This code:
class Point {
has $.x is rw;
has $.y is rw;
method get_string () {
return $.x, $.y;
}
}
my Point $point .= new( :x1.2, :y-3.7 );
say $point.x;
say $point;
Generates this
This code:
class Point {
has $.x is rw;
has $.y is rw;
method get_string () {
return $.x, $.y;
}
}
my Point $point .= new( :x1.2, :y-3.7 );
say $point.x;
say $point;
Generates this output:
1.2
get_string() not implemented in class 'Point'
Ovid wrote:
This code:
class Point {
has $.x is rw;
has $.y is rw;
method get_string () {
The correct way to define user-defined stringfication is either through
method Str { ... }
or
method prefix:~ ($self: ) { ... }
(afaict both are not implemented in Rakudo
On Thu, Oct 30, 2008 at 12:46 PM, Moritz Lenz
[EMAIL PROTECTED] wrote:
The correct way to define user-defined stringfication is either through
method Str { ... }
or
method prefix:~ ($self: ) { ... }
(afaict both are not implemented in Rakudo yet)
Yeah, I can't even declare a method that
On Thu, Oct 30, 2008 at 05:46:11PM +0100, Moritz Lenz wrote:
I think that every class should have a default stringification. Dunno if
there's a ticket for it yet.
I don't think there's a _spec_ for a default stringification yet.
So we should probably propose that first, and then see about
Patrick R. Michaud wrote:
On Thu, Oct 30, 2008 at 05:46:11PM +0100, Moritz Lenz wrote:
I think that every class should have a default stringification. Dunno if
there's a ticket for it yet.
I don't think there's a _spec_ for a default stringification yet.
So we should probably propose