Hi,
Some claim that one superficial aspect of good clojure code is:
* defining short functions that can be composed
However, go-blocks seems to go against this paradigm.
Consider the following:
(go (loop [ ... ]
(case ...
.. (... >! ... )
.. (... >! ... )
.. (... >! ... )))
now, normally, I would refactor this into
(go (loop [ ... ]
(case ...
.. (func arg1 foo1)
.. (func arg2 foo2)
.. (func arg3 foo3)))
where (defn foo [ ... ] (.. >! .. ))
However, I can't do this since go is a macro and the macro can't go across
the function call.
Thus, I'm forced to have code of the form:
(go (loop ...
GIGANTIC BLOCK OF CODE))
where "GIGANTIC BLOCK OF CODE" is a single function which describes the
actions of a process, without any form of refactoring
Thus, my question:
am I using core.async/go in an un-clojurish way?
And if so, what is the clojurish way to use core.async/go ?
Thanks!
--
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.