[plt-scheme] puzzling bug with (extremely simple) curried, Typed Scheme program

From: Eli Barzilay (eli at barzilay.org)
Date: Mon Oct 20 09:25:44 EDT 2008

On Oct 20, Prabhakar Ragde wrote:
> Benjamin wrote:
> > (define ((good-luck-helper-curried a) b)
> >   (printf "~a, ~a!" a b))
> I had never seen this style of curried definition before, and would
> have bet that it would raise an error [1], but in fact it works fine
> in #lang scheme. I can find justification for it in PLT Reference
> 2.14, but not in R6RS. I'm curious as to its utility -- does it help
> in writing contracts for higher-order functions?

There are some cases where I find it useful, for example, when you
discover that it's more convenient to have a curried definition then
the edit is quick, or when you want to write a function that returns a
handler function.  (Both are not really deep arguments.)

          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                  http://www.barzilay.org/                 Maze is Life!

Posted on the users mailing list.