in reply to Re: Tied and Entangled, Quantum fun.
in thread Tied and Entangled, Quantum fun.

What are you buying with Quantum:: that I don't get with my plain $distribution-> rand @$distribution ? Outside of having a really bloated module?

Nothing, really. But does your version provide any other distributions than uniform? At first glance, it seems to me that your solution lacks the possibility to provide the frequency of the different elements. That can be worked around using the following (untested) code, though.

My version:

tie my $variable, "Quaint", ( 1 => "one", 2 => "two", 1 => "three" );

Your version:

tie my $variable, "Quaint",( "one", "two", "two", "three" );

I happen to prefer the first notation, but that is merely a matter of taste. On the other hand, I think you loose the possibility to specify frequencies using complex number. I may be wrong on this one though, so I agree that the only thing I loose with your version is Quantum::Cool.

Come to think of it, I can't use complex numbers to specify frequencies right now. Thank you for pointing it out for me :o)

pernod
--
Mischief. Mayhem. Soap.