Eduardo Cavazos wrote:

What would be *really* cool is if it curried according to the sorted order of the letters.

OK, here's the latest revision of the (enhanced) curry macro:

    http://github.com/dharmatech/agave/raw/master/misc/curry.sls

One of the first places I wanted to use it was with these simple arithmetic procedures that I often use with higher order procedures like 'map' and 'filter':

 (define add           (curry + a b))

 (define multiply-by   (curry * a b))

 (define subtract-from (curry - a b))

 (define subtract      (curry - b a))

 (define divide        (curry / a b))

 (define divide-by     (curry / b a))

 (define greater-than  (curry >  b a))
 (define greater-than= (curry >= b a))

 (define less-than     (curry <  b a))
 (define less-than=    (curry <= b a))

E.g.

  (filter (greater-than 4) ...)

  (map (multiply-by 10) ...)

Those reside at:

    http://github.com/dharmatech/agave/raw/master/math/basic.sls

Ed

Reply via email to