> On Sep 16, 2018, at 2:13 PM, Kevin Forchione <[email protected] 
> <mailto:[email protected]>> wrote:
> 
> Thanks! That’s just what I wanted. Is there a way in Racket to determine if a 
> quoted symbol has an associated procedure? 



#lang racket
(require rackunit)

(define-syntax (bound-to-proc? stx)
  (syntax-case stx ()
    [(_ 'x)
     (and (identifier? #'x) (identifier-binding #'x))
     #'(procedure? x)]
    [_ #'#f]))

(define bound-to-proc +)
(define not-bound-to-proc 42)

(check-true (bound-to-proc? 'bound-to-proc))
(check-false (bound-to-proc? 'not-bound-to-proc))

-- 
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 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to