Following up to a thread on p6c regarding method fallbacks and .join:
* What should [1,3,5].join('-') produce?
* How about ([1,3,5], 20).join('-') ?
Thanks!
Pm
Patrick R. Michaud wrote:
Following up to a thread on p6c regarding method fallbacks and .join:
* What should [1,3,5].join('-') produce?
I'm pretty sure it should be '1-3-5', because [1,3,5] is an Array ref
* How about ([1,3,5], 20).join('-') ?
Probably the same as (~[1,3,5],
Another question:
Vasily Chekalkin (via RT) wrote:
+.sub 'sqrt' :multi(Complex)
+.param pmc a
+a = sqrt a
+.return (a)
+.end
Do we actually want a sqrt(Complex)? Somebody who is sufficiently
mathematically educated to work with complex numbers should now that
sqrt() is ambigous,
In the test suite there are some tests like this:
is(1.WHAT, 'Int', '1 as a literal is an Int);
This seems to imply that we guarantee the direct type of literals. But
do we?
Actually I see no need for that. All my programs work fine if the
literal 1 is of type Foo, and Foo isa Int.
What's our
(cross-posting to p6l)
Ryan Richter wrote:
On Thu, Jun 26, 2008 at 11:36:05AM +0200, Moritz Lenz wrote:
2) How do we know which numeric type is a class and which is a role? Is
there an explicit spec about the types of number literals? That could
have some impact on type checking in the
On Thu, Jun 26, 2008 at 10:23 AM, Moritz Lenz
[EMAIL PROTECTED] wrote:
Thanks for the effort, but it also raises new questions. For example:
Int is Num
Rakudo doesn't do it that way, because the 'A is B' relation in OO means
Every instance of A is also an Instance of B, which certainly isn't
Mark J. Reed wrote:
On Thu, Jun 26, 2008 at 10:23 AM, Moritz Lenz
[EMAIL PROTECTED] wrote:
Thanks for the effort, but it also raises new questions. For example:
Int is Num
Rakudo doesn't do it that way, because the 'A is B' relation in OO means
Every instance of A is also an Instance of B,
In a message dated Thu, 26 Jun 2008, Moritz Lenz writes:
I assume that 'Num' is meant to be a non-complex.
Then it seems to make sense to assume:
Int is Rat
Rat is Num
Num is Complex
or am I off again?
S29 seems to have been assuming this, if I'm reading the multis correctly.
--
Trey Harris
Trey Harris wrote:
In a message dated Thu, 26 Jun 2008, Moritz Lenz writes:
I assume that 'Num' is meant to be a non-complex.
Then it seems to make sense to assume:
Int is Rat
Rat is Num
Num is Complex
or am I off again?
S29 seems to have been assuming this, if I'm reading the multis
On Thu, Jun 26, 2008 at 10:40:53AM -0400, Trey Harris wrote:
In a message dated Thu, 26 Jun 2008, Moritz Lenz writes:
I assume that 'Num' is meant to be a non-complex.
Then it seems to make sense to assume:
Int is Rat
Rat is Num
Num is Complex
or am I off again?
S29 seems to have been
On Thu, Jun 26, 2008 at 12:45:39PM -0400, Mark J. Reed wrote:
: Moritz Lenz 3.14 would be a Rat or a Float or whatever
:
: That's a good question, actually. Does the literal 3.14 get turned
: into a Float or a Rat? Float is probably simplest, and matches what
: e.g. Lisp does, but you could
On Thu, Jun 26, 2008 at 09:55:09AM -0700, Larry Wall wrote:
We could go as far as to guarantee that Nums do rational arithmetic
out to a certain point, but probably what the financial insitutions
want is special fixed-point types that assume a divisor anyway.
Would any financial institution
On Thu, Jun 26, 2008 at 04:03:42PM +0200, Moritz Lenz wrote:
: In the test suite there are some tests like this:
: is(1.WHAT, 'Int', '1 as a literal is an Int);
:
: This seems to imply that we guarantee the direct type of literals. But
: do we?
:
: Actually I see no need for that. All my
Most financial institutions don't use float, rational or fixed point, they just
keep integer pennies.
--
Mark Biggar
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
-- Original message --
From: Larry Wall [EMAIL PROTECTED]
Would any financial institution
On Thu, Jun 26, 2008 at 09:46:25AM -0700, Larry Wall wrote:
: the VM somehow sneaks in the appropriate conversion for us if we
: actually try to pass an Int to a Rat.
I'd point out that this is fundamentally the same decision point that
is reached when we want to do boxing, because we basically
RR == Ryan Richter [EMAIL PROTECTED] writes:
RR On Thu, Jun 26, 2008 at 09:55:09AM -0700, Larry Wall wrote:
We could go as far as to guarantee that Nums do rational arithmetic
out to a certain point, but probably what the financial insitutions
want is special fixed-point types that
Qui, 2008-06-26 às 16:03 +0200, Moritz Lenz escreveu:
In the test suite there are some tests like this:
is(1.WHAT, 'Int', '1 as a literal is an Int);
This seems to imply that we guarantee the direct type of literals. But
do we?
Actually I see no need for that. All my programs work fine if the
17 matches
Mail list logo