defn Questions

3

Solved

Environment: Clojure 1.4 I'm trying to pull function metadata dynamically from a vector of functions. (defn #^{:tau-or-pi: :pi} funca "doc for func a" {:ans 42} [x] (* x x)) (defn #^{:tau-or-pi: ...
Paranoia asked 28/12, 2012 at 18:10

4

Solved

How do I modify the :arglist attribute for a clojure fn or macro? (defn tripler ^{:arglists ([b])} [a] (* 3 a)) (defn ^{:arglists ([b])} quadrupler [a] (* 4 a)) % (meta #'tripler) => {:argl...
Estefanaestel asked 20/9, 2012 at 20:21

4

Solved

I'd like to do this (in REPL or anywhere) (defn (symbol "print-string") [k] (println k)) and then be able to do (print-string "lol") Or, if there is any other way to create defn from custom ...
Smukler asked 24/3, 2009 at 19:24

1

Solved

I realize that the first rule of Macro Club is Don't Use Macros, so the following question is intended more as an exercise in learning Clojure than anything else (I realize this isn't necessarily t...
Gutta asked 12/6, 2009 at 22:34
1

© 2022 - 2024 — McMap. All rights reserved.