Hi

Thanks for the replies:

: =item rand
:
:  our Num method rand ( Num $x: )
:  our Num term:<rand>
:
: Pseudo random number in range C<< 0 ..^ $x >>.  That is, C<0> is
: theoretically possible, while C<$x> is not.  The C<rand> function
: is 0-ary and always produces a number from C<0..^1>.

Hmm, I'd've thought that meant that 'rand' takes no params and returns
0..^1 but rand( Num $x: ) returns 0 .. ^$x  but

:  In any case, for picking a random integer you probably want to use
something like
: C<(1..6).pick> instead.

There's some missing methods s not yet, I guess:

./perl6 -e 'say (1 .. 6).pick'
Method 'pick' not found for invocant of class 'Range'
current instr.: '_block11' pc 49 (EVAL_13:20)
called from Sub 'parrot;PCT::HLLCompiler;eval' pc 806
(src/PCT/HLLCompiler.pir:481)
called from Sub 'parrot;PCT::HLLCompiler;command_line' pc 1305
(src/PCT/HLLCompiler.pir:708)
called from Sub 'parrot;Perl6::Compiler;main' pc 12318 (perl6.pir:174)

No 'pick'  for Junction or any yet
 ./perl6 -e 'my $i = one(1 .. 6).any + 0; say $i'
Method 'any' not found for invocant of class 'Junction'

I tried a number whacks using prefix:
./perl6 -e 'my $i = any(1 .. 6) ; say $i'
./perl6 -e 'my $i = any(1 .. 6) + 0; say $i'
./perl6 -e 'my @arr = (1 .. 6); my $i = any(1..6); say @arr[$i]'

but no get_string or get_integer for Junction makes them a little hard to
use. Not complaining, just a note.

Thanks.

a

-------------------
Andy Bach
Systems Mangler
Internet: [EMAIL PROTECTED]
Voice: (608) 261-5738 Fax: 264-5932

The name "grep" is from the common "ed" (pre-visual "vi") command:
 g/re/p i.e. g(lobal-search)/r(egular) e(xpression)/p(rint)

Reply via email to