Hi Sunil,
This is not quite what your asking for, but Org-mode [1] (an Emacs
outlining mode) has support for embedded code blocks which can be
executed, tangled etc... [2] in a number of languages including Clojure.
Also, I often see ^L characters in lisp files inside of Emacs, I believe
these
Thank you, this solved the issues I was having as far as I can tell.
Now I can focus on getting rest of my chess engine working properly.
Timo
Jason Wolfe jawo...@berkeley.edu writes:
You're looking for apply.
user2 (max 1 2 3)
3
user2 (max [1 2 3])
[1 2 3]
user2 (apply max [1 2 3])
3
Rich-
Could you post the slides from your Hammock-driven development talk?
Most excellent! Awesome in fact :-).
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
Hello all
I have following question to Rich and other core developers of Clojure -
why parameters destructuring requires presence of 'nth' implementation for
destructuring of sequences?
The [[x more]] idiom is very popular and could make code more concise, but
it doesn't work for sets and some
Re
jweiss at Sun, 5 Dec 2010 10:29:41 -0800 (PST) wrote:
j I'm no expert on this, but i'll take a crack at it.
j I think it's because sets don't (necessarily) impose any order, so
j there's no concept of first or nth. So destructuring would
j essentially be assigning a random item to x, or
On Dec 5, 2:10 pm, Alex Ott alex...@gmail.com wrote:
Re
jweiss at Sun, 5 Dec 2010 10:29:41 -0800 (PST) wrote:
j I'm no expert on this, but i'll take a crack at it.
j I think it's because sets don't (necessarily) impose any order, so
j there's no concept of first or nth. So
Brian Marick mar...@exampler.com writes:
Is there any way to get the original call form? Something like env? Some
hook into the reader?
Try form
--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to
On Sun, Dec 05, 2010 at 07:35:35AM -0700, Eric Schulte spake thus:
Also, I often see ^L characters in lisp files inside of Emacs, I believe
these characters are used for in-file navigation, but I don't know how,
so that might be another avenue of investigation (I'd be interested to
hear what
Hi,
I'm trying to write a function that calculates the length of a list:
(defn list-length [col]
(if col
(+ 1 (list-length(rest col)))
0))
(list-length '(Java, Clojure, Scala))
Upon running it in the REPL, I got the error:
java.lang.StackOverflowError (test.clj:3)
What is going
On Dec 5, 2010, at 3:32 PM, Alex Osborne wrote:
Is there any way to get the original call form? Something like env? Some
hook into the reader?
Try form
I should have guessed. Thanks.
-
Brian Marick, Artisanal Labrador
Contract programming in Ruby and Clojure
Author of /Ring/
On Dec 5, 9:52 pm, HB hubaghd...@gmail.com wrote:
Hi,
I'm trying to write a function that calculates the length of a list:
(defn list-length [col]
(if col
(+ 1 (list-length(rest col)))
0))
(list-length '(Java, Clojure, Scala))
Upon running it in the REPL, I got the error:
Your function never actually ends because even the empty list
evaluates to true :)
rlm.dna-melting (if (rest '()) true false)
true
rlm.dna-melting (if (next '()) true false)
false
so, changing your list length function to use next will work
rlm.dna-melting (defn list-length [col] (if col (+ 1
On Sun, Dec 5, 2010 at 5:16 PM, Robert McIntyre r...@mit.edu wrote:
Your function never actually ends because even the empty list
evaluates to true :)
rlm.dna-melting (if (rest '()) true false)
true
rlm.dna-melting (if (next '()) true false)
false
so, changing your list length function
tl;dr: Please add an interface to clojure.lang.Atom. kthxbye
I had the brilliant idea of using CouchDB for something equally brilliant, and
if possible implement a Clojure view server. Turns out Clutch fits the bill
perfectly, except that I would like to use Aleph, and Couch is using something
On Sun, Dec 5, 2010 at 1:29 PM, jweiss jeffrey.m.we...@gmail.com wrote:
I'm no expert on this, but i'll take a crack at it.
I think it's because sets don't (necessarily) impose any order, so
there's no concept of first or nth. So destructuring would
essentially be assigning a random item to
What is the difference between rest and next?
I'm confused, should I use empty? or not? when to use it?
Robert,
Your code is working but if I use empty? , it returns 0 instead of the
actual count.
Why?
Why Clojure decided to handle an empty list as a not false? this is a
big (if not) departure
On Sun, Dec 5, 2010 at 4:14 PM, jweiss jeffrey.m.we...@gmail.com wrote:
That's totally different than nth for a set being undefined. It's undefined
on purpose.
Now, if you are using a sorted-set, then you have a point there, I
would expect that nth means something then. But yeah, clojure
On Sun, Dec 5, 2010 at 7:46 AM, Timo Myyrä timo.my...@gmail.com wrote:
Thank you, this solved the issues I was having as far as I can tell.
Now I can focus on getting rest of my chess engine working properly.
Chess? Then you've got a problem. I didn't see any pruning or even
depth bounding in
HB hubaghd...@gmail.com writes:
I'm trying to write a function that calculates the length of a list:
(defn list-length [col]
(if col
(+ 1 (list-length(rest col)))
0))
(list-length '(Java, Clojure, Scala))
Upon running it in the REPL, I got the error:
On Sun, Dec 5, 2010 at 10:05 AM, Philip Hudson phil.hud...@iname.com wrote:
Anyone willing able to help troubleshoot a Mac 10.5 MacPorts setup?
I've heard other bug reports with the MacPorts packaging of Leiningen.
I'd recommend installing as per the Leiningen readme or using Homebrew
until the
In Clojure, empty sequences are not considered logically false, so
your code continues going after reducing col to an empty list. You
need to explicitly check whether the collection is empty, like so:
(defn list-length [col]
(if (empty? col)
0
(+ 1 (list-length (rest col)
Cheers,
OMG, this is too much Clojure code for me to handle O.o
Alex, you just killed me :)
Do you previous Lisp knowledge? or Clojure is your first Lisp? you are
so good.
I will spend the next couple of hours studying it.
Thanks all, you are awesome.
On Dec 6, 12:47 am, Alex Osborne a...@meshy.org
I'm trying to use clojure for scientific data analysis but I keep
running into lacunas of functionality.
I'd love to hear the community's recommendations and experiences with this:
Is there a standard way to do things like:
1. take the convolution of two vectors
2. work with imaginary numbers,
Ken Alex,
Why you aren't calling empty? when you want to check if a collection
is empty?
Isn't (if s) supposed to return true if s is empty ?
On Dec 6, 12:27 am, Ken Wesson kwess...@gmail.com wrote:
On Sun, Dec 5, 2010 at 5:16 PM, Robert McIntyre r...@mit.edu wrote:
Your function never
+1 to what Ken said
Sunil
On Mon, Dec 6, 2010 at 4:04 AM, Ken Wesson kwess...@gmail.com wrote:
On Sun, Dec 5, 2010 at 4:14 PM, jweiss jeffrey.m.we...@gmail.com wrote:
That's totally different than nth for a set being undefined. It's
undefined
on purpose.
Now, if you are using a
If sets don't have a set ordering, then why should seq on a set always
return the same order for the same set?
If seq doesn't always return the a seq with the same order, then (nth
set 5) might be different than a future call to (nth set 5),
because the underlying sequence returned by the set
Hi guys,
I would like a function to be able to take an arbitrarily nested collection
and return a sequence of all values of a given key, such as :name, that
appears anywhere in the nested collection.
Does anything like this already exist?
Thanks for the help,
Alex
--
You received this message
On Sun, Dec 5, 2010 at 6:27 PM, Robert McIntyre r...@mit.edu wrote:
I'm trying to use clojure for scientific data analysis but I keep
running into lacunas of functionality.
I'd love to hear the community's recommendations and experiences with this:
Is there a standard way to do things like:
On Sun, Dec 5, 2010 at 8:26 PM, Robert McIntyre r...@mit.edu wrote:
If sets don't have a set ordering, then why should seq on a set always
return the same order for the same set?
If seq doesn't always return the a seq with the same order, then (nth
set 5) might be different than a future call
Here's my first attempt:
(defn all-vals [key coll]
(let [all-vals-w-key (partial all-vals key)]
(cond
(map? coll)
(concat [(key coll)] (all-vals-w-key (vals coll)))
(or (vector? coll) (seq? coll))
(apply concat (map all-vals-w-key coll)
Call it like so:
(fact
The above is using Midje syntax:
https://github.com/marick/Midje
--
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
On Sun, Dec 5, 2010 at 9:12 PM, Alex Baranosky
alexander.barano...@gmail.com wrote:
Hi guys,
I would like a function to be able to take an arbitrarily nested collection
and return a sequence of all values of a given key, such as :name, that
appears anywhere in the nested collection.
Does
On Sun, Dec 5, 2010 at 6:55 PM, HB hubaghd...@gmail.com wrote:
Ken Alex,
Why you aren't calling empty? when you want to check if a collection
is empty?
Isn't (if s) supposed to return true if s is empty ?
If coll is empty, (seq coll) and (next coll) are both nil, which is
logical false.
--
On Sun, Dec 5, 2010 at 10:03 PM, Ken Wesson kwess...@gmail.com wrote:
On Sun, Dec 5, 2010 at 9:12 PM, Alex Baranosky
alexander.barano...@gmail.com wrote:
Hi guys,
I would like a function to be able to take an arbitrarily nested collection
and return a sequence of all values of a given key,
HB hubaghd...@gmail.com writes:
OMG, this is too much Clojure code for me to handle O.o
Alex, you just killed me :)
Hehe, sorry. Just thought it might be helpful to show the progression
of dealing with all the little edge cases.
It perhaps looks much more fiddly, but you're doing more there
HB hubaghd...@gmail.com writes:
Ken Alex,
Why you aren't calling empty? when you want to check if a collection
is empty?
Here's the definition of empty? from clojure/core.clj:
(defn empty?
Returns true if coll has no items - same as (not (seq coll)).
Please use the idiom
Thanks for your input --- I'm hoping that some of this stuff is
already written with performance optimizations and the like.
I'm wondering if people have had experience with java libraries of
that sort and might have some recommendations.
Anyone use clojure for scientific data analysis? What do
Have you looked at Incanter? (http://incanter.org/)
On Dec 5, 3:27 pm, Robert McIntyre r...@mit.edu wrote:
I'm trying to use clojure for scientific data analysis but I keep
running into lacunas of functionality.
I'd love to hear the community's recommendations and experiences with this:
Is
On Mon, Dec 6, 2010 at 12:14 AM, Miki miki.teb...@gmail.com wrote:
Have you looked at Incanter? (http://incanter.org/)
Hmm, interesting. Is there a Rhetor too?
--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to
Really sorry about pasting the code in the email. It seems to have added 2-3
extra new-lines after every line .. :( .. but the same code is present in
the github-gist.
Sunil.
On Mon, Dec 6, 2010 at 10:57 AM, Sunil S Nandihalli
sunil.nandiha...@gmail.com wrote:
Hello everybody,
The following
Seems like the problem was with lein 1.4, see
https://github.com/technomancy/leiningen/issues#issue/142
On Dec 4, 8:21 am, Miki miki.teb...@gmail.com wrote:
Greetings,
My toy application stopped working after an upgrade to appengine SDK
1.4, does anyone else have the same experience? Any
When I saw the part about traversing an arbitrarily nested collection,
I immediately thought of clojure.walk (http://clojure.github.com/
clojure/clojure.walk-api.html). I ended up with this:
(use 'clojure.walk)
(defn all-vals [k coll]
(let [vals (atom [])
find-val (fn [form]
Always nice to see a fellow Neal Stephenson fan!
On Dec 5, 10:26 pm, Ken Wesson kwess...@gmail.com wrote:
On Mon, Dec 6, 2010 at 12:14 AM, Miki miki.teb...@gmail.com wrote:
Have you looked at Incanter? (http://incanter.org/)
Hmm, interesting. Is there a Rhetor too?
--
You received this
43 matches
Mail list logo