Hi!

Because macros are evaluated at compile time (they are compiletime 
metaprogramming) and can't be used in eval in ClojureScript we need the Fexpr 
https://en.wikipedia.org/wiki/Fexpr to be able adapt new flow concepts. For 
example it would be handy to write interpreter pattern just by calling eval on 
data structures of clojure to buildfor example UI based on mo-boostrap 
clojurescript library.

Maybe there is already lib for Clojure/Clojurescript which will allow to gain 
such functionality like Fexpr. For me the easiest solution is to override let 
to be able to specify delay objects which can be later consumed with 
deref/force. Of course the let should be expressive and succinct enough to be 
used seamless, for example:

(defn my-if [ condition ~lazy-on-success ~& optional-lazy-on-failure ]
(if condition @lazy-on-failure ~@optional-lazy-on-failure ))

and the use could be:

(my-if (:some-condition some-request)
   (do (println "do-some-side-effect") (println "and here another one"))
   (println "the failure side effect"))

(my-if (:some-condition-2 some-request)
     (println "only on suscess"))

This is actually the only thing which I miss for succinct coding though all 
layers of JEE apps. Runtime (and reflective) metaprogramming is right now 
nicely supported by Groovy and JRuby, why not to bring it to ClojureScript?

Thanks in advance,
Olek

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at https://groups.google.com/group/clojurescript.

Reply via email to