[plt-scheme] puzzling bug with (extremely simple) curried, Typed Scheme program
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!