On Monday, October 27, 2014 9:25:30 PM UTC-6, Wei Hsu wrote:
This gist illustrates a problem I'm having where the channel is closed
after running into an exception, even if I put a try/catch block around the
block that generates the exception:
On Monday, January 20, 2014 11:55:00 PM UTC-7, Jarrod Swart wrote:
I'm processing a large csv with Clojure, honestly not even that big (~18k
rows, 11mb). I have a list of exported data from a client and I am
de-duplicating URLs within the list. My final output is a series of
vectors:
Clojure yet, but does a good
job of selling you on the many benefits of working here:
https://www.rallydev.com/careers/open-positions
Feel free to email me off-list with questions, or send me your resume and
I'll get it into the right hands.
- Chris Perkins
chrisperkin...@gmail.com
, but from apply, which appears to use a relatively enormous amount
of stack space.
I suspect that since AFn.applyToHelper dispatches on up to 20 arguments,
that stack space for all 20 is always used, even if you only pass, say, one
argument.
- Chris Perkins
--
--
You received this message
into a patch for data.xml, you are certainly welcome to do so. Having put
in the work, I would love to see this code get into a state where it could
actually be useful to someone. Unfortunately, I don't anticipate having
much time to do so myself in the near future.
- Chris Perkins
--
--
You received
On Tuesday, April 2, 2013 1:09:25 PM UTC-6, larry google groups wrote:
If Clojure is suppose to emphasize immutability, why can I do this:
kiosks-clojure.core= (let [
#_= mega (+ 1 1)
#_= mega (+ 1 mega)
#_= mega (+ 1 mega)
run out of memory parsing large documents. Also, I did some perf testing
and found it to be quite slow, but I never found time to investigate why.
I hope it's useful to you.
- Chris Perkins
--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post
On Thursday, June 7, 2012 1:53:30 PM UTC-4, Tom Hume wrote:
Hi
I'm trying to generate a sequence which corresponds to a breadth-first
search of a very wide, deep tree... and I'm hitting memory problems when I
go too far along the sequence. Having asked around on the IRC channel and
(doall (pmap ...)) nil). Apparently doall has a two-arg version, which
is news to me :)
- Chris Perkins
--
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
On Monday, April 30, 2012 12:19:00 PM UTC-4, Philip Potter wrote:
Note that, even though this works, $ is not a valid character in a
clojure symbol.
See
http://groups.google.com/group/clojure/browse_thread/thread/5af5d892f2e84212/0c5dc6b6a1578f07?#0c5dc6b6a1578f07
and
On Thursday, April 19, 2012 3:03:53 AM UTC-4, Evan Mezeske wrote:
That's great news that you got it to work. I can't make any sense of the
stack trace you're seeing with lein deps, though, unfortunately.
Other than installation, does the plugin seem to work (e.g. lein
cljsbuild once,
http://stackoverflow.com/questions/8707679/how-to-get-suppress-m-characters-in-my-clojurebox-emacsw32-repl-connected-to
--
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
There is an example of parser for a very small subset of SQL in one of the
unit tests for imparsonate, here:
https://github.com/grammati/imparsonate/blob/master/test/imparsonate/test/core.clj
- Chris
--
You received this message because you are subscribed to the Google
Groups Clojure group.
Here is one I wrote a while ago.
https://github.com/grammati/imparsonate
It's not finished (is open-source software ever really finished?), so I
don't know whether it will do what need it to.
- Chris
--
You received this message because you are subscribed to the Google
Groups Clojure group.
You should be calling Thread.start in the clojure version, not Thread.run.
Your set-timeout is just blocking for a while and then running the
passed-in function on the caller's thread.
- Chris
--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post
You may want to dig a little deeper into why reify was not working for you.
As far as I can tell, the classes created by reify do have a public, no-arg
constructor, as you require:
user (- (reify Runnable (run [_])) type .getConstructors seq)
(#Constructor public
Is there a way to pretty-print an object with its metadata?
If I (set! *print-meta* true) at the REPL, I can see the metadata. If I
use (pprint thing), I can see the structure much more easily. How can I do
both?
- Chris
--
You received this message because you are subscribed to the Google
Thanks Meikel.
So I guess from your reply that there is no built-in way to do this, right?
The objects I'm trying to inspect can be deeply nested maps and vectors,
and I want to see all the metadata - not just on the root object. I guess
I would have to either re-implement some of the logic
By looking at pprint.clj, I have come up with something that seems to work.
No hacking is necessary - the code in pprint is impressively clear and
extensible. It's obviously designed to allow exactly this sort of
extension to the printing mechanism.
user (defn ppm [obj]
(let
Good catch! I was about to add this to my personal toolkit of generally
useful random crap (every programmer has one of those, right?). I'll make
sure to cover that edge-case. Thanks.
- Chris
--
You received this message because you are subscribed to the Google
Groups Clojure group.
To
Norman,
Finalize is a protected method, so you can't call it. You get the same
error trying to call finalize on anything - it has nothing to do with proxy.
user (.finalize (Object.))
No matching field found: finalize for class java.lang.Object
- Chris
--
You received this message because
On Monday, January 16, 2012 6:12:34 AM UTC-5, Chris Perkins wrote:
Norman,
Finalize is a protected method, so you can't call it. You get the same
error trying to call finalize on anything - it has nothing to do with proxy.
user (.finalize (Object.))
No matching field found: finalize
On Saturday, December 3, 2011 12:16:43 AM UTC-5, Sean Corfield wrote:
On Fri, Dec 2, 2011 at 12:37 PM, George Jahad
clo...@blackbirdsystems.net wrote:
The easiest way to use cdt is from emacs, as described here:
http://georgejahad.com/clojure/swank-cdt.html
Could you add a note to clarify
I realize now that I just pasted the warning, but I was getting a class
loading exception too.
I seem to have solved it with this, in my project.clj:
:extra-classpath-dirs [/usr/lib/jvm/java-6-sun/lib/tools.jar]
I still get the warning, but it works now. Thanks Edmund.
- Chris
--
You
On Friday, September 23, 2011 8:00:36 AM UTC-4, Sam Aaron wrote:
I'd be very happy to write up a Getting Started tutorial on the ritz
wiki if I can get things working.
Sam
(two months later)
Not to publicly shame you or anything, Sam, but... how's that tutorial
coming along? :)))
On Saturday, December 3, 2011 9:50:21 AM UTC-5, Sam Aaron wrote:
I never did manage to get ritz working. I believe the issue was with ritz
- cake (I still use cake for Overtone hacking). However, now that cake
and lein are going to be united, we can just focus on lein support for the
You should be able to just change your macro to a function, remove the
backtick, and change (try ~expr ...) to (try (eval expr) ...).
- Chris
--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to
(recur (rest lista) ...)
here: ^^^
lista is always the same thing. You probably meant (recur (rest rst) ...).
- Chris
--
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
Wow. It will take a while to digest this before I can even dream of what
possibilities this opens up.
In the meantime, a couple of simple questions:
1) On the avout.io site, is the diagram of conflicting transactions
correct? It looks to me like the red arrow is in the wrong place (and it
It looks like those instructions are a bit out of date. The download does
not contain a clojure.jar - it contains clojure-1.3.0.jar.
Just put that after -cp, and it should work.
- Chris
--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to
My guess would be a clojure version mismatch, based on the stacktrace.
Have you tried changing your project to use clojure 1.2.1?
- Chris
--
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
I suspect that Windows users are a minority here, and cygwin users are a
minority of that minority :)
So I'm sure that help with maintaining cygwin compatibility would be
appreciated. You should start by sending a contributor agreement:
http://clojure.org/contributing
- Chris
--
You
On Monday, November 21, 2011 9:27:00 AM UTC-5, Michael Jaaka wrote:
now as tutorial on https://github.com/technomancy/clojure-mode states used:
M-x run-lisp
and got Searching for program: no such file or directory, lisp
any help?
Try using the instructions from the next section of
In a project just means that the active buffer in emacs is a file under
the project root. When you do clojure-jack-in, it will start from the
current file's directory, and look up through parent directories until it
finds a project.clj file.
--
You received this message because you are
I'm far from being an expert on this stuff, but I did go through all the
same frustration as you are going through, about 2 years ago, so I'll try
to help.
I think you have an old version of clojure-mode. The default archive that
comes with package.el is at http://tromey.com/elpa. It
On Monday, November 21, 2011 11:27:04 AM UTC-5, Michael Jaaka wrote:
Then I entered into Clojure project, used: M-x clojure-jack-in (almost
there!!!)
And got exception:
Unable to resolve symbol print-doc.
LOL :-)
Any suggestions?
Do you have the latest version of swank-clojure? Look in
Meikel,
That's very helpful. You and I took essentially the same approach - wrap a
real map and delegate most operations to it. You used deftype, which I
was afraid to try because there seemed to be too many interfaces and too
many methods to implement, so I used proxy and APersistentMap to
not use :session do not pay the cost of loading it.
Anyway, that's just the example that motivated the idea. Whether it turns
out to be useful in practice remains to be seen.
thanks,
- Chris Perkins
--
You received this message because you are subscribed to the Google
Groups Clojure group
It looks like your (:foo d) is a symbol. ((:foo d) 4 5) is trying to look
itself up as a key in the map you provided, which is 4. Since that's not a
map, the lookup fails and it returns the default value you provided: 5.
It's very forgiving that way :)
As for your main question, about how to
There are lots. You could start browsing from here:
https://github.com/languages/Clojure
- Chris
--
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
The problem is that inside your timed-agent function, test-func is not a
function - it is a one-element sequence containing your test function.
That's what using in the arguments vector does.
Try it like this: (defn timed-agent [limit timed-func [test-func]] ...)
- Chris
--
You received
On Tuesday, October 25, 2011 12:00:04 PM UTC-4, Tim Robinson wrote:
This code probably will not make a whole lotta sense since I reduced
it down to show only the problem at hand, but I'm hoping someone can
explain why this doesn't work the way I expected it would:
= (def data (atom {:k1
On Saturday, October 22, 2011 4:31:29 PM UTC-4, Luc wrote:
Where's the contract breach here ?
Glad you asked. Consider the following clojure session (1.3), shortened for
your reading pleasure:
map-1 = {-1 :yo}
map-2 = {-1 :yo}
key-1 = -1
key-2 = -1
Just some simple maps and values,
Perhaps I can clarify why the 1.3 behavior is confusing. For those who have
focused on issues like primitives need to be boxed, therefore you get a
long - I think you are missing Nathan's point. Here is what changed about
boxing in 1.3:
Clojure 1.2:
(class (Long/parseLong 1)) =
Wow. Easily the best conference talk I have seen... well, ever.
Executive summary: Mutability is bad for your complection. :)
- Chris
--
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
Alan, I'm with you on this one. Reflection is so much slower that sometimes
I wish clojure had a different syntax for reflective method invocation. For
example:
1) Make reflection an automatic error (not even a warning), and
2) Use another syntax (let's say double-dot, for the sake of
Tangentially: In this particular case, reflection isn't strictly necessary
because toString is a method of Object. In theory, the compiler could
special-case Object's methods and never do reflection, right?
In practice, I don't know if it's worth the effort, although it's certainly
a little
To put it another way: a top-level do is special-cased to compile and
then immediately execute each contained form, in order. Any other top-level
form, such as list, will be fully compiled, including all contained forms,
and only then executed. In this case, the defn cannot compile because the
Note: I forgot to preface that with I think... :) Upon experimenting
briefly, it turns out I was wrong about how Clojure works (that seems to
happen a lot with me). A declare/def defines a var even when it's not
executed!
user (defn xxx [] (declare yyy))
#'user/xxx
user yyy
#Unbound Unbound:
Nothing to do with try - clojure is trying to compile the whole top-level
form. Same thing happens with any top-level form (other than do, which is
special).
user (do (intern *ns* 'foo 23) foo)
23
user (when true (intern *ns* 'bar 44) bar)
; Evaluation aborted.
--
You received this message
core.clj currently contains two definitions of =, one of which is commented
out. The active one has this docstring:
Equality. Returns true if x equals y, false if not. Same as
Java x.equals(y) except it also works for nil, and compares
numbers and collections in a type-independent manner.
Follow-up question: Can someone explain the rationale behind the change to =
semantics between integers and floating-point numbers? I have read the
design page (
http://dev.clojure.org/display/doc/Documentation+for+1.3+Numerics), but all
it seems to have is this somewhat cryptic description:
Luc,
I think you are mistaken.
user= (clojure-version)
1.2.1
user= (def m {3.0 :a 3 :b})
#'user/m
user= (get m 3.0)
:a
user= (get m 3)
:b
user= (= 3 3.0)
true
user=
Do you have another example?
- Chris
--
You received this message because you are subscribed to the Google
Groups Clojure
Ok, I follow you now. That makes sense. Sort-of :)
On the other hand, it's only inconsistent if you consider clojure's = to map
to java's .equals method, but it does not:
user= (clojure-version)
1.2.1
user= (= 3 3.0)
true
user= (.equals 3 3.0)
false
So it doesn't really violate the contract
I am trying to upgrade some code to 1.3, and I'm not sure how to do the
equivalent of a 1.2-style equality comparison.
user (= {:foo 23} {:foo 23.0})
false
This used to be true. I see that = is now documented to compare same-type
numbers only, but == can be used for 1.2-compatible
On Friday, September 16, 2011 3:12:49 PM UTC-4, Brian Hurt wrote:
On Thu, Sep 15, 2011 at 6:42 AM, Chris Perkins chrispe...@gmail.comwrote:
On Wednesday, September 14, 2011 11:19:13 AM UTC-4, Brian Hurt wrote:
Say I have two name spaces, A and B, with A depending on B. I want to
test
On Wednesday, September 14, 2011 11:19:13 AM UTC-4, Brian Hurt wrote:
Say I have two name spaces, A and B, with A depending on B. I want to test
namespace A, replacing module B with a mock B for testing purposes-
preferably without having to load B at all (B sucks in a bunch of stuff,
, and have a weekly
reading assignment emailed. Then you could meet on IRC or something.
Just a thought.
Having said that, I don't have any specific suggestions for you, but
I'm also interested in seeing what answers you get.
- Chris Perkins
--
You received this message because you are subscribed
need to pass a symbol, rather than the
Class object itself? eg:
(defrecord Foo [a b])
(defn new* [klass args]
(clojure.lang.Reflector/invokeConstructor klass (to-array args)))
(new* Foo 23 hello)
#:user.Foo{:a 23, :b hello}
- Chris Perkins
--
You received this message because you
On May 9, 1:49 pm, Alan a...@malloys.org wrote:
On May 9, 9:50 am, Chris Perkins chrisperkin...@gmail.com wrote:
A mild gripe: we're in a language that doesn't make us use ugly names
like klass and clazz. Some will disagree with me for sure, but I think
it's more readable to simply use
cases, having eval pass unexpected types
through unchanged can be useful, but I think it would be much more
common for it to result in hard-to-debug errors, especially for
beginning macro writers.
- Chris Perkins
--
You received this message because you are subscribed to the Google
Groups
On Mar 10, 12:46 pm, Damien Lepage damienlep...@gmail.com wrote:
Hi
I wrote a function to transform a variable number of arguments into embedded
maps.
Here is what it does:
(enmap 1 2)
{1 2}
(enmap 1 2 3)
{1 {2 3}}
(enmap 1 2 3 4)
{1 {2 {3 4}}}
(enmap 1 2 3 4 {5 6 7 8})
{1 {2 {3
On Mar 8, 6:59 pm, Timothy Baldridge tbaldri...@gmail.com wrote:
If in a namespace I bind a var:
(def foo 3)
And then later on in my program re-bind that var:
(def foo 1)
Will all parts of my program instantly see that update? How is it
possible to have any sort performance when we're
On Mar 9, 7:31 am, Chris Perkins chrisperkin...@gmail.com wrote:
On Mar 8, 6:59 pm, Timothy Baldridge tbaldri...@gmail.com wrote:
If in a namespace I bind a var:
(def foo 3)
And then later on in my program re-bind that var:
(def foo 1)
Will all parts of my program instantly see
On Mar 8, 10:26 am, Fred Concklin fredconck...@gmail.com wrote:
Tests whether list is arithmetic progression.
Thoughts, feedback:
(defn arithmetic-progression? [intlist]
tests if list is arithmetic progression.
(apply =
(map
#(apply - %)
(partition 2 1 (reverse
I am wondering whether this is a known issue. I made the mistake of
extending a protocol to two interfaces, and then calling it with an
object that implements both.
(defprotocol Foo
(foo [x]))
(extend-protocol Foo
clojure.lang.Sequential
(foo [x] sequential)
clojure.lang.Associative
On Feb 28, 10:49 am, Rich Hickey richhic...@gmail.com wrote:
On Feb 28, 2011, at 8:32 AM, Chas Emerick wrote:
I agree with your sentiment. This has been discussed before here:
http://groups.google.com/group/clojure-dev/browse_frm/thread/fb3a0b03...
That discussion pretty quickly wandered
On Feb 11, 5:07 am, Marko Topolnik marko.topol...@gmail.com wrote:
http://db.tt/iqTo1Q4
This is a sample XML file with 1000 records -- enough to notice a
significant delay when evaluating the code from the original post.
Chouser, could you spare a second here? I've been looking and looking
On Nov 27, 6:24 am, Sunil S Nandihalli sunil.nandiha...@gmail.com
wrote:
Hello,
I would like to know if it is possible to find out the name of the
structure from its instance. my attempt to use the function class is not
giving me any useful info. It kept saying that it is a structmap and
On Nov 26, 12:25 am, Sunil S Nandihalli sunil.nandiha...@gmail.com
wrote:
I just realized that we don't need to use the with-symbol-macros when using
symbol-macrolet .. but the problem persists all the same.. I have modified
the gist to reflect this change..
Sunil.
On Fri, Nov 26, 2010 at
On Nov 23, 12:03 pm, Zach Tellman ztell...@gmail.com wrote:
When writing Calx [1], I discovered it was a huge pain to deal with
mixed C datatypes in Java. When writing Aleph [2], I discovered the
problem increases by a factor of ten when dealing with streams of
bytes. In an attempt to
On Nov 23, 3:24 pm, Zach Tellman ztell...@gmail.com wrote:
On Nov 23, 12:12 pm, Chris Perkins chrisperkin...@gmail.com wrote:
I have only taken a quick look, so maybe I'm misunderstanding the
intent, but it's not clear to me how you would use this for sending
and receiving structured data
On Nov 18, 11:09 pm, Ken Wesson kwess...@gmail.com wrote:
I got this oddity while debugging a Clojure sourcefile today:
user= right click load file in netbeans
#CompilerException java.lang.IllegalArgumentException: Parameter
declaration loop should be a vector (io.clj:55)
user=
You're
On Nov 8, 4:45 pm, Greg g...@kinostudios.com wrote:
I must say it would be really nice if this was considered kosher.. as it does
work just fine. It would also be useful to know why transient bashing is
frowned upon.
It's not that it's frowned upon - it simply doesn't work. Functions
that
On Oct 30, 2:52 am, Shantanu Kumar kumar.shant...@gmail.com wrote:
Hi,
1. I notice there is just the parse function mentioned as
public:http://clojure.github.com/clojure/clojure.xml-api.html
I used the other functions in clojure.xml (emit, emit-element) and the
var 'element' -- they appear
On Oct 14, 11:54 am, Henk henkp...@gmail.com wrote:
(I did some small benchmarks on this), while the list comprehension
itself is much faster than python...
Not an answer to your question, but: depending on what you mean by
much faster, there is a good chance that you measured the clojure
for
On Oct 1, 3:59 am, Stefan Rohlfing stefan.rohlf...@gmail.com wrote:
I wanted to expand the 'infix' macro presented in chapter 7.3.1 of
'Clojure in Action' to handle nested s-expressions:
My first version did not work:
(defmacro my-infix [expr]
(if (coll? expr)
(let [ [left op right]
On Jun 28, 12:21 am, Mark Engelberg mark.engelb...@gmail.com wrote:
OK, I just tried building clojure-contrib pointing at a clojure.jar
built from the current master branch. I get the same errors (on
Windows). Here are more details:
Testing clojure.contrib.test-io
FAIL in (test-as-url)
On Jun 17, 12:24 am, Phil Hagelberg p...@hagelb.org wrote:
Mostly I'd like feedback on the
tutorial:http://github.com/technomancy/leiningen/blob/master/TUTORIAL.md
But if you've got some time to look over the readme, that would be
great
On Jun 18, 1:21 pm, Phil Hagelberg p...@hagelb.org wrote:
On Fri, Jun 18, 2010 at 8:20 AM, Chris Perkins chrisperkin...@gmail.com
wrote:
This sentence in the README: On Windows you can download lein.bat
contains a link to an old and busted version of lein.bat that can only
lead to tears
clojure.main.
I've never used jline, so I'm afraid I can't help much, but I would
recommend using ClojureBox for your repl. Even if you don't want to
edit your files in Emacs, it's worth getting ClojureBox just for that.
- Chris Perkins
--
You received this message because you are subscribed
On Apr 28, 4:56 am, Marko Srepfler marko.srepf...@gmail.com wrote:
C:\clojure-1.1.0java -cp jline-0.9.91.jar:clojure.jar
You need to separate your classpath entries with a semicolon, not a
colon.
- Chris Perkins
--
You received this message because you are subscribed to the Google
Groups
the lawyers, I hope :) Oh,
the joys of working for a big company.
- Chris Perkins
--
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
[1]
- Chris Perkins
--
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
of it is. A concrete example
explaining the why would help a lot.
- Chris Perkins
--
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
On Mar 4, 8:33 am, Jan Rychter j...@rychter.com wrote:
I haven't hacked on new Clojure stuff for the past two months or
so. Now, having updated my repositories, I find that everybody just
dropped ant and moved to leiningen.
How do people deal with this?
I don't have any good answers for you;
On Feb 19, 4:32 am, timc timgcl...@gmail.com wrote:
Is #= an undocumented reader macro character?
Interesting - I had never heard of it either. It appears to allow you
to execute code at read-time.
user= (read-string (foo (+ 2 3) bar))
(foo (+ 2 3) bar)
user= (read-string (foo #=(+ 2 3) bar))
On Feb 16, 5:51 pm, Ram rve...@gmail.com wrote:
I'm having an issue compiling clojure-contrib on Windows.
I downloaded the code from the git repository and when I run Maven,
after compilation it runs through the test suite fails in test-io:
FAIL in (test-as-url)
88 matches
Mail list logo