[racket-dev] define-wish and a call for assistance

From: Kathryn Gray (kathryn.gray at cl.cam.ac.uk)
Date: Mon Feb 21 08:38:58 EST 2011

On 21 Feb 2011, at 1:33:46, Stephen Bloch wrote:

> On Feb 21, 2011, at 8:04 AM, Kathryn Gray <kathryn.gray at cl.cam.ac.uk> wrote:
> 
>> I've added a preliminary version of define-wish to the teaching languages and the test-engine but it doesn't presently do everything that was discussed/requested in the original conversation. And I don't know how to extend it to support those features.
>> 
>> So can someone with more experience in developing functions for the teaching languages assist?
>> 
>> (define-wish n) presently provides the programmer with a function, n, of arity one (that raises an exception about wishes when called). I would like this function to be of variable arity, but I have not determined how to do this.
> 
> Yes: ideally one would write
> (define-wish (f x y z))
> and it would define a 3-parameter function named f, whose arity would be enforced by Check Syntax and which would raise an appropriate exception when called.

The options at present (and after discussion with Matthias) are for

(define-wish name)

and

(define-wish name default-value)

So that the wish definitions are lightweight. The arity concern goes away completely with (define-wish (name parameter1 parameter2...))

-Kathy

> 
>> 
>> I would also like the test-engine to be able to report every wished for function, whether or not it's called.
> 
> Good point.
> 
> One of these days I've GOT to sit down and learn to write macros....
> 
> 
> 
> Stephen Bloch
> sbloch at adelphi.edu



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/dev/archive/attachments/20110221/916df278/attachment.html>

Posted on the dev mailing list.