Re: symbol is not a symbol in (def (symbol "x") ...) ???

2020-10-03 Thread tome...@gmail.com
`def` is a special form and it expects exactly a symbol as a first argument (https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Compiler.java#L541). That means that you can't do: (def (symbol "a") 1). To generate `defs` from macro you can do the following: (defmacro def-stuff

Re: symbol is not a symbol in (def (symbol "x") ...) ???

2020-10-05 Thread tome...@gmail.com
Yes, that's almost good solution and works on runtime. Almost because I would use `doseq` instead of `for`. `for` generates lazy seq. poniedziałek, 5 października 2020 o 11:41:53 UTC+2 peter...@gmail.com napisał(a): > On Friday, 2 October 2020 at 20:38:50 UTC+1 Bost wrote: > >> I have a problem

Re: symbol is not a symbol in (def (symbol "x") ...) ???

2020-10-05 Thread tome...@gmail.com
One quick hint, since `intern` is a function with side effects (mutates ns state) I would use `run!` instead of `map` (which is lazy). Cheers! poniedziałek, 5 października 2020 o 14:02:22 UTC+2 Bost napisał(a): > This is pure gold - your answers! Thanks a lot. So the take outs and key > ideas