Re: Unary dot

2002-04-16 Thread Allison Randal
On Tue, Apr 16, 2002 at 09:29:21AM -0400, Miko O'Sullivan wrote: Wouldn't Know a Tagmemic if it Bit Him on the Parse Ooh, can I steal that as a title? (Though I'll s/Tagmemic/Tagmeme/.) I like it! :) Allison

Tagmem* (was Unary dot)

2002-04-16 Thread Miko O'Sullivan
Wouldn't Know a Tagmemic if it Bit Him on the Parse Ooh, can I steal that as a title? (Though I'll s/Tagmemic/Tagmeme/.) I like it! :) You got it! I hope this isn't too off topic, but... is the word tagmeme somehow related to the urban legend concept of a cultural meme? -Miko

Re: Unary dot

2002-04-16 Thread Andy Wardley
On Mon, Apr 15, 2002 at 07:24:13PM -0700, Larry Wall wrote: So the main reason that objects can function as hashes is so that the user can poke an object into an interface expecting a hash and have it make sense, to the extent that the object is willing to be viewed like that. AKA the

Hashes, Stringification, Hashing and Strings

2002-04-16 Thread Aaron Sherman
In this example: %hash = ($a=$b); $a can be anything. In fact, since Perl6 promises to retain the original value of $a, we're rather encouraged to store complex data there. But, this poses a problem. The key to use for hashing might not ideally be the string representation. For

Re: Hashes, Stringification, Hashing and Strings

2002-04-16 Thread Larry Wall
Aaron Sherman writes: : In this example: : : %hash = ($a=$b); : : $a can be anything. In fact, since Perl6 promises to retain the original : value of $a, we're rather encouraged to store complex data there. But, : this poses a problem. The key to use for hashing might not ideally be : the

Re: Tagmem* (was Unary dot)

