in reply to Re: Re: Re: Re: Re: Useful uses of Quantum::Superpositions?
in thread Useful uses of Quantum::Superpositions?

You mean it'll DWIM? Cool... still not sure it's that useful tho...

feanor_269
  • Comment on Re: Re: Re: Re: Re: Re: Useful uses of Quantum::Superpositions?

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: Re: Re: Useful uses of Quantum::Superpositions?
by diotalevi (Canon) on Apr 09, 2003 at 19:46 UTC

    Sure its useful. Over at id:249381 I had to create a short function indexany() for use in the grep. If @searchCriteria were actually a disjunction then this code doesn't require the new function anymore.

    # Without disjunctions sub indexany { -1 != index $_, $_[0] and return 1 for @_[1 .. $#_]; re +turn 0 } @newArray = grep indexany($_, @searchCriteria), @largeArray # With disjunctions $searchCriteria = any( @searchCriteria); @newArray = grep -1 != index($_, $searchCriteria), @largeArray;
Re: Re: Re: Re: Re: Re: Re: Useful uses of Quantum::Superpositions?
by Mr. Muskrat (Canon) on Apr 09, 2003 at 19:46 UTC

    That depends on what you mean ;-)