[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: Lisp comprehensions => SQL

Victor 'Zverok' Shepelev

12/6/2006 8:17:00 AM

From: Ken Bloom [mailto:kbloom@gmail.com]
Sent: Wednesday, December 06, 2006 3:45 AM
>On Wed, 06 Dec 2006 09:31:44 +0900, Logan Capaldo wrote:
>
>> On Wed, Dec 06, 2006 at 07:27:31AM +0900, Victor Zverok Shepelev wrote:
>>> From: Logan Capaldo [mailto:logancapaldo@gmail.com]
>> There's a problem:
>>> (articles+authors).select{|article, author|
>> articles+authors perfectly doable. Same with select
>>> article.author_id == author.id &&
>> article.authod_id == author.id # doable with appropiate def's of
>> author_id, #==, id, etc.
>
>> What's _NOT_ doable is &&. You can't override
>> that. You have to use another operator or something like any do ... end
>
>That's not so much of a problem, as one can simply use & (which is
>implemented to be a non-short-circuit version of && on booleans anyway, so
>it's not all that out of place)
>
>A much bigger problem is !, not and !=.

Hmm, really. Still my C++-ish habits for "all operators are overloadable" :(

V.