Hi Randall,
Am 12.12.2008 um 23:29 schrieb Randall R Schulz:
I guess what you should say at least is that it requires Ruby and the
Vim Ruby module / extension / whatever. Unfortunately, neither of the
systems I use have that in their Vim builds.
From the vim.org page, where you can download
On 12 Dec 2008, at 23:10, Mark Fredrickson wrote:
For (2), say I want to insert 3 before every item less than or equal
to 5 in a seq:
Again reduce to the rescue:
(reduce into (map (fn [i] (if (= i 5) [3 i] [i])) [24 6 5 5 7 5 8
2]))
Could use mapcat:
(def bar [24 6 5 5 7 5 8 2])
Using up-to-date clojure and swank-clojure, I've not been able to use
read-line:
- In Emacs (with Slime / swank-clojure), (read-line) never stops
consuming inputs
- Running clojure directly from a terminal console, (read-line) always
returns
This exception is also thrown when starting Swank:
--- On Sat, 12/13/08, Stephen Parker wrote:
On 12 Dec 2008, at 23:10, Mark Fredrickson wrote:
[...] insert 3 before every item less than or equal to 5 in a seq:
(def bar [24 6 5 5 7 5 8 2])
(insert-before-if #(= 5 %) 3 bar)
= (3 24 3 6 3 5 3 5 3 7 3 5 3 8 2)
Er...
Dave
Yes, the semantics of a sequence force it to be immutable :
Seqs differ from iterators in that they are persistent and
immutable ( http://clojure.org/sequences )
So there's simply no need to have a copy function for sequences (or
for any other clojure data structure).
HTH,
--
Laurent
On 13
Hello,
I wanted to know if I was alone thinking that 'mapcat' should better
have been named 'catmap' ?
When reading code, this looks more natural because it resembles the
functional composition of the 2 functions : (cat (map ...))
I know this is an inheritence from older lisp dialects, but
On Dec 13, 2008, at 2:18 AM, Mark Engelberg wrote:
On Fri, Dec 12, 2008 at 9:28 PM, Rich Hickey richhic...@gmail.com
wrote:
I think it's very important not to conflate different notions of
sequences. Clojure's model a very specific abstraction, the Lisp
list,
originally implemented
On Saturday 13 December 2008 00:10, Meikel Brandmeyer wrote:
Hi Randall,
...
For your problem with the ruby-enabled vim: at least
debian has a vim-ruby package, IIRC. So maybe Suse
has this also.
I installed a couple of new packages on my 10.3 box and
now vim --version reports +ruby, so
Right... I realize there is absolutely no need to actually do this, it
was more of an exercise in understanding ways to iterate over seqs.
For example, I might want to do something else than a straight copy.
Thanks for the replies...
On Dec 13, 8:12 am, lpetit laurent.pe...@gmail.com wrote:
Hello,
While reading the book, I came across the phrase
true? tests whether a value is actually true, not
whether the value evaluates to true in a boolean context. The only
thing
that is true? is true:
(true? true)
- true
(true? foo)
- false
Be careful with predicates ...
My question is what's
On Dec 12, 9:51 pm, levand luke.vanderh...@gmail.com wrote:
So, I'm trying to understand functional programming, particularly as
it relates to the seq abstraction, and I'm hitting a slight difficulty
as I'm playing around - something that seems as if it ought to be
simple, is not.
I'm
I've had a really quick look at your mode, it looks good, and I like the
regularity in keyword highlighting. I'm going to have a proper look sometime
later on the weekend and will get back to you when I have done.
Kind Regards,
David.
2008/12/12 Daniel Spiewak djspie...@gmail.com
Sounds
Hi,
Am 13.12.2008 um 15:07 schrieb Randall R Schulz:
I installed a couple of new packages on my 10.3 box and
now vim --version reports +ruby, so I guess I can at least give it a
try there (that's not my primary box, though it is the faster one).
Unfortunately, vim by itself cannot do, what I
I wrote a simple word counter described here http://ptrace.fefe.de/wp/
it reads stdin and counts the occurrences of words, however I notice
that it runs significantly slower than the java version in the link.
I was wondering why there is such a dramatic difference. The approach
I took was to
On Dec 13, 4:11 pm, levand luke.vanderh...@gmail.com wrote:
Right... I realize there is absolutely no need to actually do this, it
was more of an exercise in understanding ways to iterate over seqs.
For example, I might want to do something else than a straight copy.
map is a good way to
On Dec 13, 4:26 am, Michel Salim michel.syl...@gmail.com wrote:
Using up-to-date clojure and swank-clojure, I've not been able to use
read-line:
- In Emacs (with Slime / swank-clojure), (read-line) never stops
consuming inputs
- Running clojure directly from a terminal console,
On Dec 13, 10:41 am, Dmitri dmitri.sotni...@gmail.com wrote:
I wrote a simple word counter described herehttp://ptrace.fefe.de/wp/
it reads stdin and counts the occurrences of words, however I notice
that it runs significantly slower than the java version in the link.
I was wondering why
On Dec 13, 8:28 am, lpetit laurent.pe...@gmail.com wrote:
Hello,
I wanted to know if I was alone thinking that 'mapcat' should better
have been named 'catmap' ?
When reading code, this looks more natural because it resembles the
functional composition of the 2 functions : (cat (map ...))
On Dec 13, 9:27 am, wubbie sunj...@gmail.com wrote:
My question is what's the usage for ture?. I don't see a meaningful
example on usage of true?
At the very least, when you have to interface with Java? Also, your
code might use true as a special value -- say as values inside a key
to
I'm sure I'm doing something stupid but I can't start up gorilla.
Exception in thread main java.lang.NoClassDefFoundError: de/kotka/gorilla
Caused by: java.lang.ClassNotFoundException: de.kotka.gorilla
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at
Hi,
Am 13.12.2008 um 17:17 schrieb Brian Doyle:
Here is my script:
java -cp ~/share/clojure.jar:~/share/clojure-contrib.jar:~/share/
gorilla.jar de.kotka.gorilla
I can reproduce the issue. The ~ is a shellish feature
from Unix. It is only expanded at the start of a word.
So the first ~ in
On Sat, Dec 13, 2008 at 11:17 AM, Brian Doyle brianpdo...@gmail.com wrote:
I'm sure I'm doing something stupid but I can't start up gorilla.
Exception in thread main java.lang.NoClassDefFoundError: de/kotka/gorilla
Caused by: java.lang.ClassNotFoundException: de.kotka.gorilla
at
Konrad,
I got your code to work by doing the following:
Replaced with-monad with:
(defmacro with-monad
[name exprs]
(let [bind-sym 'm-bind
result-sym 'm-result
zero-sym 'm-zero
plus-sym 'm-plus]
`(let [~bind-sym (:m-bind ~name)
~result-sym (:m-result
On Saturday 13 December 2008 08:17, Brian Doyle wrote:
I'm sure I'm doing something stupid but I can't start up gorilla.
...
Here is my script:
java -cp
~/share/clojure.jar:~/share/clojure-contrib.jar:~/share/gorilla.jar
de.kotka.gorilla
Tildes don't expand anywhere but at the beginning
Thanks Meikel, removing the ~'s worked. Oh and thanks for vimclojure and
gorilla!
On Sat, Dec 13, 2008 at 9:28 AM, Meikel Brandmeyer m...@kotka.de wrote:
Hi,
Am 13.12.2008 um 17:17 schrieb Brian Doyle:
Here is my script:
java -cp
On Dec 13, 9:41 am, Dmitri dmitri.sotni...@gmail.com wrote:
...
The slowdown seems to occur in the inc-count
function, where it updates the map using the assoc. Is this not a
proper way to approach this in clojure?
(recur (time (inc-count words head)) tail
You're pretty
I added the time call later on to find what was taking up the cycles,
I also checked the reverse, it's impact is minimal, the print-words
part of the program runs fast, but the read-words takes the majority
of the time.
On Dec 13, 12:38 pm, Jeremy Dunck jdu...@gmail.com wrote:
On Dec 13, 9:41
thanks for pointing this out, and I absolutely appreciate the example.
I'm still new to functional approach and I always like to see how
things are done properly.
On Dec 13, 1:15 pm, Chouser chou...@gmail.com wrote:
On Sat, Dec 13, 2008 at 10:41 AM, Dmitri dmitri.sotni...@gmail.com wrote:
I
I'm looking at the terminal case. It's the difference between running
clojure.lang.Repl and clojure.main (which runs a repl by default). The
reading done by the latter is intended to be identical to the reading
done by the former but isn't in the case of read-line. If anyone sees
the fix
On 13 déc, 17:03, Michel Salim michel.syl...@gmail.com wrote:
On Dec 13, 8:28 am, lpetit laurent.pe...@gmail.com wrote: Hello,
I wanted to know if I was alone thinking that 'mapcat' should better
have been named 'catmap' ?
When reading code, this looks more natural because it resembles
Fellow clojurecrats,
I'm here to ask for python style triple-double-quotes syntax in clojure.
For those unfamiliar they're documented here:
http://docs.python.org/reference/lexical_analysis.html#strings
This is also a nice summary:
Konrad,
I've looked over your monad code and I like it, FWIW.
The macro programming will twist your mind if you don't have
experience writing Lisp style macros, but the resulting syntax seems
pretty clean.
I would make some minor changes in two places. I would write with-
monad as:
(defmacro
On Dec 12, 2008, at 3:24 PM, Stuart Sierra wrote:
It's been a month since Clojure rev. 1094 introduced the namespace-is-
file change. Are people still using releases that require the old
contrib directories, or can we safely delete them?
They're gone now as of SVN rev. 299.
-Stuart Sierra
Did you ever get this resolved? I just had the same thing start
happening to me today, after not experiencing any problems with it as
recently as yesterday. (What changed? I tried to install swank.
Nuking swank did not fix the problem, tho.) Step by step:
(add-classpath ...) ; seems to work,
Really? I get:
(last (copy-seq (range 10)))
- 9
I'm running inside of VirtualBox assigned very little memory. Maybe
that's why? I'll run some more tests. I know I have been able to get
up to 3000 levels of recursion without a stack overflow, once, at
another time.
In any case, it's
On Saturday 13 December 2008 14:29, levand wrote:
...
Calling reverse when done is still O(N)
Really? Maybe my grasp of big-O notation is faulty, but isn't the
recursive function itself O(n), and then a reversal another O(n)
operation on top of that, leading to two complete traversals of
On Saturday 13 December 2008 15:35, Randall R Schulz wrote:
...
Any algorithm that requires to O(n) steps is itself O(n).
And by that I meant ...two O(n) steps..., of course.
The big-O concept is roughly equality up to a constant factor.
Randall Schulz
Hi,
thanks for Clojure! Here's my first contribution (CA filled out and
will arrive next week):
Negating Integer.MIN_VALUE overflows but should return a BigInteger.
It also affects binary subtraction since Clojure implements it using
negation and addition. The overflow occurs silently
On Dec 13, 2008, at 2:10 AM, Meikel Brandmeyer wrote:
Hi Randall,
Am 12.12.2008 um 23:29 schrieb Randall R Schulz:
I guess what you should say at least is that it requires Ruby and the
Vim Ruby module / extension / whatever. Unfortunately, neither of the
systems I use have that in their
On Saturday 13 December 2008 17:19, Drew Olson wrote:
...
You can also compile vim from source with the +ruby flag
Yes, of course, but that's a bridge too far.
- Drew
RRS
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the
On Sat, Dec 13, 2008 at 7:06 PM, Dan Larkin d...@danlarkin.org wrote:
Yes, I'd like the feature because it's a pain in the neck to go
through and escape strings when I know there's a better way.
Also sometimes it doesn't feel right to escape strings... for instance
in function doc strings
On Sat, Dec 13, 2008 at 6:39 PM, Chouser chou...@gmail.com wrote:
On Sat, Dec 13, 2008 at 4:46 PM, Mark Volkmann
r.mark.volkm...@gmail.com wrote:
I just updated to the latest version of clojure-contrib. show works
for me, but source doesn't. Here's what I did.
(require
I've got an issue where the clojure.xml/parse and /emit functions are
not symmetric with respect to how attributes are read and written.
The parser decodes HTML entities (e.g. amp; - ) however the emitter
does not re-encode them:
user (require ['clojure.xml :as 'xml])
nil
user (xml/emit
On Dec 14, 6:06 am, Dan Larkin d...@danlarkin.org wrote:
Yes, I'd like the feature because it's a pain in the neck to go
through and escape strings when I know there's a better way.
For escaping strings, I prefer ruby's solution, which is to have
reader support for arbitrary delimiters,
So I'm going to stop pretending like I'm an expert and actually post
some Clojure code. Be constructively critical 'cause I'm a n00b in
that regard ;-) This is a pseudorandom number generator for the
Gaussian (0,1) distribution.
(defn next-gaussrand-state [current-
state]
^{:doc Given the
45 matches
Mail list logo