diff --git a/core/Dynamic.carp b/core/Dynamic.carp index ccce54fe..b9dee77e 100644 --- a/core/Dynamic.carp +++ b/core/Dynamic.carp @@ -2,6 +2,12 @@ (defmodule Dynamic ;; Functions for doing things at the REPL and during compile time. + (doc proc? "checks whether `x` is callable.") + (defndynamic proc? [x] + (or + (List.in? (dynamic-type x) '(fn closure)) + (let [s (s-expr x)] + (and (not (empty? s)) (= 'dynamic (dynamic-type (car s))))))) (doc nil "is the value `nil`, i.e. the empty list.") (defdynamic nil '())