Re: Rakudo test miscellanea by Larry Wall- June 26, 2008 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&39;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 argue either way. Especially since many: exact decimal literals become approximations in binary...The internal representation of Num is opaque, and Num is allowed tokeep some subset of its...http://www.nntp.perl.org/group/perl.perl6.language/2008/06/msg29319.html Re: Rakudo test miscellanea by Larry Wall- June 26, 2008 On Thu, Jun 26, 2008 at 04:50:21PM +0200, Moritz Lenz wrote:: I assume that &39;Num&39; 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 againWell, there&39;s this little thing called Liskov substitutability...Neither "is" nor "does" is quite right here, because the mathematicianshave seen fit to confuse representation semantics with value semantics. :)I think what we want is something more like ...http://www.nntp.perl.org/group/perl.perl6.language/2008/06/msg29318.html Re: Rakudo test miscellanea by Mark J. Reed- June 26, 2008 Moritz Lenz> 3.14 would be a Rat or a Float or whateverThat&39;s a good question, actually. Does the literal "3.14" get turnedinto a Float or a Rat Float is probably simplest, and matches whate.g. Lisp does, but you could argue either way. Especially since manyexact decimal literals become approximations in binary...-- Mark J. Reed <markjreedgmail.com>http://www.nntp.perl.org/group/perl.perl6.language/2008/06/msg29317.html Re: Rakudo test miscellanea by Ryan Richter- June 26, 2008 On Thu, Jun 26, 2008 at 04:50:21PM +0200, Moritz Lenz wrote:> What&39;s the alternative> I don&39;t think it&39;s a good idea to special-case numeric types, and I> don&39;t think it&39;s a good idea to define multis for each numeric type either.> > I assume that &39;Num&39; 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 againYeah, that looks sane. I should probably put Int under Rat in...http://www.nntp.perl.org/group/perl.perl6.language/2008/06/msg29316.html Re: Rakudo test miscellanea by Patrick R. Michaud- June 26, 2008 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 &39;Num&39; 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&39;m reading the multis correctly.Keep in mind that some of S29&39;s assumptions regarding types may no longer be true,...http://www.nntp.perl.org/group/perl.perl6.language/2008/06/msg29315.html Re: Rakudo test miscellanea by Moritz Lenz- June 26, 2008 Trey Harris wrote:> In a message dated Thu, 26 Jun 2008, Moritz Lenz writes:>> I assume that &39;Num&39; 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&39;m reading the multis correctly.If it assumed that, why would exp() be defined in class Num, instead ofthe more general class ComplexIt would also imply that the...http://www.nntp.perl.org/group/perl.perl6.language/2008/06/msg29314.html Re: Rakudo test miscellanea by Trey Harris- June 26, 2008 In a message dated Thu, 26 Jun 2008, Moritz Lenz writes:> I assume that &39;Num&39; 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 againS29 seems to have been assuming this, if I&39;m reading the multis correctly.-- Trey Harris http:www.lopsa.orgPresident, LOPSA -- The League of Professional System AdministratorsOpinions expressed above are not necessarily.http://www.nntp.perl.org/group/perl.perl6.language/2008/06/msg29313.html Re: Rakudo test miscellanea by Moritz Lenz- June 26, 2008 Mark J. Reed wrote:> On Thu, Jun 26, 2008 at 10:23 AM, Moritz Lenz> <moritzcasella.verplant.org> wrote:>> Thanks for the effort, but it also raises new questions. For example:>>> Int is Num>> Rakudo doesn&39;t do it that way, because the &39;A is B&39; relation in OO means>> "Every instance of A is also an Instance of B", which certainly isn&39;t>> the case with Ints. Int is more like a subset of Num.> > Huh If Int is a subset of...http://www.nntp.perl.org/group/perl.perl6.language/2008/06/msg29312.html Re: Rakudo test miscellanea by Mark J. Reed- June 26, 2008 On Thu, Jun 26, 2008 at 10:23 AM, Moritz Lenz<moritzcasella.verplant.org> wrote:> Thanks for the effort, but it also raises new questions. For example:>> Int is Num> Rakudo doesn&39;t do it that way, because the &39;A is B&39; relation in OO means> "Every instance of A is also an Instance of B", which certainly isn&39;t> the case with Ints. Int is more like a subset of Num.Huh If Int is a subset of Num, then every instance of Int is alsoan instance of Num. ...http://www.nntp.perl.org/group/perl.perl6.language/2008/06/msg29311.html Re: Rakudo test miscellanea by Moritz Lenz- June 26, 2008 (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 tests. (Maybe I should prod p6l>> with that).> > You can&39;t instantiate a role so they&39;re pretty much all classes I think.> The only role that I saw specced was...http://www.nntp.perl.org/group/perl.perl6.language/2008/06/msg29310.html |