Thanks Matthias for the #%app idea.   This appears to work exactly as I had 
wanted such that a hash in function position works with one arg.   In the rare 
case where my application does not want the default #f, I'll just use 
(hash-ref) in the normal fashions.

(module my-racket racket
  (provide (rename-out [my-app #%app]))
  
  (define-syntax my-app
    (syntax-rules ()
      [(_ f) (f)]
      [(_ f k)
       (let ((F f))
         (if (hash? F)
             (#%app hash-ref F k #f)
             (#%app F k)))]
      [(_ f e ...)
       (#%app f e ...)])))
____________________
  Racket Users list:
  http://lists.racket-lang.org/users

Reply via email to