2002-04-16 Thread Larry Wall
Miko O'Sullivan writes: : Wouldn't Know a Tagmemic if it Bit Him on the Parse : : Ooh, can I steal that as a title? (Though I'll s/Tagmemic/Tagmeme/.) I : like it! :) : : You got it! : : I hope this isn't too off topic, but... is the word tagmeme somehow : related to the urban legend

Re: Tagmem* (was Unary dot)

2002-04-16 Thread Juanma Barranquero
On Tue, 16 Apr 2002 09:34:36 -0700 (PDT), Larry Wall [EMAIL PROTECTED] wrote: Pike predates Dawkins, who I believe made up the term. (Could be wrong about that.) They are similar concepts, however, in that a tagmeme is a psychological linguistic construct that propagates culturally. It's

Re: Hashes, Stringification, Hashing and Strings

2002-04-16 Thread Mike Lambert
Speaking of which, how do we ensure the immutability of keys being put into the hash? I think Perl copied the string, so that: $b = aa; $a{$b} = 1; chop $b; print $a{aa}; still works. If we start storing full thingies into the keys of a hash, we either need to make deep copies of these, or

Re: Hashes, Stringification, Hashing and Strings

2002-04-16 Thread Aaron Sherman
On Tue, 2002-04-16 at 14:00, Mike Lambert wrote: Speaking of which, how do we ensure the immutability of keys being put into the hash? I think Perl copied the string, so that: $b = aa; $a{$b} = 1; chop $b; print $a{aa}; still works. If we start storing full thingies into the keys of

Re: Unary dot

2002-04-16 Thread Piers Cawley
Andy Wardley [EMAIL PROTECTED] writes: On Mon, Apr 15, 2002 at 07:24:13PM -0700, Larry Wall wrote: So the main reason that objects can function as hashes is so that the user can poke an object into an interface expecting a hash and have it make sense, to the extent that the object is willing

Scary things

2002-04-16 Thread Piers Cawley
Also known as constructs you wish you hadn't discovered. So, I'm reading through Finkel and I came across the following, which computes the greatest common divisor of a and b (recast into perl6ish syntax) while { when $a $b { $b -= $a } when $b $a { $a -= $b } } The idea is that

Re: Hashes, Stringification, Hashing and Strings

2002-04-16 Thread David Wheeler
On 4/16/02 11:00 AM, Mike Lambert [EMAIL PROTECTED] claimed: Speaking of which, how do we ensure the immutability of keys being put into the hash? I think Perl copied the string, so that: $b = aa; $a{$b} = 1; chop $b; print $a{aa}; still works. If we start storing full thingies

Re: Hashes, Stringification, Hashing and Strings

2002-04-16 Thread David Wheeler
On 4/16/02 11:57 AM, Piers Cawley [EMAIL PROTECTED] claimed: Personally I'd like the default hash to return some immutable, unique and probably opaque object id (something the like 'Foo=HASH(0x81e2a3c)' you get from unoverloaded objects in Perl5, but probably not identical). This isn't going

Re: Scary things

2002-04-16 Thread Larry Wall
Piers Cawley writes: : Also known as constructs you wish you hadn't discovered. : : So, I'm reading through Finkel and I came across the following, which : computes the greatest common divisor of a and b (recast into perl6ish : syntax) : : while { : when $a $b { $b -= $a } : when $b

Re: Hashes, Stringification, Hashing and Strings

2002-04-16 Thread Steve Fink
On Tue, Apr 16, 2002 at 02:00:33PM -0400, Mike Lambert wrote: Speaking of which, how do we ensure the immutability of keys being put into the hash? I think Perl copied the string, so that: RFC266 talks about these issues, though it was just really my take on the problem at the time.

Re: Scary things

2002-04-16 Thread Larry Wall
Buddha Buck writes: : It's weirder when you allow multiple guard conditions to be true with no : guarantee of evaluation order. But I see no reason to disallow it. Well, Perl would guarantee the order. I can see situations where it'd be better to force a random pick to avoid starvation

Re: Hashes, Stringification, Hashing and Strings

2002-04-16 Thread Larry Wall
Piers Cawley writes: : Aaron Sherman [EMAIL PROTECTED] writes: : : On Tue, 2002-04-16 at 14:00, Mike Lambert wrote: : Speaking of which, how do we ensure the immutability of keys being put : into the hash? I think Perl copied the string, so that: : : $b = aa; : $a{$b} = 1; : chop $b; :

Re: Hashes, Stringification, Hashing and Strings

2002-04-16 Thread David Wheeler
On 4/16/02 12:27 PM, Larry Wall [EMAIL PROTECTED] claimed: You guys are thinking in terms of a single $obj.hash method. I think there will be more than one hashish (er...) method available, and each hash will be able to choose at least whether it wants to hash by $obj._ (the default), by

Re: Unary dot

2002-04-16 Thread Larry Wall
Piers Cawley writes: : Andy Wardley [EMAIL PROTECTED] writes: : Hang on, now I'm a little confused - I thought that hashes were supposed : to keep their % sigil. So shouldn't that be %foo.keys or %foo.{keys}? : But then that would then violate the uniform access principle because : hash/key

Re: Hashes, Stringification, Hashing and Strings

2002-04-16 Thread Piers Cawley
David Wheeler [EMAIL PROTECTED] writes: On 4/16/02 11:57 AM, Piers Cawley [EMAIL PROTECTED] claimed: Personally I'd like the default hash to return some immutable, unique and probably opaque object id (something the like 'Foo=HASH(0x81e2a3c)' you get from unoverloaded objects in Perl5, but

Re: Hashes, Stringification, Hashing and Strings

2002-04-16 Thread Aaron Sherman
On Tue, 2002-04-16 at 14:57, Piers Cawley wrote: Aaron Sherman [EMAIL PROTECTED] writes: I suspect it would involve: 1. Copying the key (which might be a reference) on insertion. 2. Hashing once, and caching the hash. This means a minimum of overhead, so it's a good thing. It also

Re: Tagmem* (was Unary dot)

2002-04-16 Thread Damian Conway
Juanma Barranquero wrote: On _THE SELFISH GENE_ Dawkins says he coined the term, which was a more euphonic version of mimeme: On quickly scanning that message I read the last word as mini-me, which brought up some *very* unlikely associations! :-) Damian -- So, Mr. Evil... It's Dr. Evil, I

Cfor loop variations

2002-04-16 Thread David Wheeler
In Exegesis 4, Damian writes: blockquote It's important to note that writing: for @a; @b - $x; $y {...} # in parallel, iterate @a one-at-a-time as $x, and @b one-at-a-time as $y is not the same as writing: for @a, @b - $x, $y {...} # sequentially iterate @a then @b,

Re: Cfor loop variations

2002-04-16 Thread Luke Palmer
Now, I love that the for loop can do both of these things, but the subtlety of the difference in syntax is likely, IMO, to lead to very difficult- to-find bugs. It's very easy to miss that I've used a comma when I meant to use a semicolon, and vice versa. And what's the mnemonic again? Well,

[RELEASE] Parrot 0.0.5 is out of its cage.

2002-04-16 Thread Jeff
It was the dawning of the second age of parrotkind, ten weeks after the great GC war. The Parrot Project was a dream given form. Its goal: To prevent language wars by creating an interpreter where perl and other languages could reside peacefully... It can be a dangerous place, but it's our last