Re: How Come This Binary Op Doesn't Work?
- Posted by Pete Lomax <petelomax at blueyonder.co.?k> Jul 13, 2007
- 543 views
c.k.lester wrote: > > }}} <eucode>sequence temp > integer bool > > temp = {} > > bool = atom(temp) and temp = 1</eucode> {{{ > > bool keeps getting set to an empty sequence, not 0. > > What's up with that?!?! {} = <any atom> will always yield {}. <any atom> and {} falls foul of the short circuiting in Eu. Within an if expression it will yield false if the LHS is false, but in an assignment it will always yield {}. This is standard sequence op behaviour. What you probably need to do is:
bool=False if atom(temp) and temp=1 then bool=True end if
One of the many reasons I never liked sequence ops. Regards, Pete