racket / htdp

Other
91 stars 69 forks source link

[Enhancement] - support `...` in parameter lists as well as function bodies #182

Closed jasonhemann closed 1 year ago

jasonhemann commented 1 year ago

Re-using ... notation to support function templates is a great idea and I love the error messages.

(define (f-on-atom an-atom)
  (... an-atom ...))

In my context, I also use ... in the parameter list of my templates, to signal that the parameter list is also templated, by analogy to the ...s in the function body. It's a slight variation on the HtDP/2e textbook style.

(define (f-on-atom ... an-atom)
  (... an-atom ...))

However, this gives me a compile-time error message, and a pretty unfriendly one to boot.

define: expected a variable, but found a keyword.

It would be nice if my templating style were supported out of the box, and only errored if you try to call that incomplete function. Still an improvement would be a more beginner-friendly error message here.

mfelleisen commented 1 year ago

4pm should work just fine tomorrow.

jasonhemann commented 1 year ago

Closing as "Won't fix"