[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

l, the ultimate curry that is not curry



Perhaps the basic problem here is just that "lambda" is cognitively a
single letter, but it requires six letters to spell in english.  If
you write:
  
  (define-syntax l (syntax-rules () ((l . foo) (lambda . foo))))

then you have a compact and powerful notation for "curry"-ing:

  (curry + 2 <>)           <=>    (l (x) (+ 2 x))
  (curry list 1 <> 2 <>)   <=>    (l (x y) (list 1 x 2 y))

If your system does unicode, then replace l with an actual lambda.


For the one-argument case, make l_ an abbreviation for l (_):

  (define-syntax l_ (syntax-rules () ((l_ . foo) (l (_) . foo))))

then you have: 

  (curry + 2 <>)           <=>    (l_ (+ 2 _))
  (curry < 1 <> 2)         <=>    (l_ (< 1 _ 2))

-al

P.S.  I can't decide whether or not these suggestions are supposed to
be taken seriously.