I have a question about transducers in core.async channels.
As far as I understand, if I define a channel with a transducer, the latter
cannot depend on any other external argument other than what is put on the
former.
So the transducer works in a purely functional fashion.
Here is the quest
Thanks Timothy
On Saturday, 12 November 2016, Timothy Baldridge
wrote:
> clojure.core/print-method is a multi method that handles the printing of
> objects. You can override or implement the print method by:
>
> (defmethod print-method my.class.Foo
> [^my.class.Foo instance ^Writer w]
> (.wr
clojure.core/print-method is a multi method that handles the printing of
objects. You can override or implement the print method by:
(defmethod print-method my.class.Foo
[^my.class.Foo instance ^Writer w]
(.write w ...))
I do that to provide custom printing for deftypes, but you can easil
Hi all,
I cache quite a bit of stuff on the server, so when I return or print
out the 'system' I get the unhelpful recursive stack trace of Java
running out of heap.
Is there some protocol I can implement on large data structures such
that whenever they are serialised they just dump some of their
On Fri, May 20, 2016 at 12:50 PM, Kevin Downey wrote:
> This is a difference in the type function. The clojurescript type
> function ignores metadata.
Thanks! That was my second guess, but I looked and did not see that
documented on the differences page.
I already had an ia-type? function enca
/github.com/clojure/clojurescript/wiki/Differences-from-Clojure
> that "Atoms work as in Clojure.", but I think I see a difference:
>
> 1. I am using a custom type hierarchy in a namespace
> tiltontec.modeller.cell_types:
>
> |
> (defonce ia-types (-> (make-hiera
I see here
https://github.com/clojure/clojurescript/wiki/Differences-from-Clojure that
"Atoms work as in Clojure.", but I think I see a difference:
1. I am using a custom type hierarchy in a namespace
tiltontec.modeller.cell_types:
(defonce ia-types (-> (m
On Thursday, December 10, 2015 at 4:40:49 AM UTC-6, Dan Kersten wrote:
>
> I write such code like this:
>
> (defn sdescriptive-name [] )
> (def my-atom (atom (descriptive-name)))
>
> Where descriptive-name would describe the data shape or purpose.
> This way the atom is not obscured behind many l
scures meaning” :-).
>
> I hope that doesn’t come across as condescending as I fear...
>
>
> On 10 Dec 2015, at 06:02, Mars0i wrote:
>
> Another use case, fwiw:
>
> (def my-atom
> (let [...
>
> ...]
> (atom ...)))
>
> A special na
n 10 Dec 2015, at 06:02, Mars0i wrote:
>
> Another use case, fwiw:
>
> (def my-atom
> (let [...
>
> ...]
> (atom ...)))
>
> A special naming convention for (e.g.) atoms makes it clear that what's below
> the many lines of let bindi
Another use case, fwiw:
(def my-atom
(let [...
...]
(atom ...)))
A special naming convention for (e.g.) atoms makes it clear that what's
below the many lines of let bindings (and maybe comment lines, too) is
going to produce an atom; you don't have to rea
rt’ can _only_ sensibly be state which can only be an atom.
>
> Having said that, if I had mixed refs and atoms then I might consider
> splitting those, but in general I find it obvious and intuitive when looking
> through past code which are atoms and which are fns/vars.
>
> M
tom.
>
> Having said that, if I had mixed refs and atoms then I might consider
> splitting those, but in general I find it obvious and intuitive when
> looking through past code which are atoms and which are fns/vars.
>
> Might just be me though :-).
>
> On 7 Dec 2015,
Good point, Colin, about mixed refs and atoms. That might change things a
little (although in my years of Clojure, I have never needed to mix them to
the point of needing to clarify).
I would still prefer a textually descriptive name over a symbolic prefix or
suffix in this case though. At the
+1.
I haven’t done an extensive study, but I am sure all of my atoms’s stand out
from other fns/vars because the name makes it obvious. For example,
‘shopping-cart’ can _only_ sensibly be state which can only be an atom.
Having said that, if I had mixed refs and atoms then I might consider
r non-alphanumeric character is visually confusing
> or messy.
>
> As an experiment, I just started using & as a suffix for variables whose
> values are atoms.:
> (def state& (atom 1))
> (swap! state& inc)
> @state&
>
> Using only a suffix character means
As an experiment, I just started using & as a suffix for variables whose
values are atoms.:
(def state& (atom 1))
(swap! state& inc)
@state&
Using only a suffix character means that you don't have a punctuation
character next to @, which I prefer.
(I wouldn't want
I saw some sample code that prefixed the atom name with a ! recently, seemed to
look sensible to me.
(swap! !state conj :whatever)
And so on.
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.
; >
> > > Ps. Note the nice symmetry between *foo* and @foo@.
> > >
> > > On Dec 6, 2015 2:42 PM, "Gregg Reynolds" wrote:
> > > Postfix @? Haven't pondered this before but I like the idea. Why should
> > > perl have all the fun?
>
ke the idea. Why
should perl have all the fun?
> >
> > On Dec 5, 2015 3:47 PM, "Mars0i" wrote:
> > &, $, and ! might be good to use as special naming characters for
atoms/refs/agents, either as an initial char, a final char, or both, but
I'm wondering whether
. Why should
> perl have all the fun?
>
> On Dec 5, 2015 3:47 PM, "Mars0i" wrote:
> &, $, and ! might be good to use as special naming characters for
> atoms/refs/agents, either as an initial char, a final char, or both, but I'm
> wondering whether anyone
&, $, and ! might be good to use as special naming characters for
>> atoms/refs/agents, either as an initial char, a final char, or both, but
>> I'm wondering whether anyone already has a naming convention that they use.
>>
>> --
>> You received this message beca
Postfix @? Haven't pondered this before but I like the idea. Why should
perl have all the fun?
On Dec 5, 2015 3:47 PM, "Mars0i" wrote:
> &, $, and ! might be good to use as special naming characters for
> atoms/refs/agents, either as an initial char, a final char, or
On Saturday, December 5, 2015 at 8:04:34 PM UTC-6, tbc++ wrote:
>
> Also, if you have so many atoms in your program that it becomes hard to
> remember where they are, that would be another source of concern ;-)
>
Yeah I'm worried that I'll come back to the cod
On Saturday, December 5, 2015 at 5:45:22 PM UTC-6, James Reeves wrote:
>
> Why should they have any sort of naming scheme? Dynamic vars are unusual
> because their values can change. Atoms and refs remain the same, and even
> though inside their values mutate, they don't aff
Also, if you have so many atoms in your program that it becomes hard to
remember where they are, that would be another source of concern ;-)
On Sat, Dec 5, 2015 at 4:44 PM, James Reeves wrote:
> Why should they have any sort of naming scheme? Dynamic vars are unusual
> because their valu
Why should they have any sort of naming scheme? Dynamic vars are unusual
because their values can change. Atoms and refs remain the same, and even
though inside their values mutate, they don't affect the outer var.
- James
On 5 December 2015 at 21:39, Mars0i wrote:
> Does anyone
&, $, and ! might be good to use as special naming characters for
atoms/refs/agents, either as an initial char, a final char, or both, but
I'm wondering whether anyone already has a naming convention that they use.
--
You received this message because you are subscribed to the Goog
Does anyone want to suggest or promote a naming convention for atoms, refs,
and agents, i.e. some of things that you can dereference with @ i.e. deref?
(Also, what about futures, delays, and promises? I think of these as
playing a different sort of role, even though deref works with them, too
Thank you :)
Extremely clear !
On Friday, August 7, 2015 at 3:48:14 PM UTC+2, Stuart Sierra wrote:
>
> Hi Simone,
>
> The stack overflow here is caused by the REPL trying to print a circular
> reference. `swap!` always returns the new value of the Atom, and the REPL
> tries to print it.
>
> If
Hi Simone,
The stack overflow here is caused by the REPL trying to print a circular
reference. `swap!` always returns the new value of the Atom, and the REPL
tries to print it.
If you don't print the Atom, this self-reference can still work:
user=> (def a (atom {}))
#'user/a
user=> (do (swap!
Hi all,
I noticed this behaviour that I was not expecting:
simo@simo:~$ lein repl
nREPL server started on port 42010 on host 127.0.0.1 -
nrepl://127.0.0.1:42010
REPL-y 0.3.5, nREPL 0.2.6
Clojure 1.6.0
OpenJDK 64-Bit Server VM 1.7.0_79-b14
Docs: (doc function-name-here)
(find-doc "p
Hi,
Thanks for all suggestions. It all encouraged me to deep dive into atom-s
code which turns out to be a simple wrapper over Java
java.util.concurrent.atomic.AtomicReference which essentially is a
spinlock. Knowing how it works under the hood makes so easier
to use it ...
Below piece (hopefully
On 8 December 2014 at 21:46, Fluid Dynamics wrote:
> [...]
> Which means it's locking or bust. You just get to either do the locking
> yourself or delegate :)
Sure, but isn't it nice when somebody else does your locking for you? :-)
Incidentally, there is a trade-off here between lockless reads
Oh, and as for how to use it here, you could for example say
(.putIfAbsent concurrent-hash-map :foo (delay (foo)))
Then the first thread to @(get concurrent-hash-map :foo (delay
:not-found)) (or similar) would actually compute the value.
With a map in an atom, you could swap! using a function
On Monday, December 8, 2014 3:34:05 PM UTC-5, Michał Marczyk wrote:
>
> On 8 December 2014 at 17:54, Andy L >
> wrote:
> >> But I'd personally just use a delay rather than "locking" for this
> >> purpose.
> >
> >
> > It is not that I like locking at all. However I still fail to see, how
> in
On 8 December 2014 at 17:54, Andy L wrote:
>> But I'd personally just use a delay rather than "locking" for this
>> purpose.
>
>
> It is not that I like locking at all. However I still fail to see, how in a
> multithreaded context memoize/cache prevents executing a given function more
> than once
>
>
> Most of the cache implementations in core.cache have no side-effects. They
> simply return a new cache rather than overwriting the old one. The memoize
> library places the cache in an atom, so it's guaranteed to change
> atomically.
>
I tried to read the cache code (btw an excellent exerci
On 7 December 2014 at 05:13, Andy L wrote:
>
>
>
>> The SoftCache uses a ConcurrentHashMap, but that caching option isn't
>> used in core.memoize. Are you building a custom memoizer?
>>
>>
> WRT ConcurrentHashMap, it was an incorrect conclusion on my part. In any
> case, I fail to see "thread saf
or even better (using future themselves as a "marker" in the atom):
(defmacro map-future-swap! [a k f]
`(locking ~a
(when (not (contains? @~a ~k))
(swap! ~a assoc ~k (future (swap! ~a assoc ~k (~f ~k
)
)
)
--
You received this message because you are subscribed t
> The SoftCache uses a ConcurrentHashMap, but that caching option isn't used
> in core.memoize. Are you building a custom memoizer?
>
>
WRT ConcurrentHashMap, it was an incorrect conclusion on my part. In any
case, I fail to see "thread safety" in the cache implementation, but again
I could be wron
On 7 December 2014 at 01:13, Andy L wrote:
>
> Thanks for looking into that. This indeed would solve a "semantics"
> problem of memoize, as it returns a value now. However, it seems that
> clojure.core.memoize,
> or rather clojure.core.cache memoize is based of, is not thread safe.
>
> It uses C
> (defn memoized [f]
> (comp deref (memoize (fn [& args] (delay (apply f args)
>
>
Thanks for looking into that. This indeed would solve a "semantics" problem
of memoize, as it returns a value now. However, it seems that
clojure.core.memoize,
or rather clojure.core.cache memoize is based of,
"future" is already there working
> hard on the problem, we simply bail. However, that leads to another problem.
>
> "compare-and-set!" just operates on atoms as wholes, which is fine for
> unstructured data, but falls short for things somewhat more comple
turn value.
The easiest solution, is to create another atom with a map of the arguments
into a "state". If some other "future" is already there working hard on the
problem, we simply bail. However, that leads to another problem.
"compare-and-set!" just operates on atom
IMHO, for what you describe, i.e. "I'd like to view an atom's changes in
state as a lazy sequence." there is no need to change the IAtom or
add-watch function.
Watchers are called for their side-effects, so if you want to consume their
output as a "lazy sequence", you have to do that transformatio
I've been reading about transducers with interest.
The official docs at http://clojure.org/transducers say "*Because
transducers are decoupled from input or output sources, they can be used in
many different processes - collections, streams, channels, observables,
etc.* "
At this stage, the
On Tue, Jul 15, 2014 at 9:44 AM, Stefan Kamphausen
wrote:
>
> Note, that it may be a reasonable fix to your situation to change bar
> instead of foo. This is possible by evaluating the new definition of bar
> /later/; bar could also be a dynamically bindable Var, so that when
> compiling foo, we
>
> (defn foo
> "I don't do a whole lot."
> [a b]
> ((let [y (bar(a b))]
> (println a b "Hello, World!"
>
>
Now, *there* are some very suspicious parens around...
1. You're trying to call a as a function
2. Yes, you're calling bar with too few parameters, but how many? One.
3. Fina
You're right and ouch! That's horrible. It's an error that should be known
at eval time.
On Tuesday, July 15, 2014 1:20:04 PM UTC+1, Jony Hudson wrote:
>
> I think that's what you'd expect. This will also evaluate just fine:
>
> (defn foo
> [x y]
> (bar x y))
>
> but will fail at run-time too
I think that's what you'd expect. This will also evaluate just fine:
(defn foo
[x y]
(bar x y))
but will fail at run-time too.
Jony
On Tuesday, 15 July 2014 13:07:43 UTC+1, edw...@kenworthy.info wrote:
>
> Creating a new project in Lein then opening it in Light Table and with
> minimal ed
On Tuesday, July 15, 2014 12:38:53 PM UTC+1, Jeremy Heiler wrote:
>
> On Tue, Jul 15, 2014 at 3:15 AM, >
> wrote:
>
>> Curiouser and curiouser.
>>
>> I turns out the problem was *not* with my next-to-play function but
>> rather with the fact that it takes three arguments but I was only passing
On Tue, Jul 15, 2014 at 3:15 AM, wrote:
> Curiouser and curiouser.
>
> I turns out the problem was *not* with my next-to-play function but rather
> with the fact that it takes three arguments but I was only passing it two.
>
> The curious part is that whilst the compiler complained about the wron
Curiouser and curiouser.
I turns out the problem was *not* with my next-to-play function but rather
with the fact that it takes three arguments but I was only passing it two.
The curious part is that whilst the compiler complained about the wrong
arity if I evaluated the call directly, it didn'
Quick follow up, replacing get-and-make-move with
(defn get-and-make-move
[board strategy player]
board)
Still have the same problem: so the issue is not with that function nor any
of the functions it calls (nor the strategies).
Beginning to think it's my next-to-play function, which would
Pretty sure the strategy isn't a problem (random-strategy picks a random
move from all legal moves) and it works in the single-threaded command line
version of the app.
ditto all-directions which is constant:
(def ^:constant all-directions
"Defines the array of all possible directions from a
Looking at this code without further knowledge of the strategy function, my
first guess is simply that your strategy function may not be returning a
result which satisfies the valid-move? and legal-move? predicates thus
throwing you into an infinite loop. Possibly the printf is being suppressed
(defn get-move
"Call the player's strategy function to get a move.
Keep calling until a valid and legal move is returned
and pass that back.
There is no way to escape without the strategy returning
a valid and legal move."
[board strategy player]
(let [[x y :as move] (strategy board
Could you post more of your code? If you suspect your code is stopping at
the first swap!, it might be an idea to post the contents of get-and-make-move
as well.
- James
On 14 July 2014 11:25, wrote:
> So I've got something strange happening.
>
> I have a function (play, see below) which I spi
So I've got something strange happening.
I have a function (play, see below) which I spin off in a separate thread:
(future (play {:black black-strategy :white white-strategy} :black))
The weird thing is whilst the first (println) in play is printed to the
console, and so is a similar print f
The function map> takes a channel and a function, and returns a new
channel; every time an element is sent through that new channel, it
first goes through the given function (and it is the result of that
function that is actually sent through the original channel).
The function map< is similar, ex
Hi Gary,
Your function looks interesting and succinct, but I am still new to this
subject so am not sure how it would be used. Could you give some examples?
Jesse
On Wednesday, May 14, 2014 3:34:17 AM UTC+9, Gary Verhaegen wrote:
>
> What about the following? (as is bound to clojure.core.async
What about the following? (as is bound to clojure.core.async ns)
(defn decorate-channel
[chan at]
(as/map> (fn [x] (swap! at conj x) x)
(as/map< (fn [x] (swap! at pop) x)
chan)))
As far as I can tell, it should do what you want, without introducing
global vars. I
Hey guys, I took your suggestions and just wanna deliver the finished
product. I included the macro in there for practice, but agree it is
probably not necessary. Thanks for all your help.
p is for pretty :)
> (defn pchan [ch]
> {:channel ch, :buffer (atom [])})
>
> (defn pbuff [{:keys
Ok the destructuring is clear to me now. And yes Jay Field article was great :)
So the only thing that remains now is to get the symbol being passed into my
original transparent-put function to stop evaluating to either ch-log or
clojure.core.async.impl.channels.ManyToManyChannel@5096B86b-log
I
On 12 May 2014 10:48, gamma235 wrote:
> When I try this using your code above I get a stack-trace that I can't
> understand. Am I using it wrong?
>
> (transparent-chan c)
>> (transparent-put c 42)
>> (transparent-take c)
>>
>
Yep, try this instead:
(def tc (transparent-chan c))
(transparent-
; >> >
>> >> >> 2) Whenever I try to create a generic process to
>> automatically
>> >> >> generate a log-name for each channel and then call update,
>> I get a
>> >> >> 'symbol cannot be cast to atom' error
ow: you cannot call swap! on a symbol. Make sure
> your
> >> atom is
> >> > the first argument to swap! wherever you use it.
> >> >
> >> >
> >> >> 3) Is there a better way to keep track of wh
's on a channel
> that
> >> >> doesn't use macros?
> >> >
> >> > You cannot look inside of a channel, but to do what you want and
> >> get a
> >> > sense of how core.async works, I think you are on the righ
by
>> > logging as you put stuff in and take it out.
>> >
>> > That said, I would start by getting rid of the log and the
>> macro--these
>> > are unnecessary complications--and do things very simply:
>> >
>> &g
> #'user/c
> > => (def my-go-loop (async/go-loop [msg (async/ msg "
> > msg " from channel " 'c)))
> > #'user/my-go-loop
> > => (defn put-and-print! [c msg] (println "putting msg " msg " onto
>
When I try this using your code above I get a stack-trace that I can't
understand. Am I using it wrong?
(transparent-chan c)
> (transparent-put c 42)
> (transparent-take c)
-
>
>"Exception in thread \"async-dispatch-64\" "
>"java.lang.IllegalArgumentException: No implementation
Thanks James,
I played around with the persistent queues before I started this exercise,
but opted for atoms, after seeing this behavior (a la JOC):
<https://lh6.googleusercontent.com/-4u0XBfNvbv4/U3CMpigLRoI/BjE/HDjKbcvSgAM/s1600/Screen+Shot+2014-05-12+at+5.55.27+PM.png>
I
;user/my-go-loop
> > => (defn put-and-print! [c msg] (println "putting msg " msg " onto
> > channel " 'c) (async/put! c msg))
> > #'user/put-and-print!
> > => (put-and-print! c "I am a message!")
> > putting msg I am
ge! from channel c
> nil
> =>
>
> Printing out "channel c" is kind of silly since there is only one, but
> it sounds like you may want to do this with multiple channels so this is
> one way to print out the variable name--simply quote it.
>
> DD
>
> (20
y since there is only one, but
it sounds like you may want to do this with multiple channels so this is
one way to print out the variable name--simply quote it.
DD
(2014/05/12 11:41), gamma235 wrote:
> Hi everyone,
>
> I am getting my feet wet with core.async and am trying to attach atoms
>
On 12 May 2014 03:41, gamma235 wrote:
>
> (defn log-name [ch] (symbol (str ch '-log)))
>>
>> ;; Is this efficiently written?
>> (defmacro transparent-chan [ch]
>> (do
>> `(def ~ch (chan))
>> `(def (log-name ~ch) (atom []))
>> `(println "new transparent channel created!")))
>>
>
Thi
Hi everyone,
I am getting my feet wet with core.async and am trying to attach atoms to
channels that update automatically and print out to the console as you take
and put. This is not for anything serious, just a way to get familiar with
the behavior and functionality of the library and
Okay, got it. It looks like you're using agents where I'd been using
atoms. Not sure if there's much of a difference for these use cases...
the one-directional flow of source -> state -> watcher update
notification -> ui change seems to work well with both agents and ato
On Nov 30, 2013, at 10:39 AM, Sam Ritchie wrote:
> Brian, I like that too. It looks like you're providing the state when you do
> the def-action?
If I understand the question right, yes. A test of a state function would look
like:
(fact
(incrementer {:value 1} 3) => {:value 4}))
> Is the
Clojurescript UI code, I've been
running into a pattern with atoms and watches that I THINK I can
abstract away... but the solution feels wrong, and I'd love to
hear a better way.
Say I'm building a stopwatch for timing runners in a race. I've
got a clojure r
update-active [:* :active?]]])
This approach is described in:
https://github.com/pedestal/pedestal/blob/master/app/examples/walkthrough.clj
On Friday, November 29, 2013 6:58:32 PM UTC+1, Sam Ritchie wrote:
>
> Hey guys,
>
> As I start to work on more Clojurescript UI code, I've bee
On Nov 29, 2013, at 11:58 AM, Sam Ritchie wrote:
> 2) a defstatefn macro that defines the "mark" and "mark!" versions at the
> same time.
I do that with agents:
(def-action text :send [state number message])
… creates a `text*` and a `text>!`, where `test>!` is
(defn text>! [number message]
Hey guys,
As I start to work on more Clojurescript UI code, I've been running into
a pattern with atoms and watches that I THINK I can abstract away... but
the solution feels wrong, and I'd love to hear a better way.
Say I'm building a stopwatch for timing runners in a r
the
> building of a robust good STM. You (now) know the mistakes you made and *
> know*it’s time to restart the STM implementation from scratch.
>
On the other hand, this is a problem occuring only at the most demanding
level of load on the code. People may still benefit from the
Datomic stores the entire database in an atom (not an STM ref), and
updates it with a call to swap! It is literally no more complex than a
trivial hackneyed book example. :-)
A lot of my systems have evolved into something similar and I've
wondered what the implications of this approach ar
On Fri, Jan 6, 2012 at 11:28 PM, Alan Malloy wrote:
> but if you look at the post
There is no call for taking a rude tone. I correctly answered the
question as originally posed.
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group,
in two.
>
> >> >> Updated example:
>
> >> >> (def state {:result nil :input [1 2 3]})
>
> >> >> (defn update-item!
> >> >> [item]
> >> >> (if (:result item) ; if already processed, do nothing
> >> >
input [1 2 3]})
>>
>> >> (defn update-item!
>> >> [item]
>> >> (if (:result item) ; if already processed, do nothing
>> >> item
>> >> (let [result (side-effect-fn! (:input item))]
>> >> (assoc item
(:result item) ; if already processed, do nothing
> >> item
> >> (let [result (side-effect-fn! (:input item))]
> >> (assoc item :result result
>
> >> (swap! state update-item!) ;; same problem
>
> > Not doable with atoms if you have a
[result (side-effect-fn! (:input item))]
>> (assoc item :result result
>>
>> (swap! state update-item!) ;; same problem
>
> Not doable with atoms if you have a side-effecty thing that you can't
> separate out. You'll have to use something lower-level
ample:
>
> (def state {:result nil :input [1 2 3]})
>
> (defn update-item!
> [item]
> (if (:result item) ; if already processed, do nothing
> item
> (let [result (side-effect-fn! (:input item))]
> (assoc item :result result
>
> (swap! state update-ite
Thank you,
But the things are more complicated. In my case, I need to update the atom
with the result of a (native) function which unfortunately also performs
some side effects and cannot be split in two.
Updated example:
(def state {:result nil :input [1 2 3]})
(defn update-item!
[item]
On Fri, Jan 6, 2012 at 3:02 PM, Jozef Wagner wrote:
> Consider this contrived piece of code:
>
> (def aval (atom {:dumped false :contents "hello world"}))
>
> (defn update!
> [item]
> (when-not (:dumped item)
> (spit "a.out" (:contents item) :append true)
> (assoc item :dumped true)))
Consider this contrived piece of code:
(def aval (atom {:dumped false :contents "hello world"}))
(defn update!
[item]
(when-not (:dumped item)
(spit "a.out" (:contents item) :append true)
(assoc item :dumped true)))
How should I correctly call update! ? Each of following two calls ha
After reading your posts and thinking "wouldn't it be nice to just
kick off a thread and not care about the return value" I recall Rich
using/liking [1] the Java Executor framework [2]. I looked at
clojure.lang.Agent and saw it used there, too. It's tricky because I
wouldn't want to lean on Java
Hi,
Am 16.06.2010 um 22:34 schrieb Christophe Grand:
> I agree, it still feels a little dirty to use a future without caring
> about the return value but on the positive said you get an easy way to
> block and wait for the tread to finish (deref) and you also get
> future-done?, future-cancel and
On Wed, Jun 16, 2010 at 10:20 PM, Meikel Brandmeyer wrote:
> The typical solution for your problem would probably be:
>
> (->> long-running-function-with-recur Thread. .start)
>
> This starts you function in a dedicated thread and you can save the overhead
> of send-off and use recur directly. I'
Hi,
Am 15.06.2010 um 23:27 schrieb Ryan Waters:
> Thank you for pointing that out. I notice your style is similar to
> Rich's in his ant.clj [1] which seems like the kind of solution that
> might be used in other functional and/or lisp languages. Do you know
> if that's the case with self-calli
On Wed, Jun 16, 2010 at 12:17 AM, Christophe Grand
wrote:
> Hi Ryan,
>
> On Tue, Jun 15, 2010 at 6:01 PM, Ryan Waters wrote:
>> I'm working with the code at the following gist and also pasted below:
>>
>> http://gist.github.com/421550
>>
>> I'd like to have execution of a separate thread (agent)
1 - 100 of 144 matches
Mail list logo