Re: defrecord inside defmacro

2014-09-15 Thread Вук Мировић
понедељак, 15. септембар 2014. 04.23.41 UTC+2, Tobias Kortkamp је написао/ла: > Hi, > > you need to syntax-quote the list you return from your macro. > >(defmacro some-record > [some-name] > `(defrecord ~some-name ['in 'out])) > > Note the backtick `. You then also have to expl

Re: defrecord inside defmacro

2014-09-14 Thread Tobias Kortkamp
Hi, you need to syntax-quote the list you return from your macro. (defmacro some-record [some-name] `(defrecord ~some-name ['in 'out])) Note the backtick `. You then also have to explicitly quote your record field names (see 'in and 'out, try to remove the quotes to see why). Also s

defrecord inside defmacro

2014-09-14 Thread Вук Мировић
Hi all, I started learning Clojure very recently by rewriting my old college Java project to Clojure. Having bunch of records I wanted to automate record creation with macros and to finally learn Clojure macros, but I got stuck. Example (Real code will be more complicated but I need to make this