Re: To David, Ralf (3), Lewis, Joe (2),
- Posted by Robert B Pilkington <bpilkington at JUNO.COM> Jun 24, 1998
- 613 views
>> This is why I want a ?: operator. Unfortunately ?x is already >> used for print(1,x)puts(1,'\n') so we need another operator e.g. ~: >> >> ? sequence(a) ~ length(a) : 1 > >Ahhhhhhhhhhhhhhhhh!!!!! >You do love mysteries don't ya ?!! >Cuz, that is precizely what the above is, a walking mystery. Well, let's see, I think that means: atom x if sequence(a) then x = length(a) else x = 1 end if ? x So that means we can have a function! :) global function tildewasquestionmark(atom boolean, object o1, object o2) -- If boolean is true then return o1, otherwise return o2, and -- it's only 4 or 5 statements! :) (Dunno if 'else' is counted.) if boolean then return o1 else return o2 end if end function ? tildewasquestionmark(sequence(a), length(a), 1) (You may want to change the function name to something a little more understandable... :) Although the current method is probably more understandable than what it was.. ;) _____________________________________________________________________ You don't need to buy Internet access to use free Internet e-mail. Get completely free e-mail from Juno at http://www.juno.com Or call Juno at (800) 654-JUNO [654-5866]