Re: Compile-time checking of assignment to read-only variables (Re: MMD distances)

2008-05-09 Thread John M. Dlugosz
Carl Mäsak cmasak-at-gmail.com |Perl 6| wrote: Pm (>): In Rakudo's case, we just haven't implemented read-only traits on variables yet. Goodie. I guessed as much. But yes, I expect that it will be caught as a compile-time error. And do you agree it's reasonable to expect t

Re: Compile-time checking of assignment to read-only variables (Re: MMD distances)

2008-05-09 Thread Patrick R. Michaud
On Fri, May 09, 2008 at 05:09:31PM +0200, Carl Mäsak wrote: > Pm (>): > > In Rakudo's case, we just haven't implemented read-only traits > > on variables yet. > > Goodie. I guessed as much. > > > But yes, I expect that it will be caught as > > a compile-time error. > > And do you agree it's rea

Re: The Inf type

2008-05-09 Thread John M. Dlugosz
TSa Thomas.Sandlass-at-barco.com |Perl 6| wrote: E.g. sqrt(2) might return a special Inf that can be lazily stringified to an arbitrary long sequence of digits of sqrt(2). ??? The sqrt(2) should be a Num of 1.414213562373 with the precision of the native floating-point that runs at full spe

Re: Compile-time checking of assignment to read-only variables (Re: MMD distances)

2008-05-09 Thread Carl Mäsak
Pm (>): > In Rakudo's case, we just haven't implemented read-only traits > on variables yet. Goodie. I guessed as much. > But yes, I expect that it will be caught as > a compile-time error. And do you agree it's reasonable to expect this of every compiler? // Carl

Re: Compile-time checking of assignment to read-only variables (Re: MMD distances)

2008-05-09 Thread Patrick R. Michaud
On Fri, May 09, 2008 at 03:02:28PM +0200, Carl Mäsak wrote: > TSa (>): > > sub bar ($x) > > { > >$x = 3; # error, $x is readonly > >foo($x); # error, could hit rw Str > > } > > By the way, I hope it's possible to make the assignment `$x = 3` to > the read-only variable $x a compile-time

Re: Compile-time checking of assignment to read-only variables (Re: MMD distances)

2008-05-09 Thread TSa
HaloO, Carl Mäsak wrote: By the way, I hope it's possible to make the assignment `$x = 3` to the read-only variable $x a compile-time error. I hope so, too. The variable and its read-only constraint is known at compile time and *not* dependend on the value inside. How it came in there in the f

Re: The Inf type

2008-05-09 Thread TSa
HaloO, I wrote: John M. Dlugosz wrote: > I wrote a complete treatment of Inf support. > Please take a look at "24.26 Infinite" on pages 116-119, and > "3.11.3 Infinities" on pages 26-27. I have a lot to say to that. Please give me time. I find your treatment of Inf too Num centric. E.g. al

Compile-time checking of assignment to read-only variables (Re: MMD distances)

2008-05-09 Thread Carl Mäsak
TSa (>): > sub bar ($x) > { >$x = 3; # error, $x is readonly >foo($x); # error, could hit rw Str > } By the way, I hope it's possible to make the assignment `$x = 3` to the read-only variable $x a compile-time error. In fact, I hope this to such a degree that I would like it to be part

Re: my TypeName $x;

2008-05-09 Thread TSa
HaloO, I wrote: class C does A does B {...} # enters C into WHAT space my $y = C.new; # $y.WHAT =:= C my $b <: B; # automatically re-typing container my $a <: A; # means e.g. my A $a is autotype $b = $y; # now $y.WHAT =:= B $a = $y; # now $y.WHAT =:= (A&B) This last assignm

Re: MMD distances

2008-05-09 Thread TSa
HaloO, John M. Dlugosz wrote: TSa Thomas.Sandlass-at-barco.com |Perl 6| wrote: It's called overload resolution. Perl 6 can't do that at compile time unless *all* targets are available as rw and readonly variants. I don't follow that statement. Can you give an example? multi sub foo (Int $i