Paradise Regained

2010-10-31 Thread Henry Baragar
cified using rewrite rules in the Stratego language. This sounds very much like what has been envisioned for Perl 6. I wonder if the Perl6 team can leverage (in the future) the work done for Spoofax? Regards, Henry -- Henry Baragar Instantiated Software

Re: Rukudo-Star => Rakudo-lite?

2009-08-09 Thread Henry Baragar
its > > a sub-set of of Perl6. > > > > -lite seems [to me] to be used to define a functional, but stripped > > down version of a larger spec. > > > > Richard (finanalyst) -- Henry Baragar Instantiated Software

Re: Amazing Perl 6

2009-05-27 Thread Henry Baragar
Henry > > 1. create a list of integers from 1 to that value (1..$^n) > 2. multiply them all together ([*]) > > and of course a sub without an explicit return statement returns the > value of the last expression. > > >> I do think captures are inherently impressive, but not easy to > >> explain... > > > > Got a link? > > > > Daniel. -- Henry Baragar Instantiated Software 416-907-8454 x42

Re: Array variables as formal parameters ???

2009-05-24 Thread Henry Baragar
lars. Instead it must return a > proxy that knows how to trigger the actual methods on the scalar, > avoiding the forwarding behavior of normal method calls. > > ===> Is that right? > Relying on rakudo again: > my $x; say $x.WHAT Failure() > my $x = Scalar.new; say $x.WHAT Could not find non-existent sub Scalar > Regards, Henry > Thanks for your help everyone. I hope to give back just as much, once > I've caught back up. In any case, what I learn I will document for all > who come later. > > --John -- Henry Baragar Instantiated Software 416-907-8454 x42

Re: Array variables as formal parameters ???

2009-05-24 Thread Henry Baragar
On May 23, 2009 11:31:35 pm John M. Dlugosz wrote: > Henry Baragar Henry.Baragar-at-instantiated.ca |Perl 6| wrote: > >>> > sub f2 (@y) {say @y.WHAT; say +...@y}; f2(Nil); > >>> > >>> Array() > >>> 1 > >> > >> Why d

Re: Array variables as formal parameters ???

2009-05-23 Thread Henry Baragar
: > sub f1(@y) {say @y.WHAT}; my $x = 1, 2, 3; f1($x); $x = 5; f1($x) Array() Parameter type check failed; expected something matching Positional() but got something of type Int() for @y in call to f1 in sub f1 (:1) called from Main (:1) > Regards, Henry Regards, Henry > Thanks, > --John -- Henry Baragar Instantiated Software 416-907-8454 x42

Re: Array variables as formal parameters ???

2009-05-23 Thread Henry Baragar
On May 23, 2009 04:10:49 pm John M. Dlugosz wrote: > Henry Baragar Henry.Baragar-at-instantiated.ca |Perl 6| wrote: > > I think that in your "Example 1", that you may be making too making too > > much of a distinction between "$a" and "@a". That is:

Re: Array variables as formal parameters ???

2009-05-23 Thread Henry Baragar
of formal parameters, other than the special > *...@slurp form, that is declared with a sigil other than a $. For example, > > sub f1 ($x, @y, @z) { ... } > > Before I get any farther with this line of thought, I want to know if > I'm missing something important. > > Thanks, > --John -- Henry Baragar Instantiated Software 416-907-8454 x42

Re: [Fwd: Re: junctions and conditionals]

2009-04-01 Thread Henry Baragar
On Wednesday, April 01 2009 07:38 am, Richard Hainsworth wrote: > Right now, yes.  I'm arguing that the way that they're designed to > work doesn't DWIM.  Try a slightly different example: > >     0 <= $x <= 1 # 0 is less than $x is less than 1. >     $x ~~ 0..1 # $x is in the range of 0 to 1. > >

Re: On Sets (Was: Re: On Junctions)

2009-03-28 Thread Henry Baragar
Daniel Ruoso wrote: But even to compare two hands it gets weird... my @a = 1|11, 9, 1|11; my @b = 6,9,6; my $pa = [+] @a; my $pb = [+] @b; if ($pa <= 21 && $pb <= 21) { if ($pa > $pb) { # B0RK3D } } That happens because $pa and $pb are a singular value, and that's how junctions

Re: On Junctions

2009-03-28 Thread Henry Baragar
Patrick R. Michaud wrote: On Fri, Mar 27, 2009 at 05:49:02PM -0400, Henry Baragar wrote: I believe that there are hands where $p = 15|26 which would not beat a hand where $d = 17. I believe that the correct way to calculate the "value of the hand" is: my $p = ([

Re: On Junctions

2009-03-27 Thread Henry Baragar
[+] @p).map{.eigenstates}.grep{$_ < 21}.max; which is exactly how I do it when I am playing Blackjack. Put another way, the value of a blackjack hand is deterministic and "sane", and you must get rid of the "schizophrenic" junctions when calculating the value. Henry ps. I am not sure that I am using valid perl6 syntax. In pseudo-perl5 I would do it as: my $p = max grep {$_ < 21} map {$_.eigenstates} [+] @p; HB Richard (finanalyst) -- Henry Baragar Principal Instantiated Software Inc. 416-907-8454 ext 42

Re: r25541 - docs/Perl6/Spec

2009-02-27 Thread Henry Baragar
I am starting to get overwhelmed by the number of special names and I am wondering why we need to have a flat naming space? For example, wouldn't it be easier to remember (and to introspect) the following? $*SYSTEM.uid $*SYSTEM.euid $*SYSTEM.pid $*SYSTEM.perl $*SYSTEM.env $*