Hi,
Iam trying to run a function in a thread assuming that threads are
runnable, below is my program i want to print 4 time the current date
(defn- on-thread [f]
(doto (Thread. #^Runnable f)
(.start)))
(defn prnTime [] (prn (System/currentTimeMillis)))
(defn r4t [f]
(d
Hi, foop
Your error in this line:
(r4t (on-thread (prnTime)))
You pass to function r4t thread instead of functions. Because
(on-thread (prnTime)) returns thread
You must pass #(on-thread (prnTime)) instead
Regards,
Nikita Beloglazov
On Fri, Aug 6, 2010 at 3:13 PM, foop1 wrote:
> Hi,
>
> Iam try
thank you for the reply, is there any way to close this 4 threads
after the job is done?
On Aug 6, 8:34 am, Nikita Beloglazov wrote:
> Hi, foop
> Your error in this line:
> (r4t (on-thread (prnTime)))
> You pass to function r4t thread instead of functions. Because
> (on-thread (prnTime)) returns
What do you mean "close threads"?
As I know threads aren't supposed to be closed. There is no mechanism to do
this. They are not connections or smth like that.
On Fri, Aug 6, 2010 at 3:46 PM, foop1 wrote:
> thank you for the reply, is there any way to close this 4 threads
> after the job is done
Are there any good .NET books you guys could recommend? I'm looking
for a range of resources. I don't need "C# in 21 days" or "C# for
dummies", but something an experienced Java hacker could start out
with, similar to Core Java. Also, a more advanced book so I could
learn to follow the ClojureCL
In addition to that, prnTime should have no parens:
#(on-thread prnTime)
As it was, prnTime was running before going into on-thread, which was
acting on a runnable that's nil (the return value of prn). The
difference between the two can be seen in the output. When prnTime
runs inside the threads,
Hi Nikita,
Your function works! Could you explain the "->>" a bit? Thanks, -
Dave
On Aug 5, 5:53 pm, Nikita Beloglazov wrote:
> See my variant of your
> application:https://gist.github.com/efdb66487e899446332f
> I don't know if it works, because I can't test :(
>
> My thoughts about your exam
Hi Dave,
There are really 2 functions, -> and ->>
First ->
Sometimes you need to perform several functions on after another. You can
write something like
(func1 (func2 (func3 value)))
But you also can write like:
(-> value
(func3)
(func2)
(func1))
It takes value, insert it into (func1) form a
Awesome! Thank you so much for your help -- I really appreciate it.
On Aug 6, 12:43 pm, Nikita Beloglazov wrote:
> Hi Dave,
> There are really 2 functions, -> and ->>
> First ->
> Sometimes you need to perform several functions on after another. You can
> write something like
> (func1 (func2 (fu
I have a server which loads some compiled classes/functions then
starts accepting requests and handing them off onto a thread pool for
processing.
No problem - so far...
One of the requests allows the passing and evaluation of an arbitrary
piece of clojure.
This is causing me to lose hair !
The
On Fri, 06 Aug 2010 08:33 -0700, "Sean Devlin"
wrote:
> Are there any good .NET books you guys could recommend? I'm looking
> for a range of resources. I don't need "C# in 21 days" or "C# for
> dummies", but something an experienced Java hacker could start out
> with, similar to Core Java. Als
We have a ten-week program for experienced developers moving to
the .NET platform. Our recommended text is Troelson's "Pro C# 2010
and the .NET 4 Platform, Fifth Edition".
http://www.apress.com/book/view/1430225491
All 1752 pages of it.
It has a lot of things you won't need for understanding
I having some trouble with system calls using clojure (actually a
whole lot more than that but this is the current day's difficulty).
Below, test-execute works, but get-msms-pts-OSX seems to hang, as in
nothing happens and the REPL is unresponsive afterwards. If I run the
output of the (str **
+1 for:
_The C# Programming Language, 3rd Edition_ by Anders Hejlsberg,
Mads Torgersen, Scott Wiltamuth, and Peter Golde
Pretty decent book, but I'm not sure if it's been updated since 2.0 (a lot
of cool stuff came in 3.0 and 4.0 [LINQ, implicit type (inference),
initializers, extension methods,
Also, this only shows the 2nd call (with ls-arg2):
(defn test-execute [ls-arg1 ls-arg2]
(execute (str "ls -" ls-arg1))
(execute (str "ls -" ls-arg2)))
so maybe the difficulty above is some problem with how the multiple
system calls are performed. If I only use this:
(defn get-msms-pts-OSX
Clojure 1.2 RC 2 is now available, along with a corresponding Clojure Contrib,
at:
http://clojure.org/downloads
There is one important change since RC1. Record/map equality is now symmetric
in all cases. There are two
variants:
* In most cases, you should use =. Calls to = include ty
Aha! i see what you are saying thank you for pointing the real
subtleness of the way command is return,
this group is really excellent and awesome in helpfullness
On Aug 6, 11:51 am, Armando Blancas wrote:
> In addition to that, prnTime should have no parens:
> #(on-thread prnTime)
>
> As it was,
Anyone using lein-deamon and have success getting it working? When trying
to start a daemon with 'lein daemon start daemon-name', I'm getting
java.lang.IllegalArgumentException:
No matching method: with-bindings (daemonProxy.clj:27). The entire error log
is at http://gist.github.com/512327.
I get
On Aug 6, 11:50 pm, Dave wrote:
> I get the error:
>
> Cannot run program "pdb_to_xyzr": error=2, No such file or directory
> [Thrown class java.io.IOException]
You may have a path problem.
Try running "env" in the same fashion - I get a very basic path (just
"/bin" and "/usr/bin") and none of
On Aug 7, 5:06 am, j-g-faustus wrote:
> I don't think there's a direct way to create a String array
> in Clojure
Correction - there is: (into-array String ["a" "b"])
jf
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send ema
Hi,
Am 07.08.2010 um 05:06 schrieb j-g-faustus:
> I don't think there's a direct way to create a String array in Clojure
(defn to-env
[env-vars-map]
(->> env-vars-map
(map #(str (name (key %)) "=" (val %)))
into-array))
And an invocation:
user=> (to-env {:PATH "/bin:/usr/bin" :HOME
> :)
(inc ":)")
On Sat, Aug 7, 2010 at 7:27 AM, Meikel Brandmeyer wrote:
> Hi,
>
> Am 07.08.2010 um 05:06 schrieb j-g-faustus:
>
>> I don't think there's a direct way to create a String array in Clojure
>
> (defn to-env
> [env-vars-map]
> (->> env-vars-map
> (map #(str (name (key %)) "=" (
22 matches
Mail list logo