Hi,
I've just run across a different error reporting in 1.3.0-alpha2 to
the one in 1.2. See the sample below.
Clojure 1.3.0-alpha2
user= (use 'clojure.contrib.monads)
nil
user= ((fetch-val 1) 4)
ClassCastException java.lang.Long cannot be cast to clojure.lang.IFn
I don't recall all the reasons and details from Rich's conj talk, but
this is expected behavior now; your numbers are now Longs internally
by default.
See
http://github.com/clojure/clojure/commit/845c63e9317826a5564ef766550562b3fbe68181
Chris
On Thu, Oct 28, 2010 at 6:00 AM, Jacek Laskowski
Hi,
did anyone encounter OS process timed out errors with the clutch
view server for Couch? Defining the same view with javascript works
fine, but when using clojure the view hangs and Couch basically logs
OS process timed out errors. The command line seems to work. I could
start the view server
Here we go:
http://david-mcneil.com/post/1393750407/clojure-conj-day-1-notes
Check the notes at the bottom from Rich's talk; it's the part about
unified primitives and boxed numbers.
Chris
On Thu, Oct 28, 2010 at 7:20 AM, Chris Maier
christopher.ma...@gmail.com wrote:
I don't recall all the
Does this help?
user (use 'clojure.string)
nil
user (join , (range 10))
0,1,2,3,4,5,6,7,8,9
It still doesn't work for the list of strings. But thanks for
reminding about it.
--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this
Are you looking for pr-str?
user (pr-str foo)
\foo\
Yeah, that's exactly what I tried to implement with my `pr-to-str`,
thank you.
--
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
On Wed, Oct 20, 2010 at 3:21 PM, Rich Hickey richhic...@gmail.com wrote:
On Oct 20, 1:34 pm, cej38 junkerme...@gmail.com wrote:
This question leads into something that I read in Joy of Clojure (page
161 in the latest MEAP edition):
If you manage to hold onto the head of a sequence somewhere
Hi!
A little stuck on how to do this efficiently. I have data that looks
like this
( [ [1 2] [3 4] [5 6] ... ] [ [5 6] [7 8] [9 0] ... ] ...)
I am trying to sum the vector pairs, e.g
[6 8] [10 12] [14 6]
thx!
--
You received this message because you are subscribed to the Google
Groups
A little stuck on how to do this efficiently. I have data that looks
like this
( [ [1 2] [3 4] [5 6] ... ] [ [5 6] [7 8] [9 0] ... ] ...)
I am trying to sum the vector pairs, e.g
[6 8] [10 12] [14 6]
Try:
user (def all-pairs '([ [1 2] [3 4] [5 6] ] [[5 6] [7 8] [9 0]]) )
I don't know if use of `partial' is considered idiomatic, but I think
it's the clearest in cases like this.
user (def all-pairs '([ [1 2] [3 4] [5 6] ] [[5 6] [7 8] [9 0]]) )
#'user/all-pairs
user (apply map (partial map +) all-pairs)
((6 8) (10 12) (14 6))
-- Eric
Ulises
What is the full path of that program in the 1.2.0 bundle? I can't
seem to find it.
On Oct 27, 4:23 pm, dmiller dmiller2...@gmail.com wrote:
Let me know on the error.
Re REPL: run Clojure.Main.exe to start.
-David
On Oct 27, 2:54 pm, Sean Devlin francoisdev...@gmail.com wrote:
So, I
I would like to apply an higher order function on an arbitrarily
nested data structure which yields exactly the same structure but the
original values replaced by the result of applying the passed in
function.
This is somewhat akin to the fmap function in Functor type class in
haskell. I had a
Hello all
I switched from org.danlarkin/clojure-json library to
clojure.contrib.json, and found that all non-ascii characters are encoded
as \u characters. But information on json.org states that character
could be any-Unicode-character-except--or-\-or-control-character
So, it seems that
Like my same fn or something different? Maybe combine it with
prewalk?
Sean
On Oct 28, 10:42 am, Amitava Shee amitava.s...@gmail.com wrote:
I would like to apply an higher order function on an arbitrarily
nested data structure which yields exactly the same structure but the
original values
Functor's fmap in Haskell is passed where to apply the function as an
(hidden in the type class dictionary) argument.
You would need somehow to be more specific about where you want to
apply your function in the data-structure.
(On predefined position, a la Functor, or on every leaf, with a
Okay, you're re-inventing clojure.walk. Please take a look at that
namespace.
On Oct 28, 11:52 am, Eric Schulte schulte.e...@gmail.com wrote:
Without each type specifying where it would like the function applied
the result will be sort of hacky, but here's my hackey attempt at fmap
in
Is anyone working on clojure for the parrot vm?
-Terrance
--
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
Github automatically provides a zip of any tagged commit, so you can
download the source for the 1.2.0 release. That's the link with the
little tag icon on it. That is a source distribution and you'd have
to follow a long involved path to get that to run. I took the
instructions for that off
On 28 Oct 2010, at 16:42, Amitava Shee wrote:
I would like to apply an higher order function on an arbitrarily
nested data structure which yields exactly the same structure but the
original values replaced by the result of applying the passed in
function.
This is somewhat akin to the fmap
My interest is general improvement of Clojure documentation. At the
conj, I spoke with Zack Kim about helping to improve the state of the
documentation. My goal was to contribute additional documentation for
vars that are lacking, as well as clarifying some of the more
confusing doc strings
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 false})
(def elements (range 100))
(count (filter lookup-table elements))
On my machine, with server mode enabled, the count + filter got ~10
On Thu, Oct 28, 2010 at 1:49 PM, Chris Maier
christopher.ma...@gmail.com wrote:
Here we go:
http://david-mcneil.com/post/1393750407/clojure-conj-day-1-notes
Check the notes at the bottom from Rich's talk; it's the part about
unified primitives and boxed numbers.
Thanks. That helped.
Jacek
hi,
not looking to stir up a pot, looking to learn from people's
experience. i've heard that in CL land, one is told to avoid macros as
long as possible. i've heard other folks in the Clojure world say that
if you aren't using macros, then sorta why bother use a Lisp since you
are missing out on
Okay, functor is a good idea but a weak implementation. My complaint
is that it only provides functor behavior for the map function. same
is a higher order function that works on anything, and is based on
protocols. Take a look at the test cases to understand what I'm
talking about.
On Oct 28, 2010, at 2:55 PM, Raoul Duke wrote:
not looking to stir up a pot, looking to learn from people's
experience. i've heard that in CL land, one is told to avoid macros as
long as possible. i've heard other folks in the Clojure world say that
if you aren't using macros, then sorta why
On Thu, Oct 28, 2010 at 1:08 PM, Michael Gardner gardne...@gmail.com wrote:
Use a macro iff you can't do what you want with a function.
sorta true, perhaps leading to the kernel question: how do you decide
what it really is you want/need to do? cf. the use of macros then not
use of macros in
Hi,
Am 28.10.2010 um 21:55 schrieb Raoul Duke:
i've heard other folks in the Clojure world say that
if you aren't using macros, then sorta why bother use a Lisp since you
are missing out on one of the most powerful differentiators.
These people ^^^ should listen carefully to those people
On Thu, 28 Oct 2010 12:55:55 -0700
Raoul Duke rao...@gmail.com wrote:
hi,
not looking to stir up a pot, looking to learn from people's
experience. i've heard that in CL land, one is told to avoid macros as
long as possible. i've heard other folks in the Clojure world say that
if you aren't
Worked great for meThanks Stuart for wrestling with the dragon.
I've created and shared a couple of simple issue filters to get issue-
browsers started. Search for them under managing filters section.
cheers,
-tom
On Oct 27, 6:07 pm, Stuart Halloway stuart.hallo...@gmail.com wrote:
I am happy to announce fundata1 -- the largest-ever program per RAM
allocation in Haskell, originally implemented in Clojure and then
OCaml and Haskell for social network modeling.
http://github.com/alexy/fundata1
It has now become the first large-scale social networking benchmark
with a real
Hi,
I have a code similar to this:
(def pairs (list [1 :a] [2 :b] [3 :c]))
...
(loop [ps pairs, ret {}]
(cond (empty? ps) ret
(some-test (first (first ps))) (recur (rest ps) (add-to-
result ret (first (first ps
:true (recur (rest ps) (do-smth-else ret (first
On Fri, Oct 29, 2010 at 1:58 AM, Mike Meyer
mwm-keyword-googlegroups.620...@mired.org
3) You need it to get the API syntax you want (most commonly, a DSL).
This last point is what I consider the most powerful feature of any
language. And thats what makes Lispy languages a class apart. Use a
user= (doc ffirst)
-
clojure.core/ffirst
([x])
Same as (first (first x))
nil
user=
That could help a bit :
Luc P.
andrei andrei.zhabin...@gmail.com wrote ..
Hi,
I have a code similar to this:
(def pairs (list [1 :a] [2 :b] [3 :c]))
...
(loop [ps pairs,
I'd hoist the empty out of the cond using an if:
(if (empty? ps)
ret
(let [fps (first (first ps))]
(cond
...)))
On Thu, Oct 28, 2010 at 8:49 PM, andrei andrei.zhabin...@gmail.com wrote:
Hi,
I have a code similar to this:
(def pairs (list [1 :a] [2 :b] [3 :c]))
I'll try to extend Mike's answer by one more example. Consider `and`
Lisp macro. It is not a function, because it must evaluate it's
arguments lazily, and using macros is the only way to do it. But try
to apply `and` to the list of values (I know, that it's a job for a
function `every?`, but how
On Fri, 29 Oct 2010 06:30:27 +0530
Santosh Rajan santra...@gmail.com wrote:
On Fri, Oct 29, 2010 at 1:58 AM, Mike Meyer
mwm-keyword-googlegroups.620...@mired.org
3) You need it to get the API syntax you want (most commonly, a DSL).
This last point is what I consider the most powerful
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 example. Consider `and`
Lisp macro. It is not a function, because it must evaluate it's
arguments lazily, and using macros is the only way to do it.
Actually, this
Andrei,
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)))
:true (recur (rest ps) (do-sth-else ret ffps) (ffirst
On 28.10.2010, at 21:57, Sean Devlin wrote:
Okay, functor is a good idea but a weak implementation. My complaint
is that it only provides functor behavior for the map function. same
is a higher order function that works on anything, and is based on
protocols. Take a look at the test cases
(defn accepts-arity? [n f]
(reduce
#(or
%1
(= n (count %2))
(and (= ' (last (butlast %2))) (= n (- (count %2) 2
false
(:arglists (meta f
This works only if f has metadata -- anonymous lambdas don't but functions
defined using defn do.
I thought this up
40 matches
Mail list logo