Re: [racket-users] Storing functions in a hash

2015-05-20 Thread Norman Gray
j b, hello. Depending on what this is a cut-down version of, I think you may have slightly over-engineered it. > On 2015 May 20, at 13:41, j b wrote: > > ; function definition helper > (define-syntax-rule (define-hash-function f p ...) > (define (f) (lambda () p ...))) This defines f to be

Re: [racket-users] Storing functions in a hash

2015-05-20 Thread Matthias Felleisen
Yes, this is over-engineered. What do you not like about (define h1 (hash 'foo (lambda () (random 100)) 'bar (lambda () (random 500 (displayln h1) (displayln ((hash-ref h1 'foo))) (displayln ((hash-ref h1 'foo))) (displayln ((hash-ref h1 'bar))) (displayln ((hash-ref h1 'bar))) Onc