>>If someone (named Damian :-)
wrote a superposition synopsis that showed the many and varied uses of
superpositions in contexts that ordinary programmers can relate to, it
would bother me less when people make claims about the usefulness of
superpositions.
I'll take one of those for perl.com!
And I'll certainly write one, when/if it's appropriate.

Hint: we may need an Apocalypse N.5 and a corresponding Exegesis N.5
to deal with superpositions, since they don't really fit into the
existing chapter structure of the Camel.

Hmmm, I guess that, since superpositions are both value and operators,
that should be "Exegesis any(2,3)" ;-)


I was very tempted to use a superposition in production code, but realised
a grep of an array did the same job.
Sure. TMTOWTDI. And under the current Q::S implementation, C<grep>
almost certainly did it faster too.

But for simple cases, I suspect that using a built-in Perl 6 superposition:

	if  any(@values) % 2  { print "That's odd...\n" }

is more maintainable (and probably faster) than C<grep>:

	if  grep { $_ % 2} @values  { print "That's odd...\n" }

Damian


Reply via email to