Re: Comparing Sequences

new topic     » goto parent     » topic index » view thread      » older message » newer message

Hello all,

Brian wrote:

>The real purpose of this reply is to get clarification on the following:
>
>On Fri, 6 Oct 2000 20:21:48 CDT, Lewis Townsend wrote:
>
> >Don't change how the operators work, change how the conditional
> >statements work. If conditional statements could handle
> >sequences as boolean values, instead of breaking code it would
> >allow new code to work. For example:
> >
> >if "Hello" = "Help!" then
> >
> >which becomes
> >
> >if {1,1,1,0,0} then
> >
> >which becomes
> >
> >if (1 or 1 or 1 or 0 or 0) then -- notice "or" instead of "and"
> >
> >which becomes
> >
> >if 0 then
>
>While there is a point made to emphasize 'or' instead of 'and', somehow the
>result of (1 or 1 or 1 or 0 or 0) is 0.  Doesn't (1 OR whatever) get 'short
>circuited' to 1?  Did I miss something in the argument or is Lewis
>suggesting we redefine logic?
>
>-- Brian

Sorry folks, my bad. I of course meant "AND" instead of
"OR". I was so focused on getting it right that I got it
wrong! :( Just in case my mistake caused anyone to
completely misunderstand what I was suggesting, here is a
revised and hopefully acurate version:

Conditional statements should accept objects (that's both
atoms and sequences). A TRUE sequence would be defined
as a sequence in which all atoms are TRUE atoms (non zero).
Empty sequences {} or sequences without any atoms at any
level would be TRUE. This is to make the case: {} = {}
return true as it logically should. However I wonder about
1 = {} and similar expressions. Perhaps special code could
be used to anylize these special conditions such as using
compare(). The ONLY FALSE sequence would be a sequence in
which there is a ZERO.
Since a conditional expression can return a sequence why
shouldn't sequences be allowed in conditional expressions?

I hope this clarifies my stand on the issue.

later,
Lewis Townsend.
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at
http://profiles.msn.com.

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu