Not quite what I had in mind. The following examples must all work without 

#lang racket

;; set/define defined here

(set/define h a 1)
(set/define h a 2)
(hash-set! h 'b 42)

(define bar (make-hash))
(set/define bar a 1)

(define (foo)
  (set/define local-h a 1)
  (set/define local-h a 2)
  (hash-set! local-h 'b 42)


Basically, if the identifier h is unbound at runtime
  (set/define h key val)
is the same as
 (define h (make-hash))
 (hash-set! h 'key val)

If h is bound
 (hash-set! h 'key val)

You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
For more options, visit

Reply via email to