into-array without the extra seq

2016-05-11 Thread László Török
Hi,


The other day I was trying to do an

(into (long-array 0) xform some-vec)

which doesn't work, then I realized there is *into-array* for that,
however, it turns everything into a *seq* first.

Is there any plans for extending *into* to hand primitive array, or
rewriting *into-array* to do away with the extra allocation?

Thanks,

Laszlo

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
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 clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


core.match: order of patterns

2015-01-29 Thread László Török
Hi,

I started experimenting with core.match.

One thing that isn't obvious to me, how it should work when matching more
than one pattern.

In the following example, the expression returns 3 or 4 depending on which
pattern comes first:

(require '[clojure.core.match :as cm])

(cm/match [:a true false]
[_ _ true] 1
[:a _ true] 2
[:a true false] 4
[:a true _] 3
)

where as I'd expect it would go for the most-specific match at least
where the choice is between a wildcard and non-wildcard option.

Is it correct to assume, that the algorithm constructs an decision tree
that will hit a minimum amount of patterns, however, if there are more than
one matching clauses, its result is an arbitrary choice of the possible
decisions?

Thanks!

Laszlo

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
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 clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: CIDER 0.8.2 released!

2014-12-21 Thread László Török
This is fantastic! Congrats and kudos to all the contributors.

One question: will the 0.8.2 release make it to MELPA-stable?

Thanks!

L

2014-12-21 11:54 GMT+01:00 Bozhidar Batsov bozhi...@batsov.com:

 Ladies and gentlemen, I’m happy to inform you that CIDER 0.8.2 is out!
 It’s a bugfix-only release (which means you totally want to use it). Have a
 look at the release notes (
 https://github.com/clojure-emacs/cider/releases/tag/v0.8.2) for all the
 gory details.

 This will be the final release in the 0.8.x series (unless some terrible
 regression doesn’t pop up). There are no concrete plans for 0.9 yet, but I
 hope it will introduce some (or ideally all) of the following:

 * better cljs support

 * comint-based REPL buffers

 * boot support

 * better handling of multiple nREPL connections

 * and whatever else we manage to fit in :-)

 Please, report bugs and submit suggestions for improvements here
 https://github.com/clojure-emacs/cider/issues. If you like clojure-mode,
 CIDER and inf-clojure you can support their development via Gratipay
 https://gratipay.com/bbatsov/

 P.S. In related news - squiggly-clojure (
 https://github.com/clojure-emacs/squiggly-clojure), a flycheck extension
 for CIDER is now an official clojure-emacs project.

 --
 Cheers,
 Bozhidar

  --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 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 clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.




-- 
László Török

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
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 clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: futures + refs

2014-12-11 Thread László Török
Hi Sam,

have you tried putting the incoming (hashtag,tweet) tuples into a queue and
have another thread pull them out and upload them to couchdb?

I'm unfamiliar with HBC, but I assume it has a callback-based API, so you
should be able to have multiple callbacks/connections/streams feed the same
queue and have a single thread do the upload (and maybe batch if necessary).

I don't see refs being a particularly good fit for this problem, but I
could be wrong.


2014-12-11 16:18 GMT+00:00 Sam Raker sam.ra...@gmail.com:

 I've got some code that's using Twitter's HoseBirdClient to pull tweets
 from the public stream, which I then preprocess and store with CouchDB.
 Right now, my HBC client is being forced to reconnect more than I'd like,
 which occasionally causes my app to hang, for reasons I'm not entirely
 clear on. Regardless, some preliminary research on HBC suggests that the
 reconnections are being caused by my code failing to keep up with the
 endpoint, which in turn suggests that my processing+uploading is taking too
 long. I tried wrapping the processing+uploading part in futures, which
 definitely sped things up, but caused 409 errors when uploading to
 CouchDB--briefly, Couch requires any update operation to include a
 git-style rev string, and if the rev you provide isn't the most recent
 one, it throws a 409 at you. I'm organizing things by hashtag, so tweets
 with multiple copies of the same hashtag, or series of tweets with the same
 hashtag are the culprit--future A gets the current doc from Couch,
 processes it, and uses the rev it got from the currently-existing doc,
 while future B does the same thing, but finishes first, so now future A has
 an outdated rev, and that causes the 409.

 The vague solution I've come up with involves using a map to store the rev
 values, with the last step of the processing/uploading function being to
 store the rev number Clutch helpfully returns to you after a successful
 update. From what I can tell, refs are the way to go, since each future is
 effectively a separate thread. My questions are as follows:
 1) Would I have to store the map-of-refs in a ref?
 2) Is this even feasible? Would the timing work out?
 3) With the addition of all this dereferencing and `dosync`+`alter`-ing,
 would this actually end up speeding things up all that much?

 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 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 clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.




-- 
László Török
--
Checkout http://www.lollyrewards.com/

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
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 clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: futures + refs

2014-12-11 Thread László Török
Excellent.

IF the problem is that your write rate to couchdb can't keep up with the
incoming tweet stream (which may be the case) try batching the writes to
couch, i.e. instead of firing an update on every single tweet build up a
larger batch in that loop, and once you hit a threshold (of your choice)
then you send it to couch.

As you said, it could be something totally different. :)

2014-12-11 16:52 GMT+00:00 Sam Raker sam.ra...@gmail.com:

 So HBC actually does that already--it dumps tweets into a
 LinkedBlockingQueue. Right now, I'm doing `(loop [tweet (.take queue)]...`,
 which, I think, essentially amounts to what you're suggesting, but I could
 be misunderstanding you.

 There's a distinct possibility that all the reconnections are caused by my
 home's internet connection--my local ssh connections get dropped
 constantly, which suggests there might be a problem somewhere. I figured
 trying to optimize my code couldn't hurt, though.

 On Thu, Dec 11, 2014 at 11:43 AM, László Török ltoro...@gmail.com wrote:

 Hi Sam,

 have you tried putting the incoming (hashtag,tweet) tuples into a queue
 and have another thread pull them out and upload them to couchdb?

 I'm unfamiliar with HBC, but I assume it has a callback-based API, so you
 should be able to have multiple callbacks/connections/streams feed the same
 queue and have a single thread do the upload (and maybe batch if necessary).

 I don't see refs being a particularly good fit for this problem, but I
 could be wrong.


 2014-12-11 16:18 GMT+00:00 Sam Raker sam.ra...@gmail.com:

 I've got some code that's using Twitter's HoseBirdClient to pull tweets
 from the public stream, which I then preprocess and store with CouchDB.
 Right now, my HBC client is being forced to reconnect more than I'd like,
 which occasionally causes my app to hang, for reasons I'm not entirely
 clear on. Regardless, some preliminary research on HBC suggests that the
 reconnections are being caused by my code failing to keep up with the
 endpoint, which in turn suggests that my processing+uploading is taking too
 long. I tried wrapping the processing+uploading part in futures, which
 definitely sped things up, but caused 409 errors when uploading to
 CouchDB--briefly, Couch requires any update operation to include a
 git-style rev string, and if the rev you provide isn't the most recent
 one, it throws a 409 at you. I'm organizing things by hashtag, so tweets
 with multiple copies of the same hashtag, or series of tweets with the same
 hashtag are the culprit--future A gets the current doc from Couch,
 processes it, and uses the rev it got from the currently-existing doc,
 while future B does the same thing, but finishes first, so now future A has
 an outdated rev, and that causes the 409.

 The vague solution I've come up with involves using a map to store the
 rev values, with the last step of the processing/uploading function being
 to store the rev number Clutch helpfully returns to you after a successful
 update. From what I can tell, refs are the way to go, since each future is
 effectively a separate thread. My questions are as follows:
 1) Would I have to store the map-of-refs in a ref?
 2) Is this even feasible? Would the timing work out?
 3) With the addition of all this dereferencing and `dosync`+`alter`-ing,
 would this actually end up speeding things up all that much?

 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 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 clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.




 --
 László Török
 --
 Checkout http://www.lollyrewards.com/

  --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 ---
 You received this message because you are subscribed to a topic in the
 Google Groups Clojure group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/clojure/zRy6dm1Vmcs/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to
 clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


  --
 You received this message because you

Re: clojure.edn won't accept clojure.java.io/reader? How to work around this and why isn't this documented anywhere?

2014-12-08 Thread László Török
2014-12-08 8:12 GMT+00:00 Fluid Dynamics a2093...@trbvm.com:

 On Monday, December 8, 2014 2:26:42 AM UTC-5, Andy Fingerhut wrote:

 In regards to your question Why isn't this documented anywhere?, it is
 documented somewhere -- in the documentation string for clojure.edn/read,
 the very function you were attempting to use:

 user= (doc clojure.edn/read)
 -
 clojure.edn/read
 ([] [stream] [opts stream])
   Reads the next object from stream, which must be an instance of
   java.io.PushbackReader or some derivee.  stream defaults to the
   current value of *in*.


 What's *not* documented is that io/reader doesn't output something that
 edn/read can use directly, nor is there documented an officially
 recommended workaround for this.


FWIW I don't think that io/reader(v1.2) was intended to output something
that edn/read can use directly, as it was added well before clojure.edn
(v1.5).


 AFAICT just wrapping the reader output in (java.io.PushbackReader. ...)
 works.

There you go.



 Still, this is awkward, verbose, and prevents the (nontrivial) use of edn
 in a platform-neutral way by referring only to Clojure functions without
 direct interop. Well, except for the even more awkward workaround of slurp
 and read-string, with the accompanying need to hold the entire file in
 memory *twice* for a short time.


 As far as why it requires a PushbackReader, I didn't design the API.  Yes,
 some things in Clojure require using Java interop, and in many (but not
 all) cases, file I/O requires it.


 Perhaps io/reader should output a PushbackReader, if only for
 convenience's sake.

io/reader is not meant to be used solely as an input to edn/read.



 Also, how does this work on ClojureCLR or ClojureScript? Neither of those
 platforms has a java.io.PushbackReader, and I'm not even sure what the
 equivalent of the clojure.java.io namespace is for them, unless the
 java in that name is misleading.

Exactly! There is no clojure.java.io as they are on a different host.
Different host implies likely different I/O capabilities.
BTW cljs has cljs.reader/read-string


  --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 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 clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.




-- 
László Török

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
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 clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


assert inside an if-let

2014-11-19 Thread László Török
Hi,

the following form doesn't compile and I see no reason why it shouldn't:

(if-let [a a] a (assert a))

IMHO it is a bug.

If anyone is of a different opinion please share.

Thanks,

-- 
László Török

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
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 clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: assert inside an if-let

2014-11-19 Thread László Török
mea culpa, thanks, i should read the docs more closely next time

2014-11-19 14:47 GMT+00:00 Niels van Klaveren niels.vanklave...@gmail.com:

 From the docs If test is true, evaluates then with binding-form bound to
 the value of  test, if not, yields else. So a is NEVER bound within the
 else block, and can't compile.


 On Wednesday, November 19, 2014 3:34:13 PM UTC+1, Las wrote:

 Hi,

 the following form doesn't compile and I see no reason why it shouldn't:

 (if-let [a a] a (assert a))

 IMHO it is a bug.

 If anyone is of a different opinion please share.

 Thanks,

 --
 László Török

   --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 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 clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.




-- 
László Török
Checkout justonemorepoint.com - Know your true value

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
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 clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Idiomatic way to return a single value from an async function

2014-11-11 Thread László Török
+1, this is mostly what we resort to.

