3 ms·
The haxe macro reads the file at runtime. Your clojure macro reads the file at compile-time. The proper version would be : (defmacro get-file-contents [s]
by Raphael_Amiard 14y ago
The haxe macro reads the file at runtime. Your clojure macro reads the file at compile-time. The proper version would be :
(defmacro get-file-contents [s]
(if-not (string? s)
(throw (Exception. "Expected string"))
`(slurp ~s)))
- yoklov 14y agoNope, the Haxe program reads and includes the file at compile time, but only if it's a string literal. If it's an expression that evaluates to a string (which only works if you have static typing, as Haxe does), it reads it at runtime. If its neither it fails.