3 ms·
I would not advise this style of programming, because it creates a very tight binding between the application logic and the interface. In fact, it's exactly the
by swolchok 17y ago
I would not advise this style of programming, because it creates a very tight binding between the application logic and the interface. In fact, it's exactly the problematic style caused by GUI builders that generate event handlers and ask you to fill them in.
- radu_floricica 17y agoI think clojure's use of higher order functions is very well suited for this. With only a "#" in front the code becomes a lambda function. This pretty much makes the whole concept of handler functions void - or at least trivial. But I'm not sure if it will work out in the end... and I mixed this with liberal use of metadata and thrown away SQL too... mostly I try to go as far as I can and see where I trip. It's fun. And it does make for some terse code. This for example is the code for changing the person responsible for a brief: (html-select (cons {:id 0 :name "- No account -"} (filter #(:is-account %) @users)) :selected (:account brief) :onchangefn #(do (passoc briefs (:brief %) :account (Integer/parseInt (:value %))) (return-from briefs (:brief %)) :onchangeparams (str "&brief=" (:id brief))) And this really is all of it. No html, no sql, nothing.
- swolchok 17y agoOK, now you want to develop a desktop version of your application with a snazzy graphical interface. Good luck.