(defn some-async-func [param-a param-b  [out-chan]]
  (let [ch (or out-chan (chan)]
 ...
  )

2014-11-11 8:53 GMT+00:00 Daniel Kersten dkers...@gmail.com:

 You could do both:

 Make the channel optional. If it's provided, use that and return it. If
 it's not provided, create a new one and use and return that.

 This way the caller gets to decide which they wish to use based on who the
 owner of the channel should be or if the channel should be reused elsewhere.

 For example, for a once-off call, creating s new channel may make more
 sense but if the function is called frequently it might make more sense to
 reuse one channel, especially if this channel is used with other plumbing
 like pub/sub or mult which you would otherwise need to set up every time.


 On Mon, 10 Nov 2014 17:42 Mike Haney txmikes...@gmail.com wrote:

 Eric Normand has an interesting article on this here:
 http://www.lispcast.com/core-async-code-style

 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 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 clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.

  --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 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 clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.




-- 
László Török
Checkout justonemorepoint.com - Know your true value

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
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 clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: On Testing

2014-10-31 Thread László Török
I tweeted recently that I thought that Clojure is super testable, and I
was genuinely surprised about the number of people who disagreed with me.

My 2c.

Without explicitly citing those complaints, it will be difficult to conduct
a meaningful debate.

2014-10-31 14:52 GMT+00:00 Ashton Kemerling ashtonkemerl...@gmail.com:

  I tweeted recently that I thought that Clojure is super testable, and I
 was genuinely surprised about the number of people who disagreed with me.

 There's been a lively discussion about what the best testing frameworks in
 clojure currently are, and what the built in solutions (clojure.test and
 test.check) are lacking. While a lot of people recommend midje or
 expectations, I generally prefer the built in options (no offense to
 contributors of either of those libraries) and usually recommend people
 stick with clojure.test for its lack of magic.

 It's my opinion that these two libraries are largely complete aside from
 some human interface improvements (quality of output for example), but
 clearly not everyone agrees with me.

 So let's talk about what we could add to make the clojure testing
 experience superior compared to other languages.

  --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 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 clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.




-- 
László Török
Checkout justonemorepoint.com - Know your true value

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
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 clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Transducers: Why left to right rather than right to left?

2014-10-30 Thread László Török
Hi,

on transducers generally, watch this
https://www.youtube.com/watch?v=6mTbuzafcII .

This part tackles your questions on ordering
https://www.youtube.com/watch?v=6mTbuzafcII#t=1531 .



2014-10-30 15:44 GMT+00:00 Mars0i marsh...@logical.net:

 Caveat: I am still feeling around in the dark in my understanding of
 transducers.  What I write below may just convey how clueless I am.

 (Meta-caveat: I'm probably spitting into the wind.  I should no doubt use
 my time more wisely.)


 Normal function composition is done starting from the right.  This is
 familiar from mathematics, other Lisps, most languages, and it's how
 Clojure's function application and 'comp' work.

 Sometimes it's easier to understand composition going from left to right,
 as in many natural languages and as in unix pipes, and Clojure provides
 '-' and '-' to do that.  That's good.  Best of both worlds.  One thing I
 like about these operators is that their name clearly indicates the
 direction of function application.

 Transducers allow function composition with potential efficiency gains,
 but apply functions starting from left to right.  But *it does this using
 the name 'comp'*, which otherwise applies functions from right to left.
 What??  Doesn't that seem like a Bad Thing?  Why not use a different name?
 (It's like overloading the minus sign so that in some contexts, it
 subtracts the first argument from the second.)

 (Is Clojure is getting too popular?  Its essential features--prefix
 notation, parentheses, purely functional operations, and laziness--aren't
 doing enough to scare away Java programmers?  :-)

 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 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 clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.




-- 
László Török
Checkout justonemorepoint.com - Know your true value

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
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 clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Expanding The Use Of Transducers To Atoms?

2014-10-27 Thread László Török
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 transformation step in the
watcher function that you attach to the atom/ref/agent.

Having said that, as changes to an atom happen asynchronously, I don't
think that exposing it as lazy-seq is very efficient way of consuming the
values.

However, with the advent of core.async, there is now a very elegant way of
consuming them via a channel and that channel can have a transducer stack
attached (clojure 1.7+), so something along the lines of

(def atom-to-watch (atom 0))

(defn make-watcher [out-ch-with-transducer]
  (fn [x]
(async/put! out-ch-with-transducer x

(def ch (async/chan 100 your-transducer-stack))

(add-watch atom-to-watch (make-watcher ch))

;; somewhere else in your code you can consume the values
(go
  (loop [v (async/! ch)]
   ...
))

Obviously you need to make sure that the values get consumed on the channel
or use a dropping or sliding buffer.

hope this helps,

Las

2014-10-27 5:39 GMT+00:00 Mike Thompson m.l.thompson...@gmail.com:


 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, there is direct support for collections and core.async.  But,
 given the comment above about observables,  this got me to wondering
 about another scenario ...

 I'd like to view an atom's changes in state as a lazy sequence.  The first
 state of the atom is like the first item in the seq, the next time the atom
 changes state, its new state is the second item in the seq is generated,
 etc.  An infinite seq of new states.   (I want to do this in the context of
 clojurescript and a GUI library called reagent.  Think FRP).

 Now imagine that I could attach a transducer to this seq of state changes,
 so that I end up with a modified seq of state changes.

 Now, I can figure out how to do this by gluing together an atom watcher
 with a core.sync channel.  All doable with a small bit of work, I guess.

 But I wondered.  Given the claim above about transducers and how they can
 be used in the case of observables, should this atom-as-seq-with-transducer
 be easier?  Should the IAtom interface or the add-watcher function be
 changed to make this process easier?

 Just a thought.

 --
 Mike


  --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 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 clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.




-- 
László Török
Checkout justonemorepoint.com - Know your true value

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
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 clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ANN] Async Ring 0.1.0

2014-09-09 Thread László Török
There seems to be a
https://github.com/dgrnbrg/async-ring#comparison-with-pedestal section in
the README

2014-09-09 16:34 GMT+01:00 Timothy Baldridge tbaldri...@gmail.com:

 How does this compare/contrast with Pedestal. Seems like there might be
 some overlap here?

 Timothy

 On Tue, Sep 9, 2014 at 9:24 AM, David Greenberg dsg123456...@gmail.com
 wrote:

 Announcing the release of Async Ring! Ring is a great foundation for
 building HTTP servers in Clojure. However, Ring fails to solve many
 problems that high-performance and transactional HTTP servers must solve:


- What does the server do when it can't handle the request rate?
- How can the server dedicate more or fewer resources to different
requests?
- How can long-running HTTP requests be easily developed, without
blocking threads?


 Async Ring attempts to solve these problems by introducing a core.async
 based API that is backwards compatible with Ring and popular Ring servers,
 so that you don't need to rewrite your app to take advantage of these
 techniques.


 Async Ring comes with many features:

- Ports of most ring middleware (just ask me and I'll port your
favorites!)
- Beauty, a compojure  clout compatible concurrent quality-of-server
router
- Integration with Jetty and Http-Kit, more coming
- Documentation and Examples


 Take a look here: https://github.com/dgrnbrg/async-ring

 Feedback and pull requests welcome!

 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 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 clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.




 --
 “One of the main causes of the fall of the Roman Empire was that–lacking
 zero–they had no way to indicate successful termination of their C
 programs.”
 (Robert Firth)

 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 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 clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.




-- 
László Török
Checkout Lollyrewards.com http://www.lollyrewards.com - Giving credit,
getting credit.
Follow us on Twitter @lollyrewards https://twitter.com/lollyrewards
Stay up to date on the latest offers by liking our Facebook page
https://www.facebook.com/lollyrewards.

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
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 clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ANN] Prone: Exception/debugging middleware

2014-09-02 Thread László Török
Fantastic!


2014-09-02 5:35 GMT+01:00 Kurt Schrader kschra...@gmail.com:

 Outstanding work!

 Just plugged it locally and used it to debug a particularly hairy issue on
 my side. This is super useful.

 -Kurt


 On Mon, Sep 1, 2014 at 10:48 PM, James Reeves ja...@booleanknot.com
 wrote:

 This looks rather nice. I'll certainly be trying it out.

 - James


 On 2 September 2014 01:06, Colin Fleming colin.mailingl...@gmail.com
 wrote:

  I don't do any web dev myself, but Prone looks really nice -
 congratulations! Great work.

 Cheers,
 Colin


 On 2 September 2014 02:05, Christian Johansen christ...@cjohansen.no
 wrote:

 Hi,

 Prone (http://clojars.org/prone - http://github.com/magnars/prone) is
 a new middleware for Ring apps that replaces the default exception page
 with an interactive page that presents the exception, stack trace and
 environment data in a more easily understandable way. It can also debug
 arbitrary data, and has a nice little client-side data browser. It's
 intention is to make it a lot easier to find the cause of errors when
 working on Clojure web applications.

 Here's a short video demoing it's use:
 https://dl.dropboxusercontent.com/u/3378230/prone-demo.mp4

 Hope you find it useful!

 Christian

 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 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 clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


  --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 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 clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


  --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 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 clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


  --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 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 clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.




-- 
László Török
Checkout Lollyrewards.com http://www.lollyrewards.com - Giving credit,
getting credit.

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
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 clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ANN] core.async (and more) video tutorials

2014-05-27 Thread László Török
Hi,


 Btw When I click on the download video button, nothing gets downloaded.
 Tried on Firefox/Chrome - Mac. Is that a known issue?

Same here. I could only download the videos I paid for, but not the free
one.


 Also, I had sent you this email via support on that site but didn't get
 any reply,
 so resending it on this thread.

+1



 Thanks a lot.



-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
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 clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Question: defrecord accessor efficiency without protocols

2014-05-16 Thread László Török
Hi,

afaik the Clojure compiler will compile such calls to a direct field
access, i.e. the fastest possible.
This will happen whenever the compiler can infer the type information.
You can facilitate this by using type hints if necessary.

Regards,
Las


2014-05-16 15:44 GMT+01:00 Dave Tenny dave.te...@gmail.com:

 (defrecord Foo [bar])

 (:bar (Foo. 1))

 Is clojure smart enough to make the :bar lookup O(1) as a known field of
 Foo?  Or is it still a map-like O(logN) lookup?


  --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 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 clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.




-- 
László Török
Checkout Lollyrewards.com http://www.lollyrewards.com - Giving credit,
getting credit.
Follow us on Twitter @lollyrewards https://twitter.com/lollyrewards
Stay up to date on the latest offers by liking our Facebook
pagehttps://www.facebook.com/lollyrewards
.

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
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 clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: data associated with a particular state

2014-03-25 Thread László Török
AFAIK the only thing that records do not support compared to StructMaps is
namespaced keyword lookup, i.e. (:some-ns/a-key a-record).

If you do not need this, you should consider using records.

Las

On Tue, Mar 25, 2014 at 4:52 PM, Moritz Ulrich mor...@tarn-vedra.de wrote:

 The data type created by defstruct isn't anything more than a map
 which can store the specified fields a bit more efficient than
 'normal' maps. You can just `assoc' any other key-value pairs as in
 any other map.

 Also, have a look at records - I think StructMaps have been deprecated
 (or at least aren't recommended anymore) for some time now. A record
 (`defrecord') will do pretty much the same, just nicer ;-)

 On Tue, Mar 25, 2014 at 1:51 AM,  cmhowa...@alaska.edu wrote:
  Hi. I'm very new to Clojure, but I've read most of the functional
  programming tutorial http://java.ociweb.com/mark/clojure/article.html.
 
  Suppose I have a data structure called node that can be in one of a
 number
  of different states -- namely, down, waiting, and running. Suppose
  that in the running state, the node has a job-id number associated
 with
  it, but such a number is not applicable in the other two states. Should I
  add an extra field, and only check that field in the running state,
 like
  so...
 
  (defstruct node :state :job-id)
 
  Or is there some better, or more clojure-ish, way to approach this?
 
  If I was doing this in Haskell, I think that I would perhaps make some
 kind
  of algebraic NodeState data type, and have the JobId only attached to
 the
  Running constructor.
 
  --
  You received this message because you are subscribed to the Google
  Groups Clojure group.
  To post to this group, send email to clojure@googlegroups.com
  Note that posts from new members are moderated - please be patient with
 your
  first post.
  To unsubscribe from this group, send email to
  clojure+unsubscr...@googlegroups.com
  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 clojure+unsubscr...@googlegroups.com.
  For more options, visit https://groups.google.com/d/optout.

 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 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 clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
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 clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: STM and persistent data structures performance on mutli-core archs

2014-03-20 Thread László Török
into uses reduce under the hood, you probably need fold to have the
computation to run on FJ:

(def a (time (r/foldcat (r/map #( Math/sin (* % %)) l)


this runs more than 2x as fast on my macbook pro

Las



On Thu, Mar 20, 2014 at 10:34 AM, François Rey fmj...@gmail.com wrote:

  On 20/03/14 04:03, Andy C wrote:

  So, the following test puzzles me. Not because it takes virtually the
 same time (I know that Fork/Join is not cheap and memory is probably the
 biggest bottleneck here). But because I do not get why map (as opposed to
 r/ma) uses all 8 cores on my MacBookPro.  All of them seem to be running
 according to Activity Monitor at more less the same level.

  user= (def l (into [] (range 6000)))
 #'user/l
 user= (time (def a (doall (map #(Math/sin (* % %)) l
 Elapsed time: 19986.18 msecs

 user= (time (def a (doall (into [] (r/map #( Math/sin (* % %)) l)
 Elapsed time: 18980.583 msecs

 I would also expect this code to run on a single CPU at any one time,
 however process/thread scheduling can make this thread run on different
 cores at different times. Depending on the sampling method the activity
 monitor may display another picture of what you would expect. On my linux
 machine, the cpu history graph shows it's using mostly one cpu at any one
 time, but it's not always the same cpu.
 I think the JVM uses all cores by default, and there's no standard way to
 specify thread 
 affinityhttp://stackoverflow.com/questions/2238272/java-thread-affinity
 .


  --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 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 clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.




-- 
László Török
Checkout Lollyrewards.com http://www.lollyrewards.com - Giving credit,
getting credit.
Follow us on Twitter @lollyrewards https://twitter.com/lollyrewards
Stay up to date on the latest offers by liking our Facebook
pagehttps://www.facebook.com/lollyrewards
.

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
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 clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Email delivery libs not working

2014-02-24 Thread László Török
same here, we are using Postal with Mailgun, no issues so far


On Mon, Feb 24, 2014 at 1:42 PM, Dave Della Costa ddellaco...@gmail.comwrote:

 I'm sending authenticated emails via Mandrill with Postal and not having
 any trouble, and setting it up was pretty much a smooth workable
 out-of-the-gate solution.  If you describe the errors or issues you're
 experiencing someone may be able to help, but it's absolutely not the
 case that these libraries don't work.

 (2014/02/24 19:33), The Dude (Abides) wrote:
  Hi, I'm new to clojure and have got a productive handle on CRUD,
  sessions, routing, writing functions. Last couple things are email
  delivery, image processing (resizing).
 
  So I looked on the clojure-toolbox site for email delivery libs with
  smtp authentication for a Mandrill acct fo transactional emails. I've
  used Mandrill in other langs right away zero glitch. Here's the results
  thus far in Clojure as a frame of reference for web domain use 2014:
 
  POSTAL
  https://github.com/drewr/postal#encryption-gmail-example
 
  Doesn't deliver. Tried number of examples in the docs.
 
  MAILER
  https://github.com/clojurewerkz/mailer
 
  Worked briefly, but not via Mandrill, no emails reached there.
  Authentication settings have no impact, uses Postal above lib for
  delivery. Tried number of examples in the docs.
 
  CLJ MAIL
  https://github.com/MayDaniel/clj-mail
 
  Out of date syntax.
 
  I googled and found a couple more in the quest to avoid having to do
  this via java heaven forbid:
 
  MMEmail
 
 http://blog.8thlight.com/micah-martin/2010/04/21/mmemail-my-first-clojure-open-source-contribution.html
 
  Says cannot connect to port 25 although my settings specify port 587 for
  Mandrill
 
  POSTMARK
  http://sjl.bitbucket.org/clojure-postmark/
 
  Transactional email delivery service with a clojure lib. Will create an
  acct in morning and try it out.
 
  Doe anyone know of any other smooth workable out the gate solutions for
  email delivery?
 
  --
  You received this message because you are subscribed to the Google
  Groups Clojure group.
  To post to this group, send email to clojure@googlegroups.com
  Note that posts from new members are moderated - please be patient with
  your first post.
  To unsubscribe from this group, send email to
  clojure+unsubscr...@googlegroups.com
  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 clojure+unsubscr...@googlegroups.com.
  For more options, visit https://groups.google.com/groups/opt_out.

 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 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 clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
László Török

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
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 clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


(go (loop [ ..] (try ... (catch ..)))) won't compile

2014-01-22 Thread László Török
Hi,

I have a processing loop in a go block and I wanted to make sure that the
processing continue with the next iteration if an exception is thrown.

The following code doesn't seem to be accepted by the go macro:

(go
 (loop [xs (range 10)]
   (when-let [x (first xs)]
 (try
   (println x)
   (recur (rest x))
   (catch Throwable t nil)

as it returns IllegalArgumentException No implementation of method:
:emit-instruction of protocol:
#'clojure.core.async.impl.ioc-macros/IEmittableInstruction found for class:
clojure.core.async.impl.ioc_macros.Jmp

I can't think of an alternative right now, any ideas?

-- 
László Török

-- 
-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
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 clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: (go (loop [ ..] (try ... (catch ..)))) won't compile

2014-01-22 Thread László Török
Sorry,

too eager too soon. (loop (try ..) ) obviously doesn't work :)


2014/1/22 László Török ltoro...@gmail.com

 Hi,

 I have a processing loop in a go block and I wanted to make sure that the
 processing continue with the next iteration if an exception is thrown.

 The following code doesn't seem to be accepted by the go macro:

 (go
  (loop [xs (range 10)]
(when-let [x (first xs)]
  (try
(println x)
(recur (rest x))
(catch Throwable t nil)

 as it returns IllegalArgumentException No implementation of method:
 :emit-instruction of protocol:
 #'clojure.core.async.impl.ioc-macros/IEmittableInstruction found for class:
 clojure.core.async.impl.ioc_macros.Jmp

 I can't think of an alternative right now, any ideas?

 --
 László Török




-- 
László Török

-- 
-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
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 clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: (go (loop [ ..] (try ... (catch ..)))) won't compile

2014-01-22 Thread László Török
hi, that's what I ended up doing :)


2014/1/22 James Reeves ja...@booleanknot.com

 Just pull the exception out of the loop logic:

 (go
  (loop [xs (range 10)]
(if-let [x (first xs)]
  (if (= ::error (try (println x) (catch Throwable t ::error)))
(recur (rest x))

 - James


 On 22 January 2014 11:05, László Török ltoro...@gmail.com wrote:

 Hi,

 I have a processing loop in a go block and I wanted to make sure that the
 processing continue with the next iteration if an exception is thrown.

 The following code doesn't seem to be accepted by the go macro:

 (go
  (loop [xs (range 10)]
(when-let [x (first xs)]
  (try
(println x)
(recur (rest x))
(catch Throwable t nil)

 as it returns IllegalArgumentException No implementation of method:
 :emit-instruction of protocol:
 #'clojure.core.async.impl.ioc-macros/IEmittableInstruction found for class:
 clojure.core.async.impl.ioc_macros.Jmp

 I can't think of an alternative right now, any ideas?

 --
 László Török

 --
 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 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 clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


  --
 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 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 clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
László Török

-- 
-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
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 clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: contains? and transient set

2013-12-04 Thread László Török
Hi,

contains? is for checking whether a data structure contains the respective
key.

A more idiomatic way to check whether an element is in the set is

(#{1 2 3} 1)  ;; = returns 1
(#{1 2 3} 0)  ;; = returns nil

works for (transient #{1 2 3}) too.

Las



2013/12/4 Burt burkhardt.r...@googlemail.com

 Does contains? and get not work with transient sets?

 Examples:
 (contains? #{1 2 3} 1)
 ; = true
 (contains? (transient #{1 2 3}) 1)
 ; = IllegalArgumentException contains? not supported on type:
 clojure.lang.PersistentHashSet$TransientHashSet
 (get #{1 2 3} 1)
 ; = 1
 (get (transient #{1 2 3}) 1)
 ; = nil

 How can I check whether an element is contained in a transient set?


  --
 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 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 clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
László Török

-- 
-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
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 clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: contains? and transient set

2013-12-04 Thread László Török
cool! hope the patch is good for 1.6! :)


2013/12/4 Alex Miller a...@puredanger.com

 Both contains? and get should work with transient sets imo.

 This is already in jira: http://dev.clojure.org/jira/browse/CLJ-700.

 Alex

 On Wednesday, December 4, 2013 5:04:40 AM UTC-6, Burt wrote:

 Does contains? and get not work with transient sets?

 Examples:
 (contains? #{1 2 3} 1)
 ; = true
 (contains? (transient #{1 2 3}) 1)
 ; = IllegalArgumentException contains? not supported on type:
 clojure.lang.PersistentHashSet$TransientHashSet
 (get #{1 2 3} 1)
 ; = 1
 (get (transient #{1 2 3}) 1)
 ; = nil

 How can I check whether an element is contained in a transient set?


  --
 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 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 clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
László Török

-- 
-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
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 clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: ANN 2 years of ClojureWerkz

2013-11-20 Thread László Török
Hi Michael,

outstanding work, thanks for taking the lead on this effort and many thanks
to all the contributors.

Las

Sent from my phone
On Nov 20, 2013 12:13 AM, Bruce Durling b...@otfrom.com wrote:

 Michael,

 Congrats and keep on going. I love using your libraries.

 cheers,
 Bruce

 On Tue, Nov 19, 2013 at 11:05 PM, Michael Klishin
 michael.s.klis...@gmail.com wrote:
  A couple of weeks ago ClojureWerkz [1] turned two years old.
  We are at 29 projects (not including failed experiments) and kicking.
 
  There have been dozens of contributors, entire major releases
  brilliantly managed by people outside of our tiny core team,
  and a pretty high bar in project quality sustained [2] [3]. I think it's
  fair to say that there have been positive changes in the overall
  Clojure library ecosystem, hopefully in part due to how vocal we've
  been (102 blog posts on blog.clojurewerkz.org this year alone).
 
  These days many world famous institutions
  and companies we respect use various ClojureWerkz projects
  to power their products and internal tools. Needless to say,
  we did not plan for it in 2011.
 
  So thank you, both users and contributors. There are some new
  projects in the pipeline and our values do not change: documentation,
 sane
  release practices,
  ease of contributing and backwards compatibility. We love all that boring
  stuff.
 
  Here's to another few years!
 
  1. http://clojurewerkz.org
  2.
 
 http://blog.clojurewerkz.org/blog/2013/04/20/how-to-make-your-open-source-project-really-awesome/
  3. http://www.slideshare.net/michaelklishin/open-source-responsibly
  --
  MK
 
  http://github.com/michaelklishin
  http://twitter.com/michaelklishin
 
  --
  --
  You received this message because you are subscribed to the Google
  Groups Clojure group.
  To post to this group, send email to clojure@googlegroups.com
  Note that posts from new members are moderated - please be patient with
 your
  first post.
  To unsubscribe from this group, send email to
  clojure+unsubscr...@googlegroups.com
  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 clojure+unsubscr...@googlegroups.com.
  For more options, visit https://groups.google.com/groups/opt_out.



 --
 @otfrom | CTO  co-founder @MastodonC | mastodonc.com
 See recent coverage of us in the Economist http://econ.st/WeTd2i and
 the Financial Times http://on.ft.com/T154BA

 --
 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 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 clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
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 clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: abysmal multicore performance, especially on AMD processors

2013-11-06 Thread László Török
Hi,

I believe Clojure's original mission has been giving you tools for handling
concurrency[1] in your programs in a sane way.
However, with the advent of Reducers[2], the landscape is changing quite a
bit.
If you're interested in the concurrency vs. parallelism terminology and
what language constructs supporting them are available, [3] should give you
a very good overview.
I understand, I haven't actually answered you're question, but I wasn't
sure whether you're referring to concurrency or parallelism. :)

Las

[1] http://clojure.org/concurrent_programming
[2]
http://clojure.com/blog/2012/05/08/reducers-a-library-and-model-for-collection-processing.html
[3]
http://clojure-doc.org/articles/language/concurrency_and_parallelism.html


2013/11/6 Dave Tenny dave.te...@gmail.com

 As a person who has recently been dabbling with clojure for evaluation
 purposes I wondered if anybody wanted to post some links about parallel
 clojure apps that have been clear and easy parallelism wins for the types
 of applications that clojure was designed for.  (To contrast the lengthy
 discussion and analysis of this topic that is *hopefully* the exception and
 not the rule).

 Any good links here?  Any high profile stuff?



  --
 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 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 clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
László Török

-- 
-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
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 clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: always function?

2013-08-25 Thread László Török
Hi,

(constantly 5)

will return a function that takes any number of args and always returns 5.

See http://clojuredocs.org/clojure_core/clojure.core/constantly.

Las


2013/8/25 Christian Sperandio christian.speran...@gmail.com

 Hi,

 Is there a function builds a function that returns always the same value?

 In coder words, this sort of function:
 (defn always
   [v]
   (fn [ _] v))

 If this function exists already, I prefer use it rather than reinvent the
 wheel :)

 Christian

  --
 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 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 clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
László Török

-- 
-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
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 clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [ANN] Carmine (Redis client) v2, Nippy (serializer) v2 are out

2013-07-22 Thread László Török
Peter this is wonderful, kudos!
I'll give it a spin tonight.

Las

Sent from my phone
On Jul 22, 2013 7:04 PM, Peter Taoussanis ptaoussa...@gmail.com wrote:

 Hey all, quick update: just pushed *Carmine v2.0.0* and *Nippy v2.0.0* to
 Clojars.

 Carmine: GitHub https://github.com/ptaoussanis/carmine | 
 Changeloghttps://github.com/ptaoussanis/carmine/blob/master/CHANGELOG.md| 
 API
 docs http://ptaoussanis.github.io/carmine/ | [com.taousso/carmine
 2.0.0.0]
 Nippy: GitHub https://github.com/ptaoussanis/nippy | 
 Changeloghttps://github.com/ptaoussanis/nippy/blob/master/CHANGELOG.md
  | API docs http://ptaoussanis.github.io/nippy/ | [com.taousso/nippy
  2.0.0.0]

 Thanks to all the folks that helped get these ready. Happy hacking, cheers!

 - Peter Taoussanis (taoensso.com https://www.taoensso.com/)

 --
 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 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 clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
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 clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




clojure 1.5 cheatsheet?

2013-06-24 Thread László Török
Hi,

is there a clojure 1.5 cheatsheet somewhere, the last I could find was 1.4.

Thanks,

-- 
László Török

-- 
-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
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 clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: clojure 1.5 cheatsheet?

2013-06-24 Thread László Török
Thx, i saw that but the page says 1.3 and 1.4 :-)

Sent from my phone
On Jun 24, 2013 6:17 PM, Andy Fingerhut andy.finger...@gmail.com wrote:

 That link is also available near the top of 
 http://clojure.org/cheatsheet(Download other versions with tooltips).

 There are a few things new in 1.5 on the latest version, but I haven't yet
 included any of the new reducers functions there yet.  If anyone has a
 better suggestion for categorizing them, other than simply putting them all
 together into one category together, I am open to suggestions.

 Andy


 On Mon, Jun 24, 2013 at 3:18 AM, terjesb terj...@gmail.com wrote:

 http://jafingerhut.github.io

 kl. 11:38:41 UTC+2 mandag 24. juni 2013 skrev Las følgende:

 Hi,

 is there a clojure 1.5 cheatsheet somewhere, the last I could find was
 1.4.

 Thanks,

 --
 László Török

  --
 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 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 clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




  --
 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 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 clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
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 clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Clojure 1.6 API: clojure.lang.IFn and clojure.api.API

2013-06-24 Thread László Török
Thanks Kevin, it's all clear now.

Sent from my phone
On Jun 24, 2013 6:38 PM, Kevin Downey redc...@gmail.com wrote:

 On 6/24/13 7:53 AM, Jörg Winter wrote:
  Hi Stuart,
 
  ok, so my question is actually more about how to create some clojure
 Runtime, filling it with additional namespaces, i.e. more than just
 clojure.core.
  I just discovered the RT class which could be what I want ( though its
 not official API ?)
 
  I need to make clojure runtime avail. for an IDE plugin, thats the
 background here.
 
  What do you think of Using RT like that ?
  I mean instantiating a clojure environment by RT.doInit maybe
 
  I really dont need to have a REPL for this, as I just want to query for
 functions and vars via API
 
  Best,
  Joerg
 
 the ticket http://dev.clojure.org/jira/browse/CLJ-1188 for API might be
 enlightening. it has some discussion and also links to the design wiki
 page.

 --
 And what is good, Phaedrus,
 And what is not good—
 Need we ask anyone to tell us these things?



-- 
-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
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 clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Clojure 1.6 API: clojure.lang.IFn and clojure.api.API

2013-06-23 Thread László Török
Can you please provide an example for such a usw cause?

Thanks

Las
On Jun 23, 2013 1:38 PM, Stuart Halloway stuart.hallo...@gmail.com
wrote:

 Hi Joerg,

 I am not sure I understand your question. The API class is for
 intraprocess communication, not interprocess.

 All API does is provide a public, supported entry point for the kinds of
 things people are already doing with Var. The latter is undesirable because
 using Var makes it way too easy to marry implementation detail.

 Stu


 On Sat, Jun 22, 2013 at 6:01 AM, Jörg Winter jwin1...@gmail.com wrote:

 So these APIs are new in 1.6-SNAPSHOT and from what I understand provide
 an integration api between Java and Clojure-Runtime (symbols and their
 invocation).
 Apart from limitations which probably exist, what is the mode of
 execution for these API-calls ?

 For example if a tool/IDE starts a (REPL) _process_ by calling
 ClojureUtils.CLOJURE_MAIN, how am I supposed to call

 API.var(clojure.core, +);
 ?

 How would I get the JVMs class-instance of API if I don't add some kind of 
 inter-process communication ?

 Any known projects using this new API already ?

 Joerg



  --
 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 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 clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




  --
 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 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 clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
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 clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: multimethods for non constant values?

2013-06-23 Thread László Török
you need a dispatch functions that produces discrete dispatch values
using your example:

(defmulti x #(cond
   ( % 10) :less-than-10
  ;;... further conditions producing different dispatch
values
))
;; dispatch on the dispatch values
(defmethod x :less-then-10 [x] (do ))

Hope it helps

Las


2013/6/23 Dennis Haupt d.haup...@gmail.com

 i found example that i can do
 (defmethod x 5 [y] (do stuff))

 but can i do
 (defmethod #( % 10) [y] (do stuff)) somehow? like in a pattern match of
 haskell/scala?

 --
 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 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 clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.






-- 
László Török

-- 
-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
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 clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Why does peek on a seq of vector fail?

2013-06-20 Thread László Török
Hi,

I think it's by design.

It only works with concrete data structure (list, vector, queue) types that
implement

clojure.lang.IPersistentStack

Las




2013/6/20 Jason Gilman jason.gil...@gmail.com

 Also, I really appreciate anyone who takes the time to answer. My company
 is currently evaluating Clojure. I'm trying to determine if this is
 non-idiomatic use of the language or some other issue. Doing something like
 this can cause the bug to occur without directly calling seq on a vector:

 (defn bar [my-list n]
   (if (= n 0)
   (peek my-list)
   (bar (rest my-list) (dec n
 (bar [1 2 3] 1)

 Both rest and peek work on a vector without a problem but the combination
 of the two causes problems.

 On Thursday, June 20, 2013 3:54:43 PM UTC-4, Jason Gilman wrote:

 Why does (peek (seq [1])) result in:
 ClassCastException clojure.lang.PersistentVector$**ChunkedSeq cannot be
 cast to clojure.lang.IPersistentStack  clojure.lang.RT.peek (RT.java:634)

 Peek documentation For a list or queue, same as first, for a vector,
 same as, but much more efficient than, last. If the collection is empty,
 returns nil. implies that there shouldn't be a problem working with
 vectors.

 This works without issue:
 (peek [1])

 This is on Clojure 1.5.1

  --
 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 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 clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.






-- 
László Török

-- 
-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
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 clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: cannot import namespace reducers

2013-06-16 Thread László Török
Hi,

there are two ways to deal with this:

a) use Java 7


2013/6/16 Johannes bra...@nordakademie.de

 Hi,

 trying
 (require '[clojure.core.reducers :as r])
 at the repl prompt the error message
 CompilerException java.lang.ClassNotFoundException: jsr166y.ForkJoinPool,
 compiling:(clojure/core/reducers.clj:56:21)

 What is going wrong?

 Johannes


  --
 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 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 clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.






-- 
László Török

-- 
-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
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 clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: cannot import namespace reducers

2013-06-16 Thread László Török
.. sorry, gmail's new annoying keyboard shortcut

b) include the dependency to the forkjoin library [1] that is not included
in Java6

Las

[1] http://mavenhub.com/mvn/central/org.coconut.forkjoin/jsr166y/070108


2013/6/16 László Török ltoro...@gmail.com

 Hi,

 there are two ways to deal with this:

 a) use Java 7


 2013/6/16 Johannes bra...@nordakademie.de

 Hi,

 trying
 (require '[clojure.core.reducers :as r])
 at the repl prompt the error message
 CompilerException java.lang.ClassNotFoundException: jsr166y.ForkJoinPool,
 compiling:(clojure/core/reducers.clj:56:21)

 What is going wrong?

 Johannes


  --
 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 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 clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.






 --
 László Török




-- 
László Török

-- 
-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
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 clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: cannot import namespace reducers

2013-06-16 Thread László Török
(require '[clojure.core.reducers :as r]) is correct.

(:require '[clojure.core.reducers :as r]) only works within the ns macro:
(ns 'yournamespace
  (:require '[clojure.core.reducers :as r]))

Las


2013/6/16 Mayank Jain firesof...@gmail.com

 Try

 (:require '[clojure.core.reducers :as r])


 i.e. :require


 On Mon, Jun 17, 2013 at 1:38 AM, Johannes bra...@nordakademie.de wrote:

 Hi,

 trying
 (require '[clojure.core.reducers :as r])
 at the repl prompt the error message
 CompilerException java.lang.ClassNotFoundException: jsr166y.ForkJoinPool,
 compiling:(clojure/core/reducers.clj:56:21)

 What is going wrong?

 Johannes


  --
 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 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 clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.






 --
 Regards,
 Mayank.

 --
 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 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 clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.






-- 
László Török

-- 
-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
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 clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: cannot import namespace reducers

2013-06-16 Thread László Török
I'm on Java7 and OS X 10.8.4, no problem over here. :)


2013/6/16 Johannes Brauer bra...@nordakademie.de

  thank you, Las, for the quick tip. I will give Java 7 a try. I hope there
 are no problems on Mac OS 10.8.4

  Johannes
  Am 16.06.2013 um 22:15 schrieb László Török ltoro...@gmail.com
 :

  .. sorry, gmail's new annoying keyboard shortcut

  b) include the dependency to the forkjoin library [1] that is not
 included in Java6

  Las

  [1] http://mavenhub.com/mvn/central/org.coconut.forkjoin/jsr166y/070108


 2013/6/16 László Török ltoro...@gmail.com

 Hi,

  there are two ways to deal with this:

  a) use Java 7


 2013/6/16 Johannes bra...@nordakademie.de

 Hi,

  trying
  (require '[clojure.core.reducers :as r])
 at the repl prompt the error message
 CompilerException java.lang.ClassNotFoundException:
 jsr166y.ForkJoinPool, compiling:(clojure/core/reducers.clj:56:21)

  What is going wrong?

  Johannes



  --
 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 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 clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.






   --
 László Török




  --
 László Török

  --
 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 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 clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.





 --


 Staatlich anerkannte private Fachhochschule
 NORDAKADEMIE
 Gemeinnützige Aktiengesellschaft
 Köllner Chaussee 11
 25337 Elmshorn

 Vorstand:
 Prof. Dr. Georg Plate (Vorsitzender), Dipl.-Ing. Jörg Meier (stellv.
 Vorstand)

 Vorsitzender des Aufsichtsrats:
 Dr. h.c. Hans-Heinrich Bruns

 Sitz:
 Elmshorn, Amtsgericht Pinneberg, HRB 1682

   --
 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 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 clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.






-- 
László Török

-- 
-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
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 clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: cannot import namespace reducers

2013-06-16 Thread László Török
are you on clojure 1.5+ ?

If I launch the REPL using lein repl

and then

(require 'clojure.core.reducers)

it works ok for me.


2013/6/16 Johannes Brauer bra...@nordakademie.de

  now, I've Java 7 installed and get another error message:
 Exception namespace 'clojure.core.reducers' not found
  clojure.core/load-lib (core.clj:5380)

  any further hints?

  Johannes
  Am 16.06.2013 um 22:43 schrieb Johannes Brauer bra...@nordakademie.de
 :

  thank you, Las, for the quick tip. I will give Java 7 a try. I hope
 there are no problems on Mac OS 10.8.4

  Johannes
  Am 16.06.2013 um 22:15 schrieb László Török ltoro...@gmail.com
 :

  .. sorry, gmail's new annoying keyboard shortcut

  b) include the dependency to the forkjoin library [1] that is not
 included in Java6

  Las

  [1] http://mavenhub.com/mvn/central/org.coconut.forkjoin/jsr166y/070108


 2013/6/16 László Török ltoro...@gmail.com

 Hi,

  there are two ways to deal with this:

  a) use Java 7


 2013/6/16 Johannes bra...@nordakademie.de

 Hi,

  trying
  (require '[clojure.core.reducers :as r])
 at the repl prompt the error message
 CompilerException java.lang.ClassNotFoundException:
 jsr166y.ForkJoinPool, compiling:(clojure/core/reducers.clj:56:21)

  What is going wrong?

  Johannes



  --
 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 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 clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.






   --
 László Török




  --
 László Török

  --
 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 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 clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.





 --


 Staatlich anerkannte private Fachhochschule
 NORDAKADEMIE
 Gemeinnützige Aktiengesellschaft
 Köllner Chaussee 11
 25337 Elmshorn

 Vorstand:
 Prof. Dr. Georg Plate (Vorsitzender), Dipl.-Ing. Jörg Meier (stellv.
 Vorstand)

 Vorsitzender des Aufsichtsrats:
 Dr. h.c. Hans-Heinrich Bruns

 Sitz:
 Elmshorn, Amtsgericht Pinneberg, HRB 1682


  --
 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 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 clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.





 --


 Staatlich anerkannte private Fachhochschule
 NORDAKADEMIE
 Gemeinnützige Aktiengesellschaft
 Köllner Chaussee 11
 25337 Elmshorn

 Vorstand:
 Prof. Dr. Georg Plate (Vorsitzender), Dipl.-Ing. Jörg Meier (stellv.
 Vorstand)

 Vorsitzender des Aufsichtsrats:
 Dr. h.c. Hans-Heinrich Bruns

 Sitz:
 Elmshorn, Amtsgericht Pinneberg, HRB 1682

   --
 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 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 clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.






-- 
László Török

-- 
-- 
You received this message because you

Re: cannot import namespace reducers

2013-06-16 Thread László Török
Then you are having a path problem.
Your lein is still using java6
Check your $PATH and $JAVA_HOME env. variables.

As this not strictly clojure related, let's not spam the list, im happy to
help off list

Sent from my phone
On Jun 16, 2013 11:22 PM, Johannes Brauer bra...@nordakademie.de wrote:

  I am on clojure 1.5.1 and I use lein repl.

  But after

  (require '[clojure.core.reducers :as r])

  I still get the same error message as with Java 6:
 CompilerException java.lang.ClassNotFoundException: jsr166y.ForkJoinPool,
 compiling:(clojure/core/reducers.clj:56:21)

  A second input of
 (require '[clojure.core.reducers :as r])

  generates the message:
 Exception namespace 'clojure.core.reducers' not found
  clojure.core/load-lib (core.clj:5380)

  Johannes

  Am 16.06.2013 um 23:16 schrieb László Török ltoro...@gmail.com
 :

  are you on clojure 1.5+ ?

  If I launch the REPL using lein repl

  and then

  (require 'clojure.core.reducers)

  it works ok for me.


 2013/6/16 Johannes Brauer bra...@nordakademie.de

 now, I've Java 7 installed and get another error message:
 Exception namespace 'clojure.core.reducers' not found
  clojure.core/load-lib (core.clj:5380)

  any further hints?

  Johannes
   Am 16.06.2013 um 22:43 schrieb Johannes Brauer bra...@nordakademie.de
 :

  thank you, Las, for the quick tip. I will give Java 7 a try. I hope
 there are no problems on Mac OS 10.8.4

  Johannes
  Am 16.06.2013 um 22:15 schrieb László Török ltoro...@gmail.com
 :

  .. sorry, gmail's new annoying keyboard shortcut

  b) include the dependency to the forkjoin library [1] that is not
 included in Java6

  Las

  [1] http://mavenhub.com/mvn/central/org.coconut.forkjoin/jsr166y/070108


 2013/6/16 László Török ltoro...@gmail.com

 Hi,

  there are two ways to deal with this:

  a) use Java 7


 2013/6/16 Johannes bra...@nordakademie.de

 Hi,

  trying
  (require '[clojure.core.reducers :as r])
 at the repl prompt the error message
 CompilerException java.lang.ClassNotFoundException:
 jsr166y.ForkJoinPool, compiling:(clojure/core/reducers.clj:56:21)

  What is going wrong?

  Johannes



  --
 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 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 clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.






   --
 László Török




  --
 László Török

  --
 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 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 clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.





 --


 Staatlich anerkannte private Fachhochschule
 NORDAKADEMIE
 Gemeinnützige Aktiengesellschaft
 Köllner Chaussee 11
 25337 Elmshorn

 Vorstand:
 Prof. Dr. Georg Plate (Vorsitzender), Dipl.-Ing. Jörg Meier (stellv.
 Vorstand)

 Vorsitzender des Aufsichtsrats:
 Dr. h.c. Hans-Heinrich Bruns

 Sitz:
 Elmshorn, Amtsgericht Pinneberg, HRB 1682


  --
 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 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 clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.





 --


 Staatlich anerkannte private Fachhochschule
 NORDAKADEMIE
 Gemeinnützige Aktiengesellschaft
 Köllner Chaussee 11
 25337 Elmshorn

 Vorstand:
 Prof. Dr. Georg Plate (Vorsitzender), Dipl.-Ing. Jörg Meier (stellv.
 Vorstand)

 Vorsitzender des Aufsichtsrats:
 Dr. h.c. Hans-Heinrich

Re: Looking for Clojure freelancers

2013-06-03 Thread László Török
Hi Peter,

I might be interested. I am a PhD candidate in Munich, where are you based?

Regards,

Laszlo Török


2013/6/3 Peter Taoussanis ptaoussa...@gmail.com

 Hi all,

 From time to time I have need for one or two extra hands (or, would that
 be pairs of hands?) on larger projects. Specifically, am looking for
 Clojure developers that'd be interested in occasional adhoc/freelance
 development work.

 Most of my work is on the web application side, but it can vary.

 What I'd like to ask is this: if anyone's interested, drop me an email 
 (*ptaoussanis
 at taoensso.com*) with some basic info including:

- Contact details (would prefer an international telephone number also
if possible).
- Your experience / informal CV (open-source stuff is my preferred
reference, especially if it's Clojure-based).
- Any particular areas of interest/expertise (e.g. you especially want
to work with Datomic, backend services, Clojurescript, whatever).
- Your rate + how negotiable it'd be and/or how it'd scale with
longer-term jobs.

 I can then keep your details on file and give an occasional shout if
 something comes up that I could potentially use you for.

 Whole thing'd be about as informal as it gets: terms will vary based on
 the particular job, but I'll include all of that in the email so you can
 decide if/when something grabs your fancy.

 Cheers!

 - Peter (taoensso.com https://www.taoensso.com)

 --
 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 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 clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.






-- 
László Török

-- 
-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
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 clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Looking for Clojure freelancers

2013-06-03 Thread László Török
Damn Gmail, sorry this was not meant for the list.


2013/6/3 László Török ltoro...@gmail.com

 Hi Peter,

 I might be interested. I am a PhD candidate in Munich, where are you based?

 Regards,

 Laszlo Török


 2013/6/3 Peter Taoussanis ptaoussa...@gmail.com

 Hi all,

 From time to time I have need for one or two extra hands (or, would that
 be pairs of hands?) on larger projects. Specifically, am looking for
 Clojure developers that'd be interested in occasional adhoc/freelance
 development work.

 Most of my work is on the web application side, but it can vary.

 What I'd like to ask is this: if anyone's interested, drop me an email 
 (*ptaoussanis
 at taoensso.com*) with some basic info including:

- Contact details (would prefer an international telephone number
also if possible).
- Your experience / informal CV (open-source stuff is my preferred
reference, especially if it's Clojure-based).
- Any particular areas of interest/expertise (e.g. you especially
want to work with Datomic, backend services, Clojurescript, whatever).
- Your rate + how negotiable it'd be and/or how it'd scale with
longer-term jobs.

 I can then keep your details on file and give an occasional shout if
 something comes up that I could potentially use you for.

 Whole thing'd be about as informal as it gets: terms will vary based on
 the particular job, but I'll include all of that in the email so you can
 decide if/when something grabs your fancy.

 Cheers!

 - Peter (taoensso.com https://www.taoensso.com)

 --
 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 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 clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.






 --
 László Török




-- 
László Török

-- 
-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
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 clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Problem seting up ritz nrepl in emacs

2013-06-03 Thread László Török
Hi,

I think ac-nrepl doesn't play nice with ritz, try disabling it.

Las

Sent from my phone
On Jun 3, 2013 5:28 PM, Novi Border novibor...@gmail.com wrote:

 Hi

 I am currently developing clojure in sublime text, and have tried eclipse
 before, but I would like to switch to emacs for all the goodies it brings.
 I have followed a number of tutorials for seting up emacs enviroment but I
 can't get the ritz debuger to work.

 I allways get the following error after nrepl-ritz-jack-in

 java.io.FileNotFoundException: Could not locate complete/core__init.class
 or complete/core.clj on classpath:
  at clojure.lang.RT.load (RT.java:443)
 clojure.lang.RT.load (RT.java:411)
 clojure.core$load$fn__5018.invoke (core.clj:5530)
 clojure.core$load.doInvoke (core.clj:5529)
 clojure.lang.RestFn.invoke (RestFn.java:408)
 clojure.core$load_one.invoke (core.clj:5336)
 clojure.core$load_lib$fn__4967.invoke (core.clj:5375)
 clojure.core$load_lib.doInvoke (core.clj:5374)
 clojure.lang.RestFn.applyTo (RestFn.java:142)
 clojure.core$apply.invoke (core.clj:619)
 clojure.core$load_libs.doInvoke (core.clj:5413)
 clojure.lang.RestFn.applyTo (RestFn.java:137)
 clojure.core$apply.invoke (core.clj:619)
 clojure.core$require.doInvoke (core.clj:5496)
 clojure.lang.RestFn.invoke (RestFn.java:408)
 user$eval2549.invoke (SOURCE_FORM_4:1)
 clojure.lang.Compiler.eval (Compiler.java:6619)
 clojure.lang.Compiler.eval (Compiler.java:6582)
 clojure.core$eval.invoke (core.clj:2852)
 ritz.repl_utils.compile$eval_region.invoke (compile.clj:55)
 ritz.nrepl.middleware.tracking_eval$evaluate$fn__2006.invoke
 (tracking_eval.clj:51)
 clojure.lang.AFn.applyToHelper (AFn.java:159)
 clojure.lang.AFn.applyTo (AFn.java:151)
 clojure.core$apply.invoke (core.clj:617)
 clojure.core$with_bindings_STAR_.doInvoke (core.clj:1788)
 clojure.lang.RestFn.invoke (RestFn.java:425)
 ritz.nrepl.middleware.tracking_eval$evaluate.invoke
 (tracking_eval.clj:48)
 ritz.nrepl.middleware.tracking_eval$eval_reply$fn__2020.invoke
 (tracking_eval.clj:89)
 clojure.core$comp$fn__4154.invoke (core.clj:2330)

 clojure.tools.nrepl.middleware.interruptible_eval$run_next$fn__913.invoke
 (interruptible_eval.clj:138)
 clojure.lang.AFn.run (AFn.java:24)
 java.util.concurrent.ThreadPoolExecutor.runWorker
 (ThreadPoolExecutor.java:1145)
 java.util.concurrent.ThreadPoolExecutor$Worker.run
 (ThreadPoolExecutor.java:615)
 java.lang.Thread.run (Thread.java:722)


 I am using stock ubuntu version of emacs (24) and have installed the
 following packages (tried both marmelade and melpa and the error persists).
 I have installed ac-nrepl, nrepl, nrepl-ritz, clojure-more,
 rainbow-delimiters, starterkit and paredit.

 I have leiningen 2.1.3 installed. I have tried lein clean on the project
 btw..

 This is my profiles.clj:

 {:user {:dependencies [[org.clojure/tools.namespace 0.2.3]
[spyscope 0.1.3]
[criterium 0.4.1]
[ritz/ritz-nrepl-middleware 0.7.0]]
 :injections [(require '(clojure.tools.namespace repl find))
  ; try/catch to workaround an issue where `lein repl`
 outside a project dir
  ; will not load reader literal definitions correctly:
  (try (require 'spyscope.core)
(catch RuntimeException e))]
 :plugins [[lein-pprint 1.1.1]
   [lein-beanstalk 0.2.6]
   [lein-clojars 0.9.1]
   [lein-create-template 0.1.1]
   [lein-marginalia 0.7.1]
   [lein-ritz 0.7.0]
   [lein-midje 3.0.0]]}
 :repl-options {:nrepl-middleware
  [ritz.nrepl.middleware.javadoc/wrap-javadoc

 ritz.nrepl.middleware.simple-complete/wrap-simple-complete]}}

 In the project I use clojure 1.5.1.

 BR




  --
 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 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 clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to

Re: Problem seting up ritz nrepl in emacs

2013-06-03 Thread László Török
 members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+u...@**googlegroups.com

 For more options, visit this group at
 http://groups.google.com/**group/clojure?hl=enhttp://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 clojure+u...@**googlegroups.com.

 For more options, visit 
 https://groups.google.com/**groups/opt_outhttps://groups.google.com/groups/opt_out
 .



  --
 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 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 clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




  --
 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 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 clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.






-- 
László Török

-- 
-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
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 clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [ANN] Leiningen 2.2.0 released

2013-05-29 Thread László Török
This amazing! Thanks everyone who contributed!

Sent from my phone
On May 29, 2013 7:37 PM, Phil Hagelberg p...@hagelb.org wrote:


 Greetings fellow humans.

 I'm happy to announce the release of Leiningen 2.2.0. Notable new
 features include support for -javaagent, (used for certain VM-level
 instrumentation tools) and the ability to deploy arbitrary files from
 the filesystem rather than just project artifacts.

 There are a couple changes to watch out for. Firstly, the repl task no
 longer bundles the clojuredocs client. You can add it back in with the
 :dev profile, but keeping it out by default sidesteps a number of
 confusing dependency conflicts (in particular Jackson and the Apache
 HTTP Client) which only manifest in the repl task.

 The target directory is now scoped by profile sets, which means that
 things like class files produced by one set of profiles won't be visible
 to task runs with different profiles. This should mean fewer cases in
 which you need to run `lein clean` to fix things.

 The `uberjar` task now applies its own profile, so if you have something
 like a `:main` entry which is only needed for uberjars you can put it
 there in order to avoid having AOT in your regular development cycle.

 More changes:
https://github.com/technomancy/leiningen/blob/e4b66b2/NEWS.md

 As usual, running `lein upgrade` should get you to the latest, though
 there's a bug in older versions where you might have to run it twice to
 get 2.2.0.

 Enjoy!

 -Phil

-- 
-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
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 clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [ANN] http-kit 2.0.0 released

2013-05-03 Thread László Török
Hi,

regarding the perf. improvements, is it client or server?

Thx

Las


2013/5/3 Michael Klishin michael.s.klis...@gmail.com


 2013/5/3 Feng Shen shen...@gmail.com

 Compare to 2.0.0, noticeable changes:

1. Much faster: about 30%~80% faster.
2. The client support HTTPS now
3. :as option to do client output coercion

 Not that noticeable changes:

1. few minor bugs fixes
2. less RAM usage

 The full update log:
 https://github.com/http-kit/http-kit/blob/master/history.md


 I'd highly recommend starting a new thread for each new version.
 Also, your change log is in chronological order. Keeping it in
 reverse chronological order (2.1.0 first) would make it much easier
 to quickly discover recent changes.

 Good job on the performance improvements!
 --
 MK

 http://github.com/michaelklishin
 http://twitter.com/michaelklishin

 --
 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 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 clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.






-- 
László Török

-- 
-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
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 clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [ANN] Prismatic's Plumbing/Graph 0.1.0 is released with huge performance improvements

2013-05-02 Thread László Török
Hi,

First all congratulations to the new release!

Looking at the change log, I'm not sure I understand the following:
Explicit output-schema metadata on a fnk is taken as gold, rather than
being merged with explicit data by analyzing the fnk body, and must be
explicit rather than a spec
Thx

Sent from my phone
On May 1, 2013 8:46 PM, Jason Wolfe ja...@w01fe.com wrote:

Version 0.1.0 of Prismatic's Plumbing/Graph has just been released.

The biggest change is backwards-compatible performance improvements of up
to 40x for eager compilation, brining Graph to within 20% or so of
hand-coded performance for trivial node functions.  This was work done by
Leon Barrett on a 'sprintbatical' from the Climate Corp, and he's written a
great blog post about the update [1].  There are also a handful of small
changes and improvements described in the changelog [2].

We've also created a mailing list for Plumbing/Graph [3], so feel free to
ask/answer questions, discuss feature requests/bugs, and generally talk
about how you are or would like to use Plumbing/Graph there.

Cheers,
Jason

[1]
http://blog.getprismatic.com/blog/2013/5/1/graph-faster-abstractions-for-structured-computation
[2] https://github.com/Prismatic/plumbing/blob/v0.1.0/CHANGELOG.md
[3] https://groups.google.com/forum/#!forum/prismatic-plumbing

-- 
-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with
your first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
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 clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

-- 
-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
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 clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [ANN] Prismatic's Plumbing/Graph 0.1.0 is released with huge performance improvements

2013-05-02 Thread László Török
Hi,

 Does this make more sense?
Yes, it's all clear now. :)

 Do you forsee running into any issues with this change?
NATM.

thx

Las


2013/5/2 Jason Wolfe ja...@w01fe.com

 Yes, I suppose that's not very clear.

 Fnk attempts to guess the output schema of your function by looking at the
 body -- if the return value has literal map structure, this is
 automatically taken as the output schema.  Since this analysis is fragile
 (maps are created programatically, within a let, by a delegate fn, etc),
 you can also provide explicit ^:output-schema metadata on the argument
 vector of the fnk.

 The previous version of plumbing attempted to be smart and 'merge' these
 two sources of schema data.  Your explicit schema could provide additional
 details about structure, but  if it contradicted the literal map structure
 an exception was thrown.  Unfortunately, this required calling 'eval' on
 the explicit output schema so that it could be analyzed at compile time, in
 the case that it was itself not literal.  We decided that this was a bad
 idea, so now when you pass ^:output-schema metadata it's directly used as
 the output-schema rather than trying to reconcile with the fnk body,
 obviating the need for 'eval'.  Moreover, there used to be a special
 shortcut syntax that could be used in ^:output-schema, which was
 undocumented -- this has been removed, so ^:output-schema needs to be an
 actual schema.

 Does this make more sense?  Do you forsee running into any issues with
 this change?

 Thanks,
 Jason

 On Thursday, May 2, 2013 12:22:07 AM UTC-7, Las wrote:

 Hi,

 First all congratulations to the new release!

 Looking at the change log, I'm not sure I understand the following:
 Explicit output-schema metadata on a fnk is taken as gold, rather than
 being merged with explicit data by analyzing the fnk body, and must be
 explicit rather than a spec
 Thx

 Sent from my phone
 On May 1, 2013 8:46 PM, Jason Wolfe ja...@w01fe.com wrote:

 Version 0.1.0 of Prismatic's Plumbing/Graph has just been released.

 The biggest change is backwards-compatible performance improvements of up
 to 40x for eager compilation, brining Graph to within 20% or so of
 hand-coded performance for trivial node functions.  This was work done by
 Leon Barrett on a 'sprintbatical' from the Climate Corp, and he's written a
 great blog post about the update [1].  There are also a handful of small
 changes and improvements described in the changelog [2].

 We've also created a mailing list for Plumbing/Graph [3], so feel free to
 ask/answer questions, discuss feature requests/bugs, and generally talk
 about how you are or would like to use Plumbing/Graph there.

 Cheers,
 Jason

 [1] http://blog.getprismatic.com/**blog/2013/5/1/graph-faster-**
 abstractions-for-structured-**computationhttp://blog.getprismatic.com/blog/2013/5/1/graph-faster-abstractions-for-structured-computation
 [2] 
 https://github.com/Prismatic/**plumbing/blob/v0.1.0/**CHANGELOG.mdhttps://github.com/Prismatic/plumbing/blob/v0.1.0/CHANGELOG.md
 [3] 
 https://groups.google.com/**forum/#!forum/prismatic-**plumbinghttps://groups.google.com/forum/#!forum/prismatic-plumbing

 --
 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clo...@googlegroups.com

 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+u...@**googlegroups.com

 For more options, visit this group at
 http://groups.google.com/**group/clojure?hl=enhttp://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 clojure+u...@**googlegroups.com.

 For more options, visit 
 https://groups.google.com/**groups/opt_outhttps://groups.google.com/groups/opt_out
 .



  --
 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 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 clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.






-- 
László Török

-- 
-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure

Re: Reducers newbie question

2013-04-26 Thread László Török
Hi,

Not sure what you are trying to do, but xxx is a lazy seq, thus it can only
be consumed sequentially and fold falls back to reduce

You need a vector.

Las

Sent from my phone
On Apr 26, 2013 4:46 PM, Stanislav Yurin jusk...@gmail.com wrote:

 I was assuming that following code will fold in parallel, but it is
 reduced sequentially

 (require '[clojure.core.reducers :as r])
 (defn test1
 [x]
 (Thread/sleep 1000)
 (println (str Finished: x))
 x)
 (def xxx (r/map test1 (range 100)))
 (r/fold + xxx)

 What am I doing wrong?
 Thanks.

 --
 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 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 clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
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 clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Prismatic Plumbing and Graph Open-Source Release

2013-02-07 Thread László Török
+1, was also wondering

2013/2/7 Valentin Golev m...@valyagolev.net

 Graph definitions really remind me of `do` syntax in Haskell, where you
 can bind values and then use them in later steps of the computation.


 On Tuesday, January 29, 2013 10:46:54 PM UTC+4, Aria Haghighi wrote:

 Hey all,

  Prismatic has open-sourced our Plumbing and Graph library on 
 githubhttps://github.com/prismatic/plumbing.
 Jason Wolfe gave a 
 talkhttp://blog.getprismatic.com/blog/2012/10/1/prismatics-graph-at-strange-loop.htmlabout
  how we use graph for systems composition at Strange loop last year.
 Please give the library
 a whirl and let us know if you're using it and if you find any issues or
 feature requests. We use this library very heavily throughout our code and
 hope others find it useful as well.

  Best, Aria

  --
 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 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 clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.






-- 
László Török

-- 
-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
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 clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Prismatic Plumbing and Graph Open-Source Release

2013-02-06 Thread László Török
Hi,

Good stuff! I was wondering how do you guys deal with decision nodes or
does is make sense to model such a thing at the nodel level.

Imagine having a diamond topology e.g.
N1
   /\
  N2aN2b
   \/
N3

based on some input to N1, either N2a or N2b gets computed on which N3
depends.

Does this make sense or should this decision step be wrapped in a node
N2.

Thanks,

Las

2013/1/29 Aria Haghighi m...@aria42.com

 Hey all,

  Prismatic has open-sourced our Plumbing and Graph library on 
 githubhttps://github.com/prismatic/plumbing.
 Jason Wolfe gave a 
 talkhttp://blog.getprismatic.com/blog/2012/10/1/prismatics-graph-at-strange-loop.htmlabout
  how we use graph for systems composition at Strange loop last year.
 Please give the library
 a whirl and let us know if you're using it and if you find any issues or
 feature requests. We use this library very heavily throughout our code and
 hope others find it useful as well.

  Best, Aria

 --
 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 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 clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.






-- 
László Török

-- 
-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
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 clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: is intellij idea a good ide for clojure development?

2013-01-29 Thread László Török
+1 emacs live

Id seriously discourage any Emacs newbie trying vanilla Emacs for Clojure
development.

Here, I'd also like to express my greatest appreciation to the creators for
publishing and maintaining it.

Las
Sent from my phone
On Jan 29, 2013 7:48 PM, Jay Fields j...@jayfields.com wrote:

 I use it for Clojure, html, css,  js - no sql tho, so I can't comment
 on that. Otherwise, everything is great.

 I use emacs-live, which you can add to a vanilla emacs install and get
 right started. All you need to nrepl-jack-in.

 On Tue, Jan 29, 2013 at 1:21 PM, Josh Kamau joshnet2...@gmail.com wrote:
  Question: Is this emacs also good in other stuff such as
  javascript/css/html/sql  Most of my projects involve writing this as
  well .   Does anyone have a link to an up to date instructions on how to
  setup emacs for clojure ? most of what i find are out of date... e.g some
  talk of swank-clojure and i read somewhere that i should use nRepl or
  something like that.
 
  regards.
  Josh.
 
 
  On Tue, Jan 29, 2013 at 9:17 PM, Jay Fields j...@jayfields.com wrote:
 
  Rich, almost all keystrokes have names you can use from M-x - if you
  prefer that to keystrokes.
 
  On Tue, Jan 29, 2013 at 11:59 AM, Rich Morin r...@cfcl.com wrote:
   On Jan 29, 2013, at 08:50, Dennis Haupt wrote:
   i don't know emacs, so i would like to know as well what the killer
   features
   are that make you more productive with emacs
  
   Me two.  More generally, I'm interested in features that DON'T require
   filling
   my head with zillions of obscure key sequences.
  
   -r
  
--
   http://www.cfcl.com/rdmRich Morin
   http://www.cfcl.com/rdm/resume r...@cfcl.com
   http://www.cfcl.com/rdm/weblog +1 650-873-7841
  
   Software system design, development, and documentation
  
  
   --
   --
   You received this message because you are subscribed to the Google
   Groups Clojure group.
   To post to this group, send email to clojure@googlegroups.com
   Note that posts from new members are moderated - please be patient
 with
   your first post.
   To unsubscribe from this group, send email to
   clojure+unsubscr...@googlegroups.com
   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 clojure+unsubscr...@googlegroups.com.
   For more options, visit https://groups.google.com/groups/opt_out.
  
  
 
  --
  --
  You received this message because you are subscribed to the Google
  Groups Clojure group.
  To post to this group, send email to clojure@googlegroups.com
  Note that posts from new members are moderated - please be patient with
  your first post.
  To unsubscribe from this group, send email to
  clojure+unsubscr...@googlegroups.com
  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 clojure+unsubscr...@googlegroups.com.
  For more options, visit https://groups.google.com/groups/opt_out.
 
 
 
  --
  --
  You received this message because you are subscribed to the Google
  Groups Clojure group.
  To post to this group, send email to clojure@googlegroups.com
  Note that posts from new members are moderated - please be patient with
 your
  first post.
  To unsubscribe from this group, send email to
  clojure+unsubscr...@googlegroups.com
  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 clojure+unsubscr...@googlegroups.com.
  For more options, visit https://groups.google.com/groups/opt_out.
 
 

 --
 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 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 clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To 

Re: Prismatic Plumbing and Graph Open-Source Release

2013-01-29 Thread László Török
Graph was THE library I've been waiting for to be open sourced!

Yay, thanks!

Las

Sent from my phone
On Jan 29, 2013 7:57 PM, Aria Haghighi m...@aria42.com wrote:

 Hey all,

  Prismatic has open-sourced our Plumbing and Graph library on 
 githubhttps://github.com/prismatic/plumbing.
 Jason Wolfe gave a 
 talkhttp://blog.getprismatic.com/blog/2012/10/1/prismatics-graph-at-strange-loop.htmlabout
  how we use graph for systems composition at Strange loop last year.
 Please give the library
 a whirl and let us know if you're using it and if you find any issues or
 feature requests. We use this library very heavily throughout our code and
 hope others find it useful as well.

  Best, Aria

 --
 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 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 clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
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 clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Is there a better way to update a map atom?

2013-01-21 Thread László Török
How about

(swap! game-objects (fn [objects] (into {} (for [[k v] objects] [k (apply f
v args)])))

?

For large maps, it will use a transient map and assoc! instead of assoc,
that may result in a speedup.

Laszlo

2013/1/22 Stephen Compall stephen.comp...@gmail.com

 On Jan 21, 2013 3:28 PM, Jim - FooBar(); jimpil1...@gmail.com wrote:
  ...or you can go all the way, skipping reset! completely:
 
  (swap! game-objects (fn [objects] (reduce-kv #(assoc % %2 (update-object
 %3)) {} objects) ))

 Which also has the benefit of being safe, unlike any reset!-based update.

 --
 Stephen Compall
 If anyone in the MSA is online, you should watch this flythrough.

 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en




-- 
László Török

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: core/group-by with optional value-mapper function

2012-12-17 Thread László Török
]}

 It would be so cool to have this in the core. What do you guys think?

 Regards,
 Daniel Dinnyes

  --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clo...@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+u...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/**group/clojure?hl=enhttp://groups.google.com/group/clojure?hl=en


  --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en




-- 
László Török

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Little namespace question

2012-12-17 Thread László Török
Try (in-ns 'user-ns)

Las
On Dec 18, 2012 7:50 AM, Alan Shaw noden...@gmail.com wrote:

 user= *ns*
 #Namespace user
 user= (def user-ns *ns*)
 #'user/user-ns
 user= user-ns
 #Namespace user
 user= (in-ns user-ns)
 ClassCastException clojure.lang.Namespace cannot be cast to
 clojure.lang.Symbol  clojure.lang.RT$1.invoke (RT.java:226)

 It appears I'm not understanding how namespaces are represented.

 Also, is it just wrong of me to want to remember a namespace I was working
 in and try to go back to it later?

 The slightly larger context is: I'm saving an s-expression with
 unqualified names in it into a file as a string. Also saving a string
 indicating the name of the environment in which that string should be (read
 and) eval'ed so that the names will resolve to the appropriate functions.
 Advice on managing this would be appreciated.

 -Alan Shaw

  --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 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 post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Little namespace question

2012-12-17 Thread László Török
ah, sorry, it's a bit early for me

(in-ns (ns-name user-ns))

if you could post a simple example for the second part of your question I
maybe able to help.

Las

Alan Shaw 2012. december 18., kedd napon a következőt írta:

 Ah no, that puts me in a new user-ns namespace! Not what I wanted!


 On Mon, Dec 17, 2012 at 10:51 PM, László Török 
 ltoro...@gmail.comjavascript:_e({}, 'cvml', 'ltoro...@gmail.com');
  wrote:

 Try (in-ns 'user-ns)

 Las
 On Dec 18, 2012 7:50 AM, Alan Shaw noden...@gmail.comjavascript:_e({}, 
 'cvml', 'noden...@gmail.com');
 wrote:

  user= *ns*
 #Namespace user
 user= (def user-ns *ns*)
 #'user/user-ns
 user= user-ns
 #Namespace user
 user= (in-ns user-ns)
 ClassCastException clojure.lang.Namespace cannot be cast to
 clojure.lang.Symbol  clojure.lang.RT$1.invoke (RT.java:226)

 It appears I'm not understanding how namespaces are represented.

 Also, is it just wrong of me to want to remember a namespace I was
 working in and try to go back to it later?

 The slightly larger context is: I'm saving an s-expression with
 unqualified names in it into a file as a string. Also saving a string
 indicating the name of the environment in which that string should be (read
 and) eval'ed so that the names will resolve to the appropriate functions.
 Advice on managing this would be appreciated.

 -Alan Shaw

  --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to 
 clojure@googlegroups.comjavascript:_e({}, 'cvml', 
 'clojure@googlegroups.com');
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com javascript:_e({}, 'cvml',
 'clojure%2bunsubscr...@googlegroups.com');
 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 post to this group, send email to 
 clojure@googlegroups.comjavascript:_e({}, 'cvml', 
 'clojure@googlegroups.com');
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com javascript:_e({}, 'cvml',
 'clojure%2bunsubscr...@googlegroups.com');
 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 post to this group, send email to 
 clojure@googlegroups.comjavascript:_e({}, 'cvml', 
 'clojure@googlegroups.com');
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com javascript:_e({}, 'cvml',
 'clojure%2bunsubscr...@googlegroups.com');
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en



-- 
László Török

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Meaning of =

2012-12-11 Thread László Török
Hi,

Equality is never subjective. There maybe different equality relations
defined. In most cases (integer) one os well served by intuition.
In other cases (clojure's =) the definition may not be intuitive, but never
subjective.
On Dec 12, 2012 12:32 AM, Raoul Duke rao...@gmail.com wrote:

 one of the things which seem to be true but nowhere completely
 successfully fleshed out is the fact that equality is very
 subjective. there can and should be many different ways to pose and
 answer the question a == b.

 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 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 post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Meaning of =

2012-12-11 Thread László Török
Great paper btw!
On Dec 12, 2012 12:42 AM, Phil Hagelberg p...@hagelb.org wrote:

 On Tue, Dec 11, 2012 at 3:32 PM, Raoul Duke rao...@gmail.com wrote:
  one of the things which seem to be true but nowhere completely
  successfully fleshed out is the fact that equality is very
  subjective. there can and should be many different ways to pose and
  answer the question a == b.

 There is a very good explanation of an objective equality predicate in
 Henry Baker's Equal Rights for Functional Objects paper:
 http://home.pipeline.com/~hbaker1/ObjectIdentity.html

 Anyone interested in equality, FP, or why CL and Elisp are so annoying
 to work with should read this paper. Keep in mind that Clojure cheats
 in a few places in the name of convenience and doesn't quite implement
 what he's described though.

 -Phil

 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 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 post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: group-by vs. reducers?

2012-12-07 Thread László Török
 
 insight.

 After spending a few hours with it, I'm still pretty much clueless, so
 hope to find someone here to help me out:

 So if I understood the reducer lingo introduced in [2],[3] and group-by
 correctly, it reduces the following reducing function on a collection

 (fn group-by-reducef [keyfn ret x]
  (let [k (keyfn x)]
 (assoc ret k (conj (get ret k []) x

 where keyfn is provided by a partial function application.

 fold needs a combining function that takes two result maps that have
 already been grouped and merges them.
 A naive implementation could look like

 (defn group-by-combinef
   ([] {})
   ([g1 g2]
  (persistent!
   (reduce (fn [res k v]
 (assoc! res k (into (get res k []) v)))
   (transient g1) g2

 (defn group-by [f coll]
   (fold (partial gr-by-reducef f) gr-by-combinef coll))

 Now couple of questions:
 1) I expected fold to actually perform the operation, how can I force
 it to give me the result?
 2) Can somehow the actual reducing at the leaf nodes still take
 advantage of transient collections?
 3) I took a look at flatten as it seems the closest match. Again, if
 I call (flatten [[1 2] [2 4]]), I don't actually get the result. How do I
 get to the result?


 Thanks!

 [1] https://github.com/**clojure/clojure/blob/master/**
 src/clj/clojure/core/reducers.**cljhttps://github.com/clojure/clojure/blob/master/src/clj/clojure/core/reducers.clj
 [2] http://clojure.com/blog/**2012/05/08/reducers-a-library-**
 and-model-for-collection-**processing.htmlhttp://clojure.com/blog/2012/05/08/reducers-a-library-and-model-for-collection-processing.html
 [3] 
 http://clojure.com/blog/**2012/05/15/anatomy-of-reducer.**htmlhttp://clojure.com/blog/2012/05/15/anatomy-of-reducer.html
 --
 László Török

   --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en




 --
 On Clojure http://clj-me.cgrand.net/
 Clojure Programming http://clojurebook.com
 Training, Consulting  Contracting http://lambdanext.eu/

  --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en




-- 
László Török

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

group-by vs. reducers?

2012-12-03 Thread László Török
Hi,

As I was trying to wrap my head around the reducers library[1], I thought
implementing group-by would be a good exercise to gain some insight.

After spending a few hours with it, I'm still pretty much clueless, so hope
to find someone here to help me out:

So if I understood the reducer lingo introduced in [2],[3] and group-by
correctly, it reduces the following reducing function on a collection

(fn group-by-reducef [keyfn ret x]
 (let [k (keyfn x)]
(assoc ret k (conj (get ret k []) x

where keyfn is provided by a partial function application.

fold needs a combining function that takes two result maps that have
already been grouped and merges them.
A naive implementation could look like

(defn group-by-combinef
  ([] {})
  ([g1 g2]
 (persistent!
  (reduce (fn [res k v]
(assoc! res k (into (get res k []) v)))
  (transient g1) g2

(defn group-by [f coll]
  (fold (partial gr-by-reducef f) gr-by-combinef coll))

Now couple of questions:
1) I expected fold to actually perform the operation, how can I force it to
give me the result?
2) Can somehow the actual reducing at the leaf nodes still take advantage
of transient collections?
3) I took a look at flatten as it seems the closest match. Again, if I
call (flatten [[1 2] [2 4]]), I don't actually get the result. How do I get
to the result?


Thanks!

[1]
https://github.com/clojure/clojure/blob/master/src/clj/clojure/core/reducers.clj
[2]
http://clojure.com/blog/2012/05/08/reducers-a-library-and-model-for-collection-processing.html
[3] http://clojure.com/blog/2012/05/15/anatomy-of-reducer.html
-- 
László Török

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Easy update function for nested structures

2012-12-03 Thread László Török
Hi,

how about

(reduce #(update-in % %2 tf) arr2d list-of-coordinates)

given you 2d array is a vector of vectors  and you supply a tf update
function?

Las

2012/12/3 JvJ kfjwhee...@gmail.com

 I'm wondering if there's something that can be used like update-in, but
 with multiple key-lists and values.

 Like, for example, taking a list of [x y] coordinates for a 2-dimensional
 array, and changing the values at all of those coordinates.

 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en




-- 
László Török

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Object identity and with-meta

2012-11-23 Thread László Török
Hi,

only for persistent data structures (with a few caveats) [1]. For other
objects, such as function objects, equality check falls back to .equals().

Since with-meta returns a new object instance of an anonymous class,
.equals will always be false.

[1]
https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Util.java#L23

Hope it helps,

Las

2012/11/23 N8Dawgrr nathan.r.matth...@gmail.com

 I have unexplained behavior for with-meta.

 As far as I understand with-meta should not alter object identity. E.g. if
 we have the (= a b) = true for some a and b then
 (= (with-meta a ma) (with-meta b mb)) = true should also hold for any ma
 and mb.

 So why do I get the following behavior at the REPL?

 user (def f (partial * 2))

 user (= f f)
 true

 user (= (with-meta f {:a 1}) (with-meta f {:a 1}))
 false

 Any help appreciated.

 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en




-- 
László Török

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: ease of use

2012-11-22 Thread László Török
Alternatively,

do as Moritz suggested, except don't install packages manually via M-x
package-list-packages, but rather

go and get https://github.com/overtone/emacs-live

then nrepl.el keybindings are documented at
https://github.com/kingtim/nrepl.el

Good luck!

Las

2012/11/23 Moritz Ulrich mor...@tarn-vedra.de

 Don't use Aquamacs. I don't know of the current state, but some time
 ago experienced the same stuff. It somehow doesn't work when using
 Aquamacs.

 I recommend Emacs.app from http://emacsformacosx.com or installation
 via homebrew (brew install emacs --cocoa  brew linkapps). M-x
 package-list-packages, select nrepl and clojure-mode, hit x, setup
 finished. Leiningen2 is the perfect companion for this setup.

 On Fri, Nov 23, 2012 at 12:24 AM, atucker agjf.tuc...@gmail.com wrote:
  On the Mac, I got it kinda working, but can't work out how to break on a
  misjudged command, and the namespaces are permanently misaligned (in-ns
  doesn't work, C-c M-n doesn't work).  It feels like nothing really works,
  perhaps it didn't install properly (M-x install-package just hung).

 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en




-- 
László Török

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

macroexpand-1 for clojurescript macros

2012-11-21 Thread László Török
Hi,

How can I use macroexpand et. al to check an output of a clojurescript
macro?

As far as I know, clojurescript macros are clojure macros.
However if I start script/repl and enter

= (require 'cljs.compiler)
= (require 'cljs.core)
= (macroexpand-1 (cljs.core/gen-apply-to))
CompilerException java.lang.RuntimeException: Unable to resolve symbol:
*unchecked-if* in this context, compiling:(NO_SOURCE_PATH:5)

Btw, if I don't require 'cljs.compiler first, I get

CompilerException java.lang.ClassNotFoundException: cljs.compiler,
compiling:(cljs/core.clj:411)

-- 
László Török

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: macroexpand-1 for clojurescript macros

2012-11-21 Thread László Török
damn, stupid mistake of mine, thanks!

2012/11/21 Herwig Hochleitner hhochleit...@gmail.com

 Try quoting the code you want to macro expand, like: (macroexpand-1
 '(cljs.core/gen-apply-to))

 Otherwise clojure would try to macroexpand the result of (gen-apply-to)
 Am 21.11.2012 13:07 schrieb László Török ltoro...@gmail.com:

 Hi,

 How can I use macroexpand et. al to check an output of a clojurescript
 macro?

 As far as I know, clojurescript macros are clojure macros.
 However if I start script/repl and enter

 = (require 'cljs.compiler)
 = (require 'cljs.core)
 = (macroexpand-1 (cljs.core/gen-apply-to))
 CompilerException java.lang.RuntimeException: Unable to resolve symbol:
 *unchecked-if* in this context, compiling:(NO_SOURCE_PATH:5)

 Btw, if I don't require 'cljs.compiler first, I get

 CompilerException java.lang.ClassNotFoundException: cljs.compiler,
 compiling:(cljs/core.clj:411)

 --
 László Török

  --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 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 post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en




-- 
László Török

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Will the upcoming Clojure 1.5 stuff be available in Clojurescript too?

2012-11-20 Thread László Török
Hi,

I understand that the development of Clojure and Clojurescript is being
managed separately which makes sense.

However, I also noticed that there has been considerable effort to maintain
some level of compatibility between the two. There is some nice stuff
coming in Clojure 1.5 in core and I was wondering whether that will become
available in Clojurescript as soon as 1.5 is baked.

Las


-- 
László Török

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Are agents suitable for c10k concurrency?

2012-11-17 Thread László Török
Hi

I would only add, that with Clojure 1.5 you can supply your own Executor
using (send-via ), the default threadpools are not hard-wired anymore.

See
https://github.com/clojure/clojure/commit/f5f4faf95051f794c9bfa0315e4457b600c84cef#src/jvm/clojure/lang/Agent.javafor
further details.

Las

On Nov 17, 2012 3:24 PM, Philip Potter philip.g.pot...@gmail.com wrote:

 send-off works by submitting a Runnable to a newCachedThreadPool.


http://stackoverflow.com/questions/11316737/managing-agent-thread-pools-in-clojure

 A Runnable sent to a thread pool will have exclusive use of that
 thread until it completes; therefore, greater concurrency can only be
 achieved by more threads, and 10k connections will need 10k threads.

 I don't know much about asynchronous IO implementations in Clojure,
 but agents probably aren't what you want.

 Phil

 On 17 November 2012 13:06, Elliot ell...@deck36.net wrote:
  Hi all,
 
  I'm writing a c10k-style service, i.e. suppose 10,000 concurrent
  connections, mostly IO-bound.  Clojure agents with `send-off` are
  fantastically close to what I want conceptually, but I'm curious about
the
  implementation details--can anyone confirm, this would end up forking
10,000
  threads, which would presumably kill the system under context-switching
  load?
 
  From what I understand, Erlang/Go have lightweight actor processes
which
  are not true threads and are designed to have 10,000 of them spawned at
once
  handling async-IO without problem.  I'd prefer to stick with Clojure if
  possible but need to be able to handle the connection/IO-load.
 
  Anyone know how this works and/or has tried this in a production system?
 
  Any thoughts appreciated.  Thanks!
 
  - Elliot
 
  --
  You received this message because you are subscribed to the Google
  Groups Clojure group.
  To post to this group, send email to clojure@googlegroups.com
  Note that posts from new members are moderated - please be patient with
your
  first post.
  To unsubscribe from this group, send email to
  clojure+unsubscr...@googlegroups.com
  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 post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 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 post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Proposed change to let- syntax

2012-11-16 Thread László Török
+1, looking at the latest master, I think they need a better docstring, or
rather an example of use that makes it easier to grasp.

Regards,

Laszlo

2012/11/16 Jay Fields j...@jayfields.com

 another thought - a really nice thing about if, let, and if-let is
 that if you know how to use if and let, if-let just makes sense. You
 can't say the same about -, let, and let- with the current proposal.

 On Fri, Nov 16, 2012 at 7:32 AM, Alex Nixon a...@swiftkey.net wrote:
  On 16 November 2012 01:25, Mark Engelberg mark.engelb...@gmail.com
 wrote:
 
  On Thu, Nov 15, 2012 at 5:17 PM, Alan Malloy a...@malloys.org wrote:
 
  The primary point of let- is that you can insert it into an existing
 -
  pipeline.
 
 
  That makes sense.
 
  It does - thanks for the clarification.
 
  So is let- intended to be *never* used outside of -? If so, can an
  argument be made for enforcing its use within - to avoid (as far as I'm
  aware) introducing a 'new' (value first, name second, no destructuring
  support) binding syntax into core?  Despite it being more verbose, I'd
  rather read (- 42 (let- meaning-of-life (inc))) than (let- 42
  meaning-of-life (inc)).
 
  And on destructuring - the closest I can get with keeping compatibility
 with
  existing - forms would be
 
  (- {:foo 1}
(let- {:keys [foo] :as x}
  (assoc x :bar :foo)))
 
  The pro is that you get the power of destructuring.  The con is that this
  would be the first occurrence of destructuring from outside of an
 explicit
  binding form.
  --
  Alex Nixon
 
  Software Engineer | SwiftKey
 
  a...@swiftkey.net | http://www.swiftkey.net/
 
 
  ++
  WINNER - MOST INNOVATIVE MOBILE APP - GSMA GLOBAL MOBILE AWARDS 2012
 
  Head office: 91-95 Southwark Bridge Road, London, SE1 0AX TouchType is a
  limited company registered in England and Wales, number 06671487.
 Registered
  office: 91-95 Southwark Bridge Road, London, SE1 0AX
 
  --
  You received this message because you are subscribed to the Google
  Groups Clojure group.
  To post to this group, send email to clojure@googlegroups.com
  Note that posts from new members are moderated - please be patient with
 your
  first post.
  To unsubscribe from this group, send email to
  clojure+unsubscr...@googlegroups.com
  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 post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en




-- 
László Török

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Coding Standard - ns usage

2012-11-08 Thread László Török
Hi,

I thought :require with :refer superseded :use :only.

Or am I mistaken?

Las
On Nov 8, 2012 6:03 PM, Jim - FooBar(); jimpil1...@gmail.com wrote:

 I'm pretty sure this is still valid
 :)

 Jim

 On 08/11/12 16:57, David McNeil wrote:

 I notice the following item at http://dev.clojure.org/**
 display/design/Library+Coding+**Standardshttp://dev.clojure.org/display/design/Library+Coding+Standards

Be explicit and minimalist about dependencies on other packages.
 (Prefer the :only option to use and require).

 The page was last edited on Mar 29, 2011 and ns usage has been discussed
 a fair bit since then... this leads to the question:

Is the item quoted above still the standard for Clojure Libraries?

 Thanks.
 -David
 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscribe@**googlegroups.comclojure%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/**group/clojure?hl=enhttp://groups.google.com/group/clojure?hl=en


 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscribe@**googlegroups.comclojure%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/**group/clojure?hl=enhttp://groups.google.com/group/clojure?hl=en


-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Rich's The Value of Values and REST

2012-08-15 Thread László Török
Hi,

in my understanding, RESTful system design (as described in Roy Fielding's
dissertation) does not advocate hiding any state behind a bunch of
methods. :)

In REST, application state is carried by the representation that is passed
back and forth between the server and the client.

It seems to me that a truly RESTful system design is very much in line of
what Rich was talking about.

Las

2012/8/15 Conrad drc...@gmail.com

 Hi Everyone... Quick question about Rich's latest talk:

 In it he eloquently argues that you don't want to systems to communicate
 with each other by calling each other's methods. Instead it is better to
 just move values between systems that can also be queued.

 It occurs to me that RESTful web interfaces essentially hide a big chunk
 of state behind a bunch of methods (i.e. the URIs you can GET/PUT/POST to.)

 Am I right in thinking that Rich's talk is an argument AGAINST RESTful
 design? It seems to me his talk would suggest the best interface would
 almost be a SOAPy interface, where all communication is to a single URL.
 (Of course unlike SOAP the calls wouldn't consist of method invocations but
 instead consist of a stream of values.)

 Is this right?

 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en




-- 
László Török

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: ClojureScript instead of CoffeeScript for complete web app development?

2012-07-06 Thread László Török
Hi,

using the reducers library also eliminates the per-step allocation of
temporary results when the processing code is composed of multiple
functions, AFAIK.

Las

2012/7/4 Balint Erdi balint.e...@gmail.com

 Hey,

 AFAIK the clojure reducers library gains its performance boost since the
 underlying JVM can make use of multiple cores. I wonder how this changes
 with Javascript being the platform. Don't JS engines have a single
 execution thread?

 Balint


 On Thursday, June 28, 2012 11:47:46 PM UTC+2, David Nolen wrote:

 reducers are already available - though further perf work needs to be
 done to really deliver on the performance promises. Even so I wouldn't be
 surprised if they already outperform many chained sequence operations.

 David

 On Thu, Jun 28, 2012 at 5:45 PM, Ben Mabey b...@benmabey.com wrote:

 On 6/24/12 10:31 PM, Christian M. wrote:

 I think the only problem (if it is a problem at all), which won't be
 solved soon is ClojureScript's performance resulting from creating a lot of
 implicit objects in very high level computations. Something like (filter
 (map (reduce ... ... (map ... can't be as fast and as memory-efficient
 for loops and in-place array operations of JS. In theory, the same holds
 for Clojure and Java as well, however, in contrast to ClojureScript, I
 never faced this problem on JVM yet.


 Does the new reducers library[1] work in ClojureScript?  One of its
 advantages is that it avoids the per-step allocation overhead that you are
 mentioning with the chain of filters/maps/reduce calls.

 -Ben


 1. http://clojure.com/blog/2012/**0**5/08/reducers-a-library-and-**mo**
 del-for-collection-**processing.**htmlhttp://clojure.com/blog/2012/05/08/reducers-a-library-and-model-for-collection-processing.html


 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscribe@**googlegrou**ps.comclojure%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/**group**/clojure?hl=enhttp://groups.google.com/group/clojure?hl=en


  --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en




-- 
László Török

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Why cannot last be fast on vector?

2012-06-30 Thread László Török
Warren,

I think the issue is this:

You claim there is sg. broken in clojure while admitting that you know
little about how the design decision was made.

People that know clojure's implementation and the history of design
decisions inside-out offered advice why they think it is not broken, they
took time to explain the rationale for decision and even offerred advice
how to fix it for yourself should you insist on your view of the matter.

It seems to me you
a) need to reread these arguments to perhaps get a better grasp
b) have chosen to ignore them.

While you have right to do either of them, if it's b) not even the clojure
gods can really help you unless you actually spend some time with the
internals of clojure. ;-).

Las

2012/6/30 Warren Lynn wrn.l...@gmail.com

 Craig:

 If the dominant community attitude is before you know everything about
 Clojure, you have no right to comment, then that itself will be the reason
 not to use Clojure. But I think that is just you, not the community.

 Although I am glad some people paid attention to this post, I have far
 more important things to do than seeking some attention from strangers. I
 hope I stimulated some thinking here. I am a lisp lover, and I feel Clojure
 has a good potential of being a great and practical language, but it has
 its broken parts too and I wish they get fixed, so I will have a better
 experience using it. That is my goal (obvious I hope).


 On Saturday, June 30, 2012 12:17:39 PM UTC-4, Craig Brozefsky wrote:

 Warren Lynn wrn.l...@gmail.com writes:

 As I mentioned before, the issue here is not just a fast last. The
 issue here is I find the design of Clojure wrong, or confusing.
 That
 really shakes my confidence in the whole system.

 To say stuff like this, then be demure about digging into the code and
 understanding how things work, followed by asking for others to be do
 the coding and be and advocate for your rather vague feeling of unease,
 strikes me as passive-aggressive attention seeking.  To do such while
 top posting, well, it's just too much for me. 8^)

 --
 Craig Brozefsky cr...@red-bean.com
 Premature reification is the root of all evil

  --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en




-- 
László Török

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: [ANN] C2 v0.2.0: now with cljs data binding

2012-06-28 Thread László Török
Great, can't wait to try it,

note the http://keminglabs.com/c2/ page still refers to 0.1.0.

2012/6/28 Kevin Lynagh ke...@keminglabs.com

 Of course, you may want a link to the library itself:

 https://github.com/lynaghk/c2

 As always, to use from Clojure/ClojureScript just add this to your
 `project.clj`:

 [com.keminglabs/c2 0.2.0]

  --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en




-- 
László Török

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: How to read a file into a string up until a line? Any way to make it lazy?

2012-06-22 Thread László Török
Hi,

untested but:

(require '[clojure.string :as str])

(with-open [reader (clojure.java.io/reader path/to/the/file)]
   (let [lines (line-seq reader)
 records (map #(str/split % #\/\/) lines)]
 ... do your processing here on the lazy record list
))

L
2012/6/21 Joseph Guhlin joseph.guh...@gmail.com

 I have a 2.5GB file, and will have other files, where the records are
 mutli-line (variable length) and are separated by // on a line by itself.
 What is the best way to read the record into a sequence of strings for
 parsing, and act on that record, and read the next record? It'd be great if
 it was lazy, as it's 2.5GB and there will be other / larger files in the
 future.

 I have it reading the file just fine if there is only one entry, it was
 nice and easy as well as fast and concise, so I'd love to be able to do the
 entire thing in clojure if possible.

 Thanks,
 --Joseph

 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en




-- 
László Török

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: A tutorial for how to setup your clojure development environment for: Emacs, Leiningen and Linux.

2012-06-20 Thread László Török
+1, I had the same experience as Chris, lot of frustration until I found
Emacs-live
On Jun 20, 2012 1:54 PM, Chris Zheng zcaud...@gmail.com wrote:

 I was using textmate and a repl for the longest time because I was put off
 by the intricacies of emacs.. and then I found this:

 https://github.com/overtone/emacs-live

 and the tutorial that recommended it


 http://www.vijaykiran.com/2012/01/11/web-application-development-with-clojure-part-1/

 It's great. I'm completely sold on emacs.. On any computer, I install
 emacs, install lein, run one command:

 $ git clone https://github.com/overtone/emacs-live ~/emacs.d

 Now I have everything I need to develop in clojure like hinting,
 autocomplete and docs. Most importantly, it has a black background and
 fluro text by default. NO CUSTOMISATIONS!

 I remember how difficult it was for me as a complete newbie coming into
 the language. Thinking in a functional style was hard enough, let alone
 trying to get swank working and then frustrating over every aspect of
 emacs banging my head against the wall would have been more productive.

 It was so frusting because I just wanted something that worked and a bunch
 of tutorials that showed me how to get started. Things like autocomplete
 and documentation are essential for learning the concepts quickly. Its only
 recently that a spate of them has come out for the joe programmer and its
 really good to see that happening.

 My 2 cents:
  - New users don't want complication. Give them one 'product' to start off
 with and then slowly introduce them to more concepts later

  - Videos and Tutorials are a must. Its not about showing off about look
 how short I can make my code man... Its about helping others see a new way
 to think about the problem. The only way to do that besides sitting down
 with them is through tutorials. Longer tutorials and demonstrations that
 work through a complete problem are more helpful than short ones that are
 demonstrating the 'feature.. Hats off in particular to Brian Marick (
 http://vimeo.com/19404746), Chas Emerick (
 http://www.youtube.com/watch?v=VVd4ow-ZcX0), and Phil Hagelburg (
 https://peepcode.com/products/functional-programming-with-clojure) for
 taking the time to show the world how they worked through a 'real-world'
 problem.

 So basically, if a 'lead clojure evangelist' can either 'officially' or
 'unofficially' recommend ONE emacs setup, along with a bunch of
 videos/tutorials that demonstrate how to code and how fast it is to design
 and code using the repl. Then that be enough to get people at least
 interested.

 Expanding on that idea, If there were a set of peepcode-like 1 to 1.5h
 tutorials for clojure and its libraries (an episode on ring, an episode on
 agents futures and watches, an episode on incanter, an episode on writing a
 dsl, an episode on aleph..., an episode on writing a clojurescript
 application and also doing 'play-by-play' videos with top clojure
 developers), I'm sure newbies are going to take up the language much faster
 because they will have the crutches to allow them to explore the clojure
 landscape without worrying about how to go about entering text into
 a arcane text-editor.

  --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 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 post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Docstring state deftype, defrecord etc. are still alpha?

2012-06-16 Thread László Török
Hi,

I was reviewing some of the docstrings of programming constructs in the
clojure.core namespace.
I noticed that deftype and defrecord is still marked as alpha, subject to
change. These features have been introduced in 1.2, is this correct?

Also, transients, introduced in 1.1, still alpha?

Thanks!

-- 
László Török

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: [PATCH] RFC: Add Functions `tabify` And `untabify`

2012-06-08 Thread László Török
+1
On Jun 8, 2012 6:54 PM, Stuart Halloway stuart.hallo...@gmail.com wrote:

 Whatever we do let's make sure we think about how to make it available in
 all Clojure dialects.

 Stu

 On Jun 8, 2012, at 8:49 AM, Jay Fields wrote:

 I wouldn't mind seeing more in clojure.string. e.g. daserize, underscore,
 pascal-case, camel-case


 +1


 -
 Brian Marick, Artisanal Labrador
 Contract programming in Ruby and Clojure
 Occasional consulting on Agile
 www.exampler.com, www.twitter.com/marick


  --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 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 post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: [ANN] Itsy 0.1.0 released, a threaded web spider written in Clojure

2012-06-01 Thread László Török
Hi,

interesting project. I was wondering though how do you make sure two
crawlers do not crawl the same URL twice if there is no global state? :)

If I read it correctly you're going to have to spawn a lot of threads to
have at least a few busy with extraction at an point in time, as most of
them will be blocked most of the time while waiting for the page to be
retrieved.

You may also consider using the sitemap as a source of urls per domain,
although this depends on the crawling policy.

Regards,

Laszlo

2012/6/1 Lee Hinman matthew.hin...@gmail.com

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Hi all,
 I'm pleased to announce the initial 0.1.0 release of Itsy. Itsy is a
 threaded web spider written in Clojure. A list of some of the Itsy
 features:

 - - Multithreaded, with the ability to add and remove workers as needed
 - - No global state, run multiple crawlers with multiple threads at once
 - - Pre-written handlers for writing to text files and ElasticSearch
 - - Skip URLs that have been seen before
 - - Domain limiting to crawl pages only belonging to a certain domain

 You should be able to use it from Clojars[1] with the following:

 [itsy 0.1.0]

 Please give it a try and open any issues on the github repo[2] that
 you find. Check out the readme for the full information and usage.

 thanks,
 Lee Hinman

 [1]: https://clojars.org/itsy
 [2]: https://github.com/dakrone/itsy
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.12 (Darwin)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

 iQIcBAEBAgAGBQJPyDu+AAoJEJ1kZdQ6zsrgseoP/0j4HZ4k0Ok0f2u4HB7xm1kc
 V5oE67kqXKCJq7Nb4LQexbxEwbpQF1u6Zg9o7CvtUeMtLkQXAozIjJkk0H05HtEy
 lXINNupW2AylXnTzMd75E0ydeY+pvyNrG1EY5W1i5CcKhiruNcAQUNxh4UeCmMw2
 G/TBhENW+24KtFEJBd1sum2+o86atMHxvlNruwheLYtzq1iSUbpJe6oZu0EzZaa7
 DlrG1r8Gv77Tgbf+pYtFr+Bpf+ILaojh1lBJwb/8jPbaLwrI/TE4qdnOA+BERn0F
 7qtNErxq5UBVhrYh9Nit53ZEyDkHLYGWc0P39F8nFfWeWN9C8hAd9GWFddyZw3xL
 eop7IF0XerGdPaM93qfnKDMJLUFGfakBeP4hZIH1k5Ouoou+ffqbIZbzKK4yQwlt
 9VFKq7z0CsoNQ+sMwPWHjXTqNj62k1DYo1iyGFc0RHLyujuGtOna6ksh10PopIpz
 JxZX+txYXI5MsxLo6zGqHbuartXxhNUtoloYBi3BkD1Knmf5qYR/Irlzcy4TUIov
 QK/UNtvESSapKO/95HUgnw9wi0UDpOLHFTBTFU2XZkvNAalLwMLX9YZwAH79+htY
 C4cKLZjkME7wkvgq/HaMbRsPNuuJN8oBqDpmNzKW2DlJ6TZIdcjlgAVDBFL9oI1+
 mMlBkEVBNGMK+9dWMHur
 =BcLy
 -END PGP SIGNATURE-

 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en




-- 
László Török

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: [ANN] Itsy 0.1.0 released, a threaded web spider written in Clojure

2012-06-01 Thread László Török
Hi,

don't want to turn this to a lengthy discussion about crawling, but happy
to continue off list. ;)

Sitemaps work surprisingly well in certain domains (web shops powered by
standard web shop software, large e-commerce sites) and can make life
easier based on our experience.

Another point: i nice addition would be to observe polite crawling (e.g. do
not retrieve more than one page per sec from a domain), we got banned once
due to excessive traffic from a single IP.

Anyway thanks for sharing, I hope to get some hacking time and implement
one of our extractors as a handler in clojure and take out Itsy for a spin.
:)

Las

2012/6/1 Michael Klishin michael.s.klis...@gmail.com

 László Török:

  I was wondering though how do you make sure two
  crawlers do not crawl the same URL twice if there is no global state? :)

 By adding sharing state, for a single app instance, typically an atom. As
 for separating different instances,
 it is not uncommon to hash seed URLs (or domains) in such a way that two
 instances simply won't
 crawl the same site in parallel.


  You may also consider using the sitemap as a source of urls per domain,
  although this depends on the crawling policy.

 That does not work in practice. One reason is, sitemaps are often
 incomplete, out of date or missing
 completely. Another one, for most news websites and blogs, you will
 discover site structure a lot
 faster by frequently (within reason, of course) recrawling either first
 level pages or a seed of known
 section pages.

 There is a really good workshop on Web mining video from Strata Santa
 Clara 2012, it highlights two dozens
 more common problems you face when designing Web crawlers:

 http://my.safaribooksonline.com/video/-/9781449336172

 Highly recommended for people who are interested or work in this area (I
 think it can be purchased separately, O'Reilly Safari subscribers have
 access to the entire video set)

 I am by no means an expert (or even very experienced) in this area but
 Itsy has features that solve several very common
 problems out of the box in 0.1.0. Good job.

 MK

 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en




-- 
László Török

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: ANN Welle 1.0 final

2012-05-23 Thread László Török
On May 23, 2012 11:35 AM, Peter Taoussanis ptaoussa...@gmail.com wrote:

 Looks great - well done! I passed over Riak a while back because of the
lack of a good client- might be time to take a real look at it again.

 Love the ClojureWerkz pages btw.
+1

 - Peter Taoussanis

 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 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 post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: apply a function to every item in a sequence without realizing the sequence

2012-05-02 Thread László Török
Map IS lazy but it still returns the entire realized sequence, as expected.
On May 2, 2012 8:31 AM, Sean Neilan s...@seanneilan.com wrote:

 I don't think so.

 On Wed, May 2, 2012 at 1:22 AM, Stuart Campbell stu...@harto.org wrote:

 On 2 May 2012 14:44, Baishampayan Ghose b.gh...@gmail.com wrote:

 You can't use `map` because `map` will return a sequence of the same
 size and that can blow your heap.


 Isn't `map` lazy too?

 Regards,
 Stuart

 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 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 post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 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 post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: apply a function to every item in a sequence without realizing the sequence

2012-05-01 Thread László Török
You can also use doseq afaik, altough every element must realized at least
once, you just have to make sure you don't hold onto the head of the
sequence as you proceed.

It is not immediately apparent to me why that doesn't happen with your
loop-recur solution
On May 2, 2012 6:27 AM, Sean Neilan s...@seanneilan.com wrote:

 I forgot to mention:
 (nth (file-seq (java.io.File. /DirectoryWithMillionsOfFiles/)) 20)
 works great because nth doesn't realize the sequence!

 For now, I'll look at nth's source code to see how it iterates.

 On Tue, May 1, 2012 at 11:24 PM, Sean Neilan sneil...@gmail.com wrote:

 Hi,

 I'm sure this has been discussed to death but I can't figure it out.

 I've got a file-seq sequence from
 (file-seq (java.io.File. /DirectoryWithMillionsOfFiles/)) that will
 cause an out of memory error if realized.

 I want to call a function such as println on every element in the
 sequence.

 I understand that naming the sequence will cause it to be realized.

 The problems

1. I can't use map as in (map println (file-seq (java.io.File.
/DirectoryWithMillionsOfFiles))). Map realizes the sequence.
2. I can't use for as in (for [x (files)] (println x)). For realizes
the sequence.
3. I can't use dorun because even though dorun doesn't realize the
sequence, it can't execute a function on every element.
4. I can't use loop recur because it also realizes the
sequence: (loop [a (files) b (first a)] (println b) (recur (rest a) (first
a)))
5. I can't use refs because even though they provide state, they
can't save the state of the sequence without realizing the sequence.

 My question
 *Should I try the new stream library?*
 *
 *
 Thank you for your time.

 -Sean


  --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 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 post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: apply a function to every item in a sequence without realizing the sequence

2012-05-01 Thread László Török
Wow lot of active people in the early morning, all typing faster than me on
my phone... :-)
On May 2, 2012 6:36 AM, László Török ltoro...@gmail.com wrote:

 You can also use doseq afaik, altough every element must realized at least
 once, you just have to make sure you don't hold onto the head of the
 sequence as you proceed.

 It is not immediately apparent to me why that doesn't happen with your
 loop-recur solution
 On May 2, 2012 6:27 AM, Sean Neilan s...@seanneilan.com wrote:

 I forgot to mention:
 (nth (file-seq (java.io.File. /DirectoryWithMillionsOfFiles/)) 20)
 works great because nth doesn't realize the sequence!

 For now, I'll look at nth's source code to see how it iterates.

 On Tue, May 1, 2012 at 11:24 PM, Sean Neilan sneil...@gmail.com wrote:

 Hi,

 I'm sure this has been discussed to death but I can't figure it out.

 I've got a file-seq sequence from
 (file-seq (java.io.File. /DirectoryWithMillionsOfFiles/)) that will
 cause an out of memory error if realized.

 I want to call a function such as println on every element in the
 sequence.

 I understand that naming the sequence will cause it to be realized.

 The problems

1. I can't use map as in (map println (file-seq (java.io.File.
/DirectoryWithMillionsOfFiles))). Map realizes the sequence.
2. I can't use for as in (for [x (files)] (println x)). For realizes
the sequence.
3. I can't use dorun because even though dorun doesn't realize the
sequence, it can't execute a function on every element.
4. I can't use loop recur because it also realizes the
sequence: (loop [a (files) b (first a)] (println b) (recur (rest a) 
 (first
a)))
5. I can't use refs because even though they provide state, they
can't save the state of the sequence without realizing the sequence.

 My question
 *Should I try the new stream library?*
 *
 *
 Thank you for your time.

 -Sean


  --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 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 post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Loading a huge graph

2012-04-13 Thread László Török
Thanks,

having a C++ background, there is definitely a lot to learn about the JVM.

I'm wrote a script in Python that ran in about 10-12s and used up to 320MB
of memory.

I'm running a clojure repl from Emacs via jack-in.

What's the best way to adjust the heap size? swank-clojure and clojure-mode
don't say.

If I spin up the repl via lein swank, I can use the LEIN_JVM_OPTS, however
it affects only one of the JVMs started by lein swank, the one with jline.

Any advice? :)


2012/4/13 Alex Robbins alexander.j.robb...@gmail.com

 Yeah, sounds like it could definitely be a memory issue. This is one
 part where the JVM works a lot differently than I expected coming from
 a python background.

 Everybody may already know this, but the JVM only takes 64mb for the
 heap by default. You'll get an out of memory error if your program
 uses more than that. In contrast, python just takes all the memory it
 needs. As your program gets closer to the JVM memory limit it'll spend
 more and more time doing garbage collection, with less and less real
 work getting done. You can pass an -Xmx flag to give java access to
 more memory, which many (most?) programs do.


 On Thu, Apr 12, 2012 at 5:22 PM, David Nolen dnolen.li...@gmail.com
 wrote:
  How much memory do Python  Go consume when you do this? Are you giving
 the
  JVM enough memory?
 
 
  On Thu, Apr 12, 2012 at 6:17 PM, László Török ltoro...@gmail.com
 wrote:
 
  Hi,
 
  I'm trying figure out how to load a huge file that contains some 800k
 pair
  of integers (two integers per line) which represent edges of a directed
  graph.
 
  So if the ith line has x and y, it means that there is an edge between x
  and y vertex in the graph.
 
  The goal is to load it in an array of arrays representation, where the
 kth
  array contains all the nodes, where there is a directed edge from the
 kth
  node to those nodes.
 
  I've attempted multiple variants of with-open reader and line-seq etc.
 but
  almost always ended up with OutMemoryException or sg VERY slow.
 
  My latest attempt that also does not work on the large input:
 
  (defn load-graph [input-f]
(with-open [rdr (io/reader input-f)]
  (- (line-seq rdr)
  (map (fn [row]
 (let [[v1str v2str] (str/split row #\s)]
 [ (Integer/parseInt v1str) (Integer/parseInt v2str)
 ]))
)
  (reduce (fn [G [v1 v2]]
(if-let [vs (get G v1)]
  (update-in G [v1] #(conj % v2))
  (assoc G v1 [v2])))  { }  
 
  I'm getting a bit frustrated as there are Python, Go implementations
 that
  load the graph in less the 5 seconds.
 
  What am I doing wrong?
 
  Thanks
 
  --
  László Török
 
  --
  You received this message because you are subscribed to the Google
  Groups Clojure group.
  To post to this group, send email to clojure@googlegroups.com
  Note that posts from new members are moderated - please be patient with
  your first post.
  To unsubscribe from this group, send email to
  clojure+unsubscr...@googlegroups.com
  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 post to this group, send email to clojure@googlegroups.com
  Note that posts from new members are moderated - please be patient with
 your
  first post.
  To unsubscribe from this group, send email to
  clojure+unsubscr...@googlegroups.com
  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 post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en




-- 
László Török

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Loading a huge graph

2012-04-13 Thread László Török
Excellent! Thank you, that did the trick!

2012/4/13 bOR_ boris.sch...@gmail.com

 I have this option in my project.clj file, which does the trick if you are
 developing from emacs+swank+clojure-jack-in, and using large networks

   :jvm-opts [-Xmx4000m]

 And yes, one of the things to do when working with the jvm is learning how
 to use jconsole or visualvm to see why your program is slow :-), and know
 how to adapt the jvm options. If I remember correctly, java 1.7 has an
 option for a more flexible heap size, which might be a nice default.


 On Friday, 13 April 2012 10:32:24 UTC+2, Las wrote:

 Thanks,

 having a C++ background, there is definitely a lot to learn about the JVM.

 I'm wrote a script in Python that ran in about 10-12s and used up to
 320MB of memory.

 I'm running a clojure repl from Emacs via jack-in.

 What's the best way to adjust the heap size? swank-clojure and
 clojure-mode don't say.

 If I spin up the repl via lein swank, I can use the LEIN_JVM_OPTS,
 however it affects only one of the JVMs started by lein swank, the one with
 jline.

 Any advice? :)


 2012/4/13 Alex Robbins alexander.j.robb...@gmail.com**

 Yeah, sounds like it could definitely be a memory issue. This is one
 part where the JVM works a lot differently than I expected coming from
 a python background.

 Everybody may already know this, but the JVM only takes 64mb for the
 heap by default. You'll get an out of memory error if your program
 uses more than that. In contrast, python just takes all the memory it
 needs. As your program gets closer to the JVM memory limit it'll spend
 more and more time doing garbage collection, with less and less real
 work getting done. You can pass an -Xmx flag to give java access to
 more memory, which many (most?) programs do.


 On Thu, Apr 12, 2012 at 5:22 PM, David Nolen dnolen.li...@gmail.com
 wrote:
  How much memory do Python  Go consume when you do this? Are you
 giving the
  JVM enough memory?
 
 
  On Thu, Apr 12, 2012 at 6:17 PM, László Török ltoro...@gmail.com
 wrote:
 
  Hi,
 
  I'm trying figure out how to load a huge file that contains some 800k
 pair
  of integers (two integers per line) which represent edges of a
 directed
  graph.
 
  So if the ith line has x and y, it means that there is an edge
 between x
  and y vertex in the graph.
 
  The goal is to load it in an array of arrays representation, where
 the kth
  array contains all the nodes, where there is a directed edge from the
 kth
  node to those nodes.
 
  I've attempted multiple variants of with-open reader and line-seq
 etc. but
  almost always ended up with OutMemoryException or sg VERY slow.
 
  My latest attempt that also does not work on the large input:
 
  (defn load-graph [input-f]
(with-open [rdr (io/reader input-f)]
  (- (line-seq rdr)
  (map (fn [row]
 (let [[v1str v2str] (str/split row #\s)]
 [ (Integer/parseInt v1str) (Integer/parseInt
 v2str) ]))
)
  (reduce (fn [G [v1 v2]]
(if-let [vs (get G v1)]
  (update-in G [v1] #(conj % v2))
  (assoc G v1 [v2])))  { }  
 
  I'm getting a bit frustrated as there are Python, Go implementations
 that
  load the graph in less the 5 seconds.
 
  What am I doing wrong?
 
  Thanks
 
  --
  László Török
 
  --
  You received this message because you are subscribed to the Google
  Groups Clojure group.
  To post to this group, send email to clojure@googlegroups.com
  Note that posts from new members are moderated - please be patient
 with
  your first post.
  To unsubscribe from this group, send email to
  clojure+unsubscribe@**googlegroups.comclojure%2bunsubscr...@googlegroups.com
  For more options, visit this group at
  http://groups.google.com/**group/clojure?hl=enhttp://groups.google.com/group/clojure?hl=en
 
 
  --
  You received this message because you are subscribed to the Google
  Groups Clojure group.
  To post to this group, send email to clojure@googlegroups.com
  Note that posts from new members are moderated - please be patient
 with your
  first post.
  To unsubscribe from this group, send email to
  clojure+unsubscribe@**googlegroups.comclojure%2bunsubscr...@googlegroups.com
  For more options, visit this group at
  http://groups.google.com/**group/clojure?hl=enhttp://groups.google.com/group/clojure?hl=en

 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscribe@**googlegroups.comclojure%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/**group/clojure?hl=enhttp://groups.google.com/group/clojure?hl=en




 --
 László Török

   --
 You received this message because you are subscribed to the Google
 Groups Clojure

Re: Loading a huge graph

2012-04-13 Thread László Török
Thanks, I know about transients, but I'm already using mutable arrays for
speed :-)
On Apr 13, 2012 8:01 PM, Robert Marianski r...@marianski.com wrote:

 If the jvm does have enough memory, you may want to try building up the
 map using a transient.

 And not sure if this is faster, (maybe it's slower), but you can spell the
 function you pass to reduce more succinctly:

 (fn [G [v1 v2]] (update-in G [v1] (fnil conj []) v2))

 Robert

 On Thu, Apr 12, 2012 at 06:22:34PM -0400, David Nolen wrote:
  How much memory do Python  Go consume when you do this? Are you giving
the
  JVM enough memory?
 
  On Thu, Apr 12, 2012 at 6:17 PM, László Török ltoro...@gmail.com
wrote:
 
   Hi,
  
   I'm trying figure out how to load a huge file that contains some 800k
pair
   of integers (two integers per line) which represent edges of a
directed
   graph.
  
   So if the ith line has x and y, it means that there is an edge
between x
   and y vertex in the graph.
  
   The goal is to load it in an array of arrays representation, where
the kth
   array contains all the nodes, where there is a directed edge from the
kth
   node to those nodes.
  
   I've attempted multiple variants of with-open reader and line-seq
etc. but
   almost always ended up with OutMemoryException or sg VERY slow.
  
   My latest attempt that also does not work on the large input:
  
   (defn load-graph [input-f]
 (with-open [rdr (io/reader input-f)]
   (- (line-seq rdr)
   (map (fn [row]
  (let [[v1str v2str] (str/split row #\s)]
  [ (Integer/parseInt v1str) (Integer/parseInt
v2str) ]))
 )
   (reduce (fn [G [v1 v2]]
 (if-let [vs (get G v1)]
   (update-in G [v1] #(conj % v2))
   (assoc G v1 [v2])))  { }  
  
   I'm getting a bit frustrated as there are Python, Go implementations
that
   load the graph in less the 5 seconds.
  
   What am I doing wrong?
  
   Thanks
  
   --
   László Török
  
--
   You received this message because you are subscribed to the Google
   Groups Clojure group.
   To post to this group, send email to clojure@googlegroups.com
   Note that posts from new members are moderated - please be patient
with
   your first post.
   To unsubscribe from this group, send email to
   clojure+unsubscr...@googlegroups.com
   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 post to this group, send email to clojure@googlegroups.com
  Note that posts from new members are moderated - please be patient with
your first post.
  To unsubscribe from this group, send email to
  clojure+unsubscr...@googlegroups.com
  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 post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 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 post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Loading a huge graph

2012-04-12 Thread László Török
Hi,

I'm trying figure out how to load a huge file that contains some 800k pair
of integers (two integers per line) which represent edges of a directed
graph.

So if the ith line has x and y, it means that there is an edge between x
and y vertex in the graph.

The goal is to load it in an array of arrays representation, where the kth
array contains all the nodes, where there is a directed edge from the kth
node to those nodes.

I've attempted multiple variants of with-open reader and line-seq etc. but
almost always ended up with OutMemoryException or sg VERY slow.

My latest attempt that also does not work on the large input:

(defn load-graph [input-f]
  (with-open [rdr (io/reader input-f)]
(- (line-seq rdr)
(map (fn [row]
   (let [[v1str v2str] (str/split row #\s)]
   [ (Integer/parseInt v1str) (Integer/parseInt v2str) ]))
  )
(reduce (fn [G [v1 v2]]
  (if-let [vs (get G v1)]
(update-in G [v1] #(conj % v2))
(assoc G v1 [v2])))  { }  

I'm getting a bit frustrated as there are Python, Go implementations that
load the graph in less the 5 seconds.

What am I doing wrong?

Thanks

-- 
László Török

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: ClojureScript gets PersistentVectors

2012-03-29 Thread László Török
It has been a great learning experience on both Clojure internals and the
Clojurescript side.
One thing to note, that the handwritten JS (which also a straight port of
the java version and not optimized by the closure compiler) still
outperforms the Clojurescript version consistently by at least a factor of
3-3.5x on V8 and slightly on other engines.

It would be interesting to see why. I suspect that the code generated by
cljsc can be improved a lot and currently it does not always lend itself to
agressive inlining. (pure speculation, yet to be confirmed)
On the other hand, I understand that there are certain conventions that
have to be observed for CLJS abstractions like protocols etc. to work.

I'm interested to hear opinions and directions on where to go from hear:
chunked sequences and transient will certainly deliver a performance boost.
How about pods? Is there a design written up out there?

Is there a clojure experimental implementation on separate branch?

Las

2012/3/29 Evan Mezeske emeze...@gmail.com

 This is excellent.  Big thanks to Laszlo!  I've been working on
 a Raphaël-based interactive GUI app in ClojureScript that maintains a big
 vector of elements, and had just recently started to run into what seemed
 to be the performance limits of the copy-on-write approach.  I'm very
 optimistic that this feature will allow me to keep using vectors instead of
 dropping down to mutable host arrays, which is a big win.  I can't wait to
 try this.

 -Evan


 On Thursday, March 29, 2012 2:31:10 PM UTC-7, David Nolen wrote:

 Thanks to Laszlo Török, ClojureScript now has PersistentVectors,
 https://github.com/clojure/**clojurescript/commit/**
 e615f4cd326e7c608050272c64c4df**aff9a34689https://github.com/clojure/clojurescript/commit/e615f4cd326e7c608050272c64c4dfaff9a34689
 .

 They are based on the Java implementations found in Clojure. I'm happy to
 say they thoroughly trounce the old copy-on-write Vectors:

 http://jsperf.com/**persistentvector-norecur-js/11http://jsperf.com/persistentvector-norecur-js/11

 Note how much room for improvement we have on JS engines like V8 :)

 David

  --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.

 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com

 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en




-- 
László Török

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Alternate set literal syntax?

2012-03-26 Thread László Török

 The only redundant syntax in that list #^{} vs. ^{}. A wart in the
 language, but a clear improvement nonetheless. Thankfully Clojure is very
 conservative with breaking changes.

 All others serve a purpose, no matter how minor.

 How is this proposal (on *any* alternative set syntax) different to
 proposing :::user to be synonymous to ::user, wrt redundant syntax?

 Alex hit the nail on the head with the 3rd post of this thread.

+100 and I think (and others may agree) that should conclude this thread



 Thanks,
 Ambrose

 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en




-- 
László Török

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

the role of #_ reader macro in cljs.core

2012-03-25 Thread László Török
Hi,

I'm trying to wrap my head around the role of the #_ macro and how it's
used in core.cljs.

Can some explain, why it is used to prefix (throw.. ) in
(deftype EmptyList [meta]
...
...

IStack
  (-peek [coll] nil)
  (-pop [coll] #_(throw (js/Error. Can't pop empty list)))

or in
(deftype Vector [meta array]
...
...

IIndexed
  (-nth [coll n]
(if (and (= 0 n) ( n (.-length array)))
  (aget array n)
  #_(throw (js/Error. (str No item  n  in vector of length 
(.-length array))

but not in

(deftype Vector [meta array]
...
...

(-pop [coll]
(if ( (.-length array) 0)
  (let [new-array (aclone array)]
(. new-array (pop))
(Vector. meta new-array))
  (throw (js/Error. Can't pop empty vector


there are other examples at ln 68, ln 127, ln 146 for other forms.

Thx

Las


-- 
László Török

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: the role of #_ reader macro in cljs.core

2012-03-25 Thread László Török
Thx,

then why is it used at
(deftype Vector [... ]
...
...

IIndexed
  (-nth [coll n]
(if (and (= 0 n) ( n (.-length array)))
  (aget array n)
  #_(throw (js/Error. (str No item  n  in vector of length 
(.-length array))


where I would in fact expect an exception (to get the same behavior as in
clojure)?

Las

Baishampayan Ghose 2012. március 26., hétfő napon a következőt írta:

 The #_ reader macro simply comments out the form, so it's a no op.

 Sent from phone, please excuse brevity.
 On Mar 26, 2012 10:23 AM, László Török 
 ltoro...@gmail.comjavascript:_e({}, 'cvml', 'ltoro...@gmail.com');
 wrote:

 Hi,

 I'm trying to wrap my head around the role of the #_ macro and how it's
 used in core.cljs.

 Can some explain, why it is used to prefix (throw.. ) in
 (deftype EmptyList [meta]
 ...
 ...


 IStack



   (-peek

 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to 
 clojure@googlegroups.comjavascript:_e({}, 'cvml', 
 'clojure@googlegroups.com');
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com javascript:_e({}, 'cvml',
 'clojure%2bunsubscr...@googlegroups.com');
 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 post to this group, send email to 
 clojure@googlegroups.comjavascript:_e({}, 'cvml', 
 'clojure@googlegroups.com');
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com javascript:_e({}, 'cvml',
 'clojure%2bunsubscr...@googlegroups.com');
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en



-- 
László Török

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: New(er) Clojure cheatsheet hot off the presses

2012-03-23 Thread László Török
Hi,

I think Twitter's Bootstrap toolkit is sg to consider.

http://twitter.github.com/bootstrap/javascript.html#tooltips

also

http://twitter.github.com/bootstrap/javascript.html#popovers

I already used them, they're easy and fun to implement. :)
I think if the content already appers somewhere on the page, you can simply
reference it using it's element id.
hope it helps
Las

2012/3/23 Andy Fingerhut andy.finger...@gmail.com

 I definitely like the tooltip idea.  I like it so much that I've already
 played with it a bit, looking at several web pages with instructions for
 how to do it, but my knowledge of good ways to do this is zero except for
 the results of those Google searches.

 Has anyone implemented tooltips on a web page?  My preferences for a
 solution are:

 (a) No interaction with the web server required to get the tooltip
 contents, i.e. as far as the server is concerned, it is a static file web
 page.  Hopefully this means it has a very fast reaction time when the user
 interacts with it to show or take down the tooltips.

 (b) Tooltips always appear within the browser window, never sometimes
 partially in it and partially outside it.

 (c) Tooltips appear while your mouse is hovered over a link, and disappear
 as soon as the mouse moves away from that link.

 (d) works with most current web browsers (e.g. latest Firefox, Chrome,
 Safari, IE).

 (e) No $$ or legal encumbrances to use it.

 Thanks,
 Andy

 On Mar 23, 2012, at 3:45 AM, Rostislav Svoboda wrote:

  Hi Andy
 
  If anyone has suggestions for what you would like to see added to the
 cheatsheet
 
  It'd be great to have a tooltip appearing at every function I go over
  with my mouse. Typically I click on a function just to realize Oh,
  this is not the one I need so I have to go back. And this back 
  forth repeats several times. IMO tooltips would make such a search
  much faster and smoother. (Thx in advance)
 
  Bost
 
  --
  You received this message because you are subscribed to the Google
  Groups Clojure group.
  To post to this group, send email to clojure@googlegroups.com
  Note that posts from new members are moderated - please be patient with
 your first post.
  To unsubscribe from this group, send email to
  clojure+unsubscr...@googlegroups.com
  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 post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en




-- 
László Török

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Clojure-mode + aquamacs + paredit and character literals

2012-03-22 Thread László Török
I'm on OS X 10.6.8 with latest stable Aquamacs and
https://github.com/overtone/live-coding-emacs. Worked out of the box and is
the most amazing visual experience and programmer productivity I had with
Emacs so far.


Las

2012/3/22 Moritz Ulrich ulrich.mor...@googlemail.com

 Do you really need Aquamacs? My experience is that it causes more
 trouble than it's worth.

 I'd recommend using vanilla Emacs from [1] or building from source
 with the --cocoa switch. Vanilla Emacs on OS X got so good you don't
 really need Aquamacs anymore.
 Looking at the Emacs Starter Kit from Phil Hagelberg might be helpful too.

 [1]: http://emacsformacosx.com/

 Cheers,
 Moritz Ulrich

 On Wed, Mar 21, 2012 at 21:06, JuanManuel Gimeno Illa
 jmgim...@gmail.com wrote:
  I'm having problems typing character literals in aquamacs when
 clojure-mode
  and paredit are active. When I type the character \, emacs complains
 with:
 
  after 0 kwd macro iterations: Wrong type argument: characterp, -1
 
  Any idea of what is going on?
 
  Thanks,
 
  Juan Manuel
 
 
  --
  You received this message because you are subscribed to the Google
  Groups Clojure group.
  To post to this group, send email to clojure@googlegroups.com
  Note that posts from new members are moderated - please be patient with
 your
  first post.
  To unsubscribe from this group, send email to
  clojure+unsubscr...@googlegroups.com
  For more options, visit this group at
  http://groups.google.com/group/clojure?hl=en



 --
 Moritz Ulrich

 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en




-- 
László Török

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: into applied to transient vectors undocumented?

2012-03-21 Thread László Török
Hi,
I'm not sure why I said it can be. My original post was going to be about
why there isn't a into! (Thanks Alan for the hint!)

I think the

(if (instance? clojure.lang.IEditableCollection to)

line made me draw false conclusions. It was a bit late, apologies for the
noise and thx!

2012/3/20 Andy Fingerhut andy.finger...@gmail.com

 Sorry, I said something incorrect.  into cannot take transients as the
 first arg.  It calls transient internally on the first arg for speed.  This
 does not modify the value you passed in at all -- it creates a new
 transient data structure from what you pass in.

 If you try calling transient on a data structure that is already a
 transient, you get an error.  Thus this gives an error:

 user= (def x [1 2 3])
 #'user/x
 user= (def tx (transient x))
 #'user/tx
 user= (into tx [5 6 7])
 ClassCastException clojure.lang.PersistentVector$TransientVector cannot be
 cast to clojure.lang.IPersistentCollection  clojure.core/conj (core.clj:83)
 user= (into x [5 6 7])
 [1 2 3 5 6 7]

 Andy


 On Mar 20, 2012, at 11:30 AM, Andy Fingerhut wrote:

 func! (bang) is a naming convention from the programming language Scheme
 that Clojure often uses.  In general it means that the function mutates
 data, i.e. it is not a pure function.  Clojure does not have a ! after all
 of its core functions that do this, but it does after some.  In particular,
 the functions that operate on transients like conj! assoc! persistent! etc.
 mutate their arguments.

 Many (maybe most) regular collection functions do not take transients.  As
 I said, I think it is an accident, not by design, that 'into' can take a
 transient as an argument.  Originally it only took persistent collections
 as arguments (perhaps also seqs, but those are immutable, too).

 Andy

 On Mar 20, 2012, at 11:17 AM, László Török wrote:

 Ok,

 so the pattern is:

 func! (bang) takes a transient and returns a transient

 regular collection functions MAY take a transient but ALWAYS return a
 persistent collection, right? :)

 thx
 Las

 2012/3/20 Andy Fingerhut andy.finger...@gmail.com

 into uses transient and persistent! for speed.  The fact that into can
 take a transient as input is an accidental consequence of that, I think.
  Before into was changed to use transients internally, it could only take
 persistent data structures as input, and return a persistent data structure.

 Andy

 On Mar 20, 2012, at 10:32 AM, László Török wrote:

 Hi,

 While implementing qsort with clojure for fun, I thought about using
 transient vectors to speed up sorting vs the naive functional
 implementation.

 I need an *into!* version of *into *when joining two sorted subarrays
 and I was wondering why there isn't one.

 It seems that (source into) does in fact support a transient collection
 as the first argument, however it calls persistent! on the result.

 What was the rationale behind the decision? (Note: I'm not questioning
 it, just interested.)
 Is there a particular reason why this feature remains undocumented?

 --
 László Török


 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 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 post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en




 --
 László Török


 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 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 post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en




-- 
László Török

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient

into applied to transient vectors undocumented?

2012-03-20 Thread László Török
Hi,

While implementing qsort with clojure for fun, I thought about using
transient vectors to speed up sorting vs the naive functional
implementation.

I need an *into!* version of *into *when joining two sorted subarrays and I
was wondering why there isn't one.

It seems that (source into) does in fact support a transient collection as
the first argument, however it calls persistent! on the result.

What was the rationale behind the decision? (Note: I'm not questioning it,
just interested.)
Is there a particular reason why this feature remains undocumented?

-- 
László Török

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: into applied to transient vectors undocumented?

2012-03-20 Thread László Török
Ok,

so the pattern is:

func! (bang) takes a transient and returns a transient

regular collection functions MAY take a transient but ALWAYS return a
persistent collection, right? :)

thx
Las

2012/3/20 Andy Fingerhut andy.finger...@gmail.com

 into uses transient and persistent! for speed.  The fact that into can
 take a transient as input is an accidental consequence of that, I think.
  Before into was changed to use transients internally, it could only take
 persistent data structures as input, and return a persistent data structure.

 Andy

 On Mar 20, 2012, at 10:32 AM, László Török wrote:

 Hi,

 While implementing qsort with clojure for fun, I thought about using
 transient vectors to speed up sorting vs the naive functional
 implementation.

 I need an *into!* version of *into *when joining two sorted subarrays and
 I was wondering why there isn't one.

 It seems that (source into) does in fact support a transient collection as
 the first argument, however it calls persistent! on the result.

 What was the rationale behind the decision? (Note: I'm not questioning it,
 just interested.)
 Is there a particular reason why this feature remains undocumented?

 --
 László Török


 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 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 post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en




-- 
László Török

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

clojurewest talk videos?

2012-03-18 Thread László Török
Hi,

will the videos of the talks be available for those who did not make it to
the conference?

thx

-- 
László Török

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Clojurescript: persistent data structures?

2012-03-05 Thread László Török
Hi,

I may not be fully up to speed with the latest developments re.
Clojurescript, so please bear with me.

I was wondering, what are the impediments of implementing persistent data
structures in Clojurescript similar to those Clojure already has?
(and getting rid of the current copy-on-write whenever I create a new value
out of an existing one)

Thanks!

-- 
László Török

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Clojurescript: persistent data structures?

2012-03-05 Thread László Török
David,

Was it a straight port of the jvm implementation?
Is there any gist, blog post of your findings?
Thx
L

sent from my mobile device

On Mar 5, 2012 5:05 PM, David Nolen dnolen.li...@gmail.com wrote:

 On Mon, Mar 5, 2012 at 10:55 AM, László Török ltoro...@gmail.com wrote:

 Hi,

 I may not be fully up to speed with the latest developments re.
 Clojurescript, so please bear with me.

 I was wondering, what are the impediments of implementing persistent data
 structures in Clojurescript similar to those Clojure already has?
 (and getting rid of the current copy-on-write whenever I create a new
 value out of an existing one)

 Thanks!

 --
 László Török


 We should definitely implement persistent data structures for
 ClojureScript. I've done some initial tests and the modern JS engines seem
 to handle them quite well. I think their performance will only continue ot
 improve. If you've sent in your CA feel free to start on them and note your
 progress on via tickets on JIRA :)

 David

 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 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 post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

  1   2   >