On 24 Feb 2004, David Garamond wrote:

> (reposted via c.l.r from another email account; post to mailing list
> doesn't seem to get through)
> 
> What do people think of adding String#&, String#|, String#^, and
> String#~? I find it useful sometimes in Perl. In Ruby currently I have
> to convert each byte to integer first, rather slow (actually slow as
> mollasses... :-)
> 
> There are BitSet and BitVector modules (and another one which I forgot
> for doing bit operations) but ironically none of them currently
> provide an easy way to xor two strings together.

this is a great idea.  it might also be useful to have

  String.and! other
  String.or! other
  String.xor! other
  String.not!

which did not create copies.

-a

-- 
===============================================================================
| EMAIL   :: Ara [dot] T [dot] Howard [at] noaa [dot] gov
| PHONE   :: 303.497.6469
| ADDRESS :: E/GC2 325 Broadway, Boulder, CO 80305-3328
| URL     :: http://www.ngdc.noaa.gov/stp/
| TRY     :: for l in ruby perl;do $l -e "print \"\x3a\x2d\x29\x0a\"";done 
===============================================================================