1. Re: [If/then and sequences...]

>
> Agreed Matt. I'll never support a greater_than/less_than
> function. In fact,
> I can't understand the rationale behind compare() and equal()
> either. To me,
> it seems a lot more intuitive just to use the '=', '<', '>'
> symbols with
> sequences. I can't understand Robert's idea that using these
> symbols with
> sequences is a bad thing.
>
> So what's the big deal with ...
>
>  sequence A,B
>
>  if A = B then ....
>
> I know the rules say that '=' only works with atoms, but why have this
> restriction, given that people already use the "work around" called
> compare() ?


Well, the rules don't actally say that '=' only works with atoms, but using
'=' on sequences is effectively doing the '=' operation recursively on each
element of the sequences.  It just won't work in an if-then construct, since
you have to have an atom value to evaluate.

It's actually a very handy thing at times--being able to do ops on lots of
things at once.  If it didn't work that way, I'm sure there would be some
griping (although not as much as there has been over the years about
compare) about why '=' doesn't work similarly to other arithmetic ops on
sequences.

Matt

new topic     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu