Re: question regarding rules and bytes vs characters

2004-07-12 Thread Austin Hastings
--- Larry Wall <[EMAIL PROTECTED]> wrote: > > Hmm, maybe that means that language-dependent graphemes are called > "langs", which I suppose is short for "langemes". Dangerously close to "legumes", there. Perhaps we could refer to entities matches by regexes as "peas"... =Austin

Re: push with lazy lists

2004-07-12 Thread Larry Wall
On Mon, Jul 12, 2004 at 11:11:58AM -0700, Austin Hastings wrote: : --- Larry Wall <[EMAIL PROTECTED]> wrote: : > The hard part being to pick a random number in [0,Inf) uniformly. :-) : : Half of all numbers in [0, Inf) are in the range [Inf/2, Inf). Which : collapses to the range [Inf, Inf). Retur

Re: question regarding rules and bytes vs characters

2004-07-12 Thread Larry Wall
On Mon, Jul 12, 2004 at 07:42:02AM +0200, Ph. Marek wrote: : Of course the file must be opened in binary mode - else the line-endings etc. : can be destroyed in the binary data, which is bad. : : So Perl/Parrot can't autodetect the kind of encoding. : But maybe it should be possible to do somethi

Re: push with lazy lists

2004-07-12 Thread Austin Hastings
--- Larry Wall <[EMAIL PROTECTED]> wrote: > On Mon, Jul 12, 2004 at 10:12:03AM -0700, Austin Hastings wrote: > : --- Dave Whipp <[EMAIL PROTECTED]> wrote: > : > : > rand(@x) == @x.rand == @x[ rand int @x ] == @x[ rand(1) * @x ] > : > > : > guaranteeing a uniform distribution unless adverbial mo

Re: push with lazy lists

2004-07-12 Thread Larry Wall
On Mon, Jul 12, 2004 at 10:12:03AM -0700, Austin Hastings wrote: : --- Dave Whipp <[EMAIL PROTECTED]> wrote: : : > rand(@x) == @x.rand == @x[ rand int @x ] == @x[ rand(1) * @x ] : > : > guaranteeing a uniform distribution unless adverbial modifiers are : > used. The hard part being to pick a r

Re: push with lazy lists

2004-07-12 Thread Austin Hastings
--- Dave Whipp <[EMAIL PROTECTED]> wrote: > rand(@x) == @x.rand == @x[ rand int @x ] == @x[ rand(1) * @x ] > > guaranteeing a uniform distribution unless adverbial modifiers are > used. Meaning I can do: $avg_joe = rand @students :bell_curve; ? =Austin

Re: The .bytes/.codepoints/.graphemes methods

2004-07-12 Thread Jonadab the Unsightly One
Luke Palmer <[EMAIL PROTECTED]> writes: > Or, god forbid, a word? > > m:base/que mas/ > > We're not mathematicians: we're allowed to use more than one letter > in a row to designate something :-) Well, if it were *me*, *I* would have voted for keeping the core language 100% pure ASCII, untain

Re: push with lazy lists

2004-07-12 Thread Dave Whipp
"Ph. Marek" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Thursday 08 July 2004 05:25, Larry Wall wrote: > > : say @x[rand]; # how about now? > > > > Well, that's always going to ask for @x[0], which isn't a problem. > > However, if you say rand(@x), it has to calculate the numb

Re: if not C<,> then what?

2004-07-12 Thread Jonadab the Unsightly One
Dan Hursh <[EMAIL PROTECTED]> writes: > Ouch. I hadn't thought of that. I'm a big fan of litering loops with > > discard(),next if dontCareBecause(); # it don't matter here I like the idea here, but I don't think we need the comma... > type constructs. I was going to suggest > >

Re: scalar subscripting

2004-07-12 Thread Austin Hastings
--- Juerd <[EMAIL PROTECTED]> wrote: > Piers Cawley skribis 2004-07-12 12:20 (+0100): > > method postcircumfix:[] is rw { ... } > > Compared to Ruby, this is very verbose. > > def [] (key) > ... > end > > # Okay, not entirely fair, as the Ruby version would also > # nee

This week's summary

2004-07-12 Thread The Perl 6 Summarizer
The Perl 6 Summary for the week ending 2004-07-10 Another week down, another summer summary. On a Monday no less. Last week I even managed to get the summary to the mailing lists before the Perl 5 Porters summary. I may have been even more surprised that Rafael by that. Let's see if

Re: scalar subscripting

2004-07-12 Thread Juerd
Simon Cozens skribis 2004-07-12 12:58 (+0100): > [EMAIL PROTECTED] (Juerd) writes: > > Could methods like "[]" and "{}" *default* to "postcircumfix:"? > A more interesting question is "does it mean anything for them *not* to be > postcircumfix"? Not as a method, I think. > After all, the only oth

Re: scalar subscripting

2004-07-12 Thread Simon Cozens
[EMAIL PROTECTED] (Juerd) writes: > Could methods like "[]" and "{}" *default* to "postcircumfix:"? A more interesting question is "does it mean anything for them *not* to be postcircumfix"? After all, the only other use would be "$foo.[]($bar, $baz)", which is practically identical. Unless you w

Re: scalar subscripting

2004-07-12 Thread Juerd
Piers Cawley skribis 2004-07-12 12:20 (+0100): > method postcircumfix:[] is rw { ... } Compared to Ruby, this is very verbose. def [] (key) ... end # Okay, not entirely fair, as the Ruby version would also # need []= defined for the rw part. Could methods like "[]" and

Re: scalar subscripting

2004-07-12 Thread Piers Cawley
Luke Palmer <[EMAIL PROTECTED]> writes: > Gautam Gopalakrishnan writes: >> Hello, >> >> I've tried the archives and the 'Perl 6 essentials' book and I can't >> find anything >> about string subscripting. Since $a[0] cannot be mistaken for array subscripting >> anymore, could this now be used to p

[Fwd: Newsletter from O'Reilly UG Program, July 9]]

2004-07-12 Thread Leopold Toetsch
[snipped except for essentials :) ] Book News New Releases ***Perl 6 an

Re: push with lazy lists

2004-07-12 Thread Brent 'Dax' Royal-Gordon
Ph. Marek wrote: On Thursday 08 July 2004 05:25, Larry Wall wrote: : say @x[rand]; # how about now? Well, that's always going to ask for @x[0], which isn't a problem. However, if you say rand(@x), it has to calculate the number of elements in @x, which could take a little while... I'd expect to be

Re: push with lazy lists

2004-07-12 Thread Ph. Marek
On Thursday 08 July 2004 05:25, Larry Wall wrote: > : say @x[rand]; # how about now? > > Well, that's always going to ask for @x[0], which isn't a problem. > However, if you say rand(@x), it has to calculate the number of > elements in @x, which could take a little while... I'd expect to be rand(@

Re: "=>" brother

2004-07-12 Thread Matt Diephouse
Alexey Trofimenko wrote: I wonder about mixed synax: %hash = ( :keyÂvalue :key2Âvalue :key3 key4 => 'value', 'key5','value', Âkey6 value key7 value ) Did I make mistakes here? That depends. I asked Damian about this a few weeks ago. He said