Carl West <[EMAIL PROTECTED]> wrote

> In D7.02 'mod' works not only on integers but on lists of integers,
> rects and points
> 
> foo = [1,2,3,4,5,6,7]
> bar = [4,4,4,4,4,4,4]
> put foo mod bar
> - -- [1, 2, 3, 0, 1, 2, 3]

And in D8 too. Nice.

> If someone hits on a use for 'mod'ing rects, I'd be curious to see it.
> 
> but it doesn't work with rgb triads.

So when are we going to see the other math functions mapped onto lists,
the way that the basic binary operators are? I'd love to see < and >, or
sin and cos handled in the same way, but the syntax would need to
specify that the operator should be mapped across the items of the list.

LISP has a feature called mapcar which is VERY cool. You can use it to
call an arbitrary function on *all* the items in a list (individually)
and you get a list of results of all the function calls back. Beautiful.

Good wishlist item.

-- 
_____________

Brennan

[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi  To post messages to the list,
email [EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo.  Thanks!]

Reply via email to