RE: two-way hashes

2001-08-02 Thread Hong Zhang


>I tought about a posibility to access a HASH in way that the VALUES can
also
>be used like KEYS...i.e in perl6 I will say this :
>
>%hash{key} = value;
>
>I want to say also :
>
>{value}hash% = key;

Please forget about it. It is just syntactic sugar for yourself. The hash
mapping 
is m-to-1, there are (possible) multiple keys for the same value.

Just use two hashes for this purpose. If you can write a class that help
keeping 
track of the two hashes, that will be more useful than inventing weird
syntax.

Hong



Re: properties, revisited

2001-08-02 Thread Dan Sugalski

At 07:28 PM 8/2/2001 -0700, Edward Peschko wrote:
> > Now that you've got me thinking about it, that brings up some interesting
> > questions.
> >
> > $bar = $foo is my_prop = 0 is some_prop;
> > ($bar = $foo is my_prop) = 0 is some_prop;
> > $bar = ($foo is my_prop) = 0 is some_prop;
>
>This is why I think that variable properties and value properties should 
>be the same thing - value properties.

They can't be, though--conceptually they are different things. Variables 
are const or not, while values aren't, for example. Doesn't mean that 
there'll be that many different variable properties, since I don't think 
there are all that many that are appropriate. (Type and max size, perhaps, 
along with a few others)

The syntax for variable and value properties are going to be different, I 
think, I just can't remember what it's going to be. (I think the colon's 
involved, but isn't it always?)



Dan

--"it's like this"---
Dan Sugalski  even samurai
[EMAIL PROTECTED] have teddy bears and even
  teddy bears get drunk