hi robert!

Robert Klemme [10/10/06 15:10]:
> This has come up frequently in the past.  The short story is that
> there is no way to do exactly that because of performance
> reasons.  All sorts of things have been proposed including a
> method to_b defined in Object as "return self" and which is
> automatically called in every boolean context.
i've read some of these postings, but felt they didn't add much to
what i wanted to achieve.

> You can still use the #to_b pattern explicitly.  This is probably
> the cleanest solution:
yes, it probably is. however, i had kind of hoped that there would
be a nice solution that fit more in my usage example. maybe i just
have to drop that ;-) thanks for your suggestions!

> Frankly, I never felt the need for any of these.  Maybe you
> present your business case and we can propose some other
> solution.
well, actually i don't have the need either. i tried to do it just
for the fun of it - to explore ruby's possibilites and play around a
bit. i mean, as long as it can be achieved in another way there
simply is no need for any more "sophisticated" solution, is it? what
kind of bugged me was that "flag = !flag" part, but obviously i just
have to stick with it...

cheers
jens

-- 
Jens Wille, Dipl.-Bibl. (FH)
prometheus - Das verteilte digitale Bildarchiv f?r Forschung & Lehre
An St. Laurentius 4, 50931 K?ln
Tel.: +49 (0)221 470-6668, E-Mail: jens.wille / uni-koeln.de
http://www.prometheus-bildarchiv.de/