Okay, I'd like to set myself straight. Sanity check:
bar($foo, $baz); # looks for subs (lexical then package), and
falls back to MMD
$foo.bar($baz);# looks in ref($foo), then falls back to MMD
If this is correct, can we simplify the latter to mean "MMD only" ?
Would there be a mor
Mark Reed wrote:
I would really like to see ($x div $y) be (floor($x/$y))
That is: floor( 8 / (-3) ) == floor( -2. ) == -3
Or do you want -2?
and ($x mod $y) be ($x - $x div $y).
Hmm, since 8 - (-3) == 11 this definition hardly works.
But even with $q = floor( $x / $y ) and $r = $x
"TSa (Thomas Sandlaß)" skribis 2005-05-30 8:58 (+0200):
> [This is a repost, somehow it didn't get through before, sorry.]
This is the fourth time it did get through to my mailbox, at least.
Juerd
--
http://convolution.nl/maak_juerd_blij.html
http://convolution.nl/make_juerd_happy.html
http:/
We already have the Set class, how do we say what it contains?
class Set {
has $.type;
submethod BUILD {
# get something into $.type, using 'of' handler
}
method members returns $.type () { ... }
}
my Set of Int $s = Set.new; # is this how you cal
I have a class that normally takes a list of named arguments.
I also want to be able to handle a single argument.
class Foo {
multi method new (Class $class: Str $date) {
return $class.bless(date => $date);
}
submethod BUILD ($.date, $.time, $.offset) {
# some error checking here
Yuval Kogman wrote:
my Set of Int $s = Set.new; # is this how you call it?
This whole thing depends on how hard-wired the first level
container implementation is. There is either a loose or
very strict mapping from sigils to container types:
$ --> Scalar/Item
@ --> Array
% --> Hash
& -
Debugging is a hard task, because either too much is hidden (this is
when we want to invoke the debugger), or too much is visible (this
is when we give up on tracing the problem through the debugger, and
resort to print Data::Dumper::Dumper($thing) every few lines of
code).
Given the complexity of
On Mon, May 30, 2005 at 18:51:19 +0200, "TSa (Thomas Sandla)" wrote:
> class Set does Array {...}
I don't like this... A set is just a simple example... What if I
want something sillier?
My question is really:
"How do I make sub foo returns $computable"
And how do I make this friendly
Yuval Kogman wrote:
> We already have the Set class, how do we say what it contains?
> class Set {
>has $.type;
>method members returns $.type () { ... }
> }
> my Set of Int $s = Set.new; # is this how you call it?
You are describing "Higher Order" types, also called Generic Algebraic Dat