Mike, I mean this is just one example to prove your ideas, not to
disprove.
On Oct 29, 4:26 am, Mike Meyer mwm-keyword-googlegroups.
620...@mired.org wrote:
On Thu, 28 Oct 2010 18:12:39 -0700 (PDT)
andrei andrei.zhabin...@gmail.com wrote:
I'll try to extend Mike's answer by one more
On Oct 29, 4:03 am, lprefonta...@softaddicts.ca wrote:
user= (doc ffirst)
-
clojure.core/ffirst
([x])
Same as (first (first x))
nil
user=
That could help a bit :
Nice! I didn't know about this function, and for this concrete case it
is ideal!
--
You
On Oct 29, 4:03 am, Andrew Gwozdziewycz apg...@gmail.com wrote:
I'd hoist the empty out of the cond using an if:
(if (empty? ps)
ret
(let [fps (first (first ps))]
(cond
...)))
Yeah, I thought about it, but it is still a bit verbose, especially
with a 3
On Oct 29, 5:40 am, David Sletten da...@bosatsu.net wrote:
You could just bind another local variable in the loop form:
(loop [ps pairs
ret {}
ffps (ffirst ps)]
(cond (empty? ps) ret
(some-test ffps) (recur (rest ps) (add-to-result ret ffps) (ffirst
(rest ps)))
Hi,
On 29 Okt., 12:11, andrei andrei.zhabin...@gmail.com wrote:
You could just bind another local variable in the loop form:
(loop [ps pairs
ret {}
ffps (ffirst ps)]
(cond (empty? ps) ret
(some-test ffps) (recur (rest ps) (add-to-result ret ffps) (ffirst
On Fri, Oct 29, 2010 at 7:14 AM, Meikel Brandmeyer m...@kotka.de wrote:
There's nothing stoping you to put a let in a loop.
(loop [ps (seq pairs)
ret {}]
(let [ffps (ffirst ps)]
(cond
(not ps) ret
(some-test ffps) (recur (next ps) (add-to-result ret ffps))
Errr... clarification Scheme would blow up when doing (first (first
object that could be '())).
On Fri, Oct 29, 2010 at 7:44 AM, Andrew Gwozdziewycz apg...@gmail.com wrote:
On Fri, Oct 29, 2010 at 7:14 AM, Meikel Brandmeyer m...@kotka.de wrote:
There's nothing stoping you to put a let in a
Please forgive the lengthy post...
New to Clojure and trying to get a friend excited about it by demonstrating
how Clojure's functional/STM heritage makes it easy to write
concurrent/parallel code, but I can't get Clojure to
I started with Java, where 256 threads are vying to increment a single
Hi,
On 29 Okt., 06:58, Brian Ericson li...@curvybits.org wrote:
(map #(.start %) threads)
map is not a loop. It creates a lazy sequences which does - nothing.
At least not until it is realised. Here you throw it away
immediatelly. Hence, no work is done. Use doseq instead when your main
Does fmap remove enough complexity to warrant it's own fn? Here's
what fmap would now look like.
(def fmap (partial same map))
Granted, it's probably the #1 use for same, so you might have a point.
Sean
On Oct 29, 12:44 am, Konrad Hinsen konrad.hin...@fastmail.net wrote:
On 28.10.2010, at
Hi,
It was possible in clojure 1.0.0 to include clojure Persistent
collections in Jython:
jython -Dpython.path=clojure_dist/clojure_1.0.0/clojure-1.0.0.jar
from clojure.lang import PersistentList
b= PersistentList.create([7, 8, 2])
b
(7 8 2)
But with clojure 1.1.0 or 1.2.0 I get:
one is told to avoid macros as long as possible.
I've heard this before, but I believe it's intended to be interpreted
differently. I believe, it's meant to more like don't use them unless
you need them, which some people translate into avoid them. I have
heard, as a rule of thumb, that less
Could someone else also try the sample code I included to see if they
also experience the same ~10x slowdown for (count (filter ...)) in 1.3
Alpha 2?
On Oct 28, 12:34 pm, Btsai benny.t...@gmail.com wrote:
I have some code that counts the elements in a list that map to true
in a lookup table,
I see the same problem:
Clojure 1.3.0-alpha1
user= (load-file /tmp/foo.clj)
Elapsed time: 402.588654 msecs
1
Clojure 1.3.0-alpha2
user= (load-file /tmp/foo.clj)
Elapsed time: 4584.271921 msecs
1
On Oct 29, 9:41 am, Btsai benny.t...@gmail.com wrote:
Could someone else also try the sample code I
My results are actually worse. I get about a 40x slowdown, going from
~50ms in 1.2.0 to ~2000ms in 1.3.0-alpha2.
On Oct 29, 12:41 pm, Btsai benny.t...@gmail.com wrote:
Could someone else also try the sample code I included to see if they
also experience the same ~10x slowdown for (count
Confirmed. I am looking into this. For some reason the call to filter is
reflective in alpha 2.
Could someone else also try the sample code I included to see if they
also experience the same ~10x slowdown for (count (filter ...)) in 1.3
Alpha 2?
On Oct 28, 12:34 pm, Btsai
Rich has fixed this on master:
http://github.com/clojure/clojure/commit/e354b01133e7cff8dc0d0eb9e90cde894c12e127
Thanks for the report!
Stu
I have some code that counts the elements in a list that map to true
in a lookup table, looking something like this:
(def lookup-table {1 true, 2
On Oct 29, 2:14 pm, Meikel Brandmeyer m...@kotka.de wrote:
There's nothing stoping you to put a let in a loop.
Yes, but imagine a bit more complicated case, for example, instead of
'(first (first ps))' write (.foo (first ps)), and it will crash. I'm
looking for elegant, but general case
(first (flatten ...)) ?
2010/10/29 andrei andrei.zhabin...@gmail.com:
On Oct 29, 2:14 pm, Meikel Brandmeyer m...@kotka.de wrote:
There's nothing stoping you to put a let in a loop.
Yes, but imagine a bit more complicated case, for example, instead of
'(first (first ps))' write (.foo (first
Awesome, thank you :)
On Oct 29, 2:29 pm, Stuart Halloway stuart.hallo...@gmail.com wrote:
Rich has fixed this on
master:http://github.com/clojure/clojure/commit/e354b01133e7cff8dc0d0eb9e90c...
Thanks for the report!
Stu
I have some code that counts the elements in a list that map
Hello,
I had the pleasure of attending the first Clojure Conj and I have
uploaded some photographs that I took there -
http://www.flickr.com/photos/ghoseb/sets/72157625254615916/
Enjoy.
Regards,
BG
--
Baishampayan Ghose
b.ghose at gmail.com
--
You received this message because you are
Thanks for sharing these!
On Oct 29, 4:40 pm, Baishampayan Ghose b.gh...@gmail.com wrote:
Hello,
I had the pleasure of attending the first Clojure Conj and I have
uploaded some photographs that I took there
-http://www.flickr.com/photos/ghoseb/sets/72157625254615916/
Enjoy.
Regards,
BG
Nice pics. I am incredibly jealous of everyone that had the chance to
attend.
-Terrance
Baishampayan Ghose wrote:
Hello,
I had the pleasure of attending the first Clojure Conj and I have
uploaded some photographs that I took there -
You can use some Reflection to find out if the function has
implemented the matching invoke(args*) method
see: http://gist.github.com/654851
On 29 Okt., 07:02, Ken Wesson kwess...@gmail.com wrote:
(defn accepts-arity? [n f]
(reduce
#(or
%1
(= n (count %2))
(and
Has anyone thought about putting clojure on javascript?
Tim Daly
--
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
Now that server side javascript is growing with node.js, clojure on
javascript will be usefull. Nodejs is event based and not thread based so I
don't know the ramifications on clojure yet.
On Sat, Oct 30, 2010 at 8:33 AM, Tim Daly d...@axiom-developer.org wrote:
Has anyone thought about
There's also this, I suppose:
(defn accepts-arity? [n f]
(try
(apply f (repeat n nil))
true
(catch IllegalArgumentException e
(not (.startsWith (.getMessage e) Wrong number of args)))
(catch Throwable _
true)))
This directly tests for the exception that's generated if the
cf. node js, I thought of mentioning this link
http://dosync.posterous.com/22397098
On Fri, Oct 29, 2010 at 11:10 PM, Santosh Rajan santra...@gmail.com wrote:
Now that server side javascript is growing with node.js, clojure on
javascript will be usefull. Nodejs is event based and not thread
Macros in lisp get used for three general purposes, at least
in my experience.
The first purpose is efficiency. In common lisp you will find
that you can generate very machine-efficient (aka optimized
fortran level) binary instruction sequences if you add type
information. This gets tedious to
A port of Clojure to JS would be interesting. Rich has expressed interest
and Chouser's ClojureScript is a step in that direction.
On Fri, Oct 29, 2010 at 11:28 PM, Victor Olteanu bluestar...@gmail.comwrote:
cf. node js, I thought of mentioning this link
http://dosync.posterous.com/22397098
On Oct 29, 2010, at 11:09 PM, David Nolen wrote:
JS brought me to Lisp, I would love to see the Clojure community bring Lisp
back to JS. However I fail to see what advantage JS gives on the server side.
From what I've seen the V8 GC and Node.js have a considerable number of years
to go
On Fri, Oct 29, 2010 at 4:26 PM, Terrance Davis
terrance.da...@gmail.com wrote:
Nice pics. I am incredibly jealous of everyone that had the chance to
attend.
Me too! Although a friend of mine attended and got me a T shirt! (thanx Roger!)
Hopefully next year's conj will get on the schedule
32 matches
Mail list logo