> reloading code at the REPL, because old background threads may still be
> running with old code. So I end up restarting the process many times per
> day.
I usually create a 'restart fn that closes down the background threads
and services and restarts them.
This might require you to add a 'shutdo
Fascinating!
--
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, send e
I use nailgun to solve the jvm startup time. It works very well.
When I'm editing a 'script' in vimclojure I just hit \ef and my 'nail'
is instantly compiled and available at the command line.
It's about as painless as possible.
I do create a small bash wrapper for each clojure script. The bash
Nice!
--
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, send email to
Excellent news.
--
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, sen
I didn't see mention of the new equals/equiv work.
Is this going into a later beta or is this work tentatively going into
a later release?
--
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
No
> @Mark S
> Logging is something I've been very interested in at various points in
> the past, usually when an application goes wrong in production and I
> have to figure out what went wrong!
>
> I think we need to discard the notion that logs should be timestamped
I still like timestamps even wit
>
> 1. Have you written, or are you writing, a web application that uses
> Clojure? What does it do?
I've created a commercial app that has the server side written start
to finish in Clojure. It leverages the existing calendaring and
scheduling functionality of ScheduleWorld - which was written i
> available athttp://github.com/ztellman/calx.
Nice!
--
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 pos
> A flag like *warn-on-boxing* can help to identify these spots. These works
> for all kind of things. Not only for contrived fact and fib exampls.
+1.
I think something like *warn-on-boxing* would be helpful. I'd use it.
--
You received this message because you are subscribed to the Google
Gro
> :s /non-prime/non-primitive/g
Oh, nvm. You were referring to '.
Cheers.
--
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 patien
> I have to say I'm in the 'pay for what you use' camp - you need a box,
> you ask for one. If I don't (and neither do any of those loops), why
> should I have to do extra work to avoid it?
+1
Barely worth mentioning:
:s /non-prime/non-primitive/g
--
You received this message because you a
On May 20, 10:57 pm, Mibu wrote:
> I tried to use Long keys from the java.io.File/length method in a hash-
> map and failed to retrieve values using them. sorted-map is fine. The
> doc says hash-maps require keys that support .equals and .hashCode.
> Doesn't Long support those or am I missing so
On May 13, 4:32 pm, Brian Watkins wrote:
> Okay, I can get that stack trace, but there's no line for clojure.core/
> divide in your trace. How would I know which function threw the
> exception? "eval" isn't very useful. Ideally I'd like a line number,
> too.
Right. It's strange I've never ev
On May 13, 6:11 am, Brian Watkins wrote:
> What is the method that gets line numbers and function names into
> stack traces? I know I can't get them in the Repl (because there
> aren't any), but I tried loading my file with load-file and that
> doesn't help either.
It's there; Clojure binds th
> or as-str from c.c.java-utils (I think)
Good one. It's in string.clj in the latest git.
I've needed this before too. There is so much good stuff in contrib. I
think I have to allocate 30 minutes every day and just try to commit
c.c. to memory.
--
You received this message because you are subs
On May 6, 2:44 pm, Sean Devlin wrote:
> Okay, next guy to mention name gets shot. Nothing personal.
>
Ok, but have you considered using name?
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups
On Apr 29, 9:57 am, Stuart Halloway wrote:
> Agreed: Rich's explanation is the more important bit.
>
> My point is that we may be wasting time arguing about something that
> nobody actually does. If idiomatic usage changes as the community
> grows, we *could* add a collection-generic contain
On Apr 29, 4:21 am, ataggart wrote:
> I know it won't matter, but for posterity if nothing else...
>
> Functions named contains-key? and contains-val? would make a lot more
> sense to me than the current contains? and new seq-contains?. Anyone
> looking at contains-val? should expect it to be O
>> You can no
>> longer take a generic approach to information processing. This results
>> in an explosion of needless specificity, and a dearth of reuse."
> For this reason, I've always found appealing languages which let you
> optionally write getter/setter methods that "hook into" the standard
Minor errata barely worth mentioning:on the page: http://clojure.org/datatypes
employeee.getName()
employeee needs just 2 'e' characters.
Cheers.
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegro
On Apr 9, 9:31 am, Alen Ribic wrote:
> I came across this
> posthttp://www.baptiste-wicht.com/2010/04/java-7-more-dynamics/
> and though this would be a good place to share.
The article seems to say that using this API instead of reflection
will make dynamic calls "almost the same as a standard
On Apr 6, 6:23 pm, Stuart Halloway wrote:
> Have you seen destructuring of rest args in the current master branch?
>
> (defn foo [& {:keys [a b c]}] [a b c])
>
> (foo :a 1 :c 3)
> => [1 nil 3]
... that's beautiful.
I hereby cast my vote into the void: release often; release 1.2
soon. :-)
--
I think Clojure should provide more information when certain error
conditions occur. Example:
(when-not (= (Integer. (:userid json)) (Integer. (:userid a-user)))
NOTE: (:userid a-user) is always some sort of number.
(:userid json) is always a String.
After testing (Integer. (:userid a-user)) _so
- value of x supplied at the from of the given arguments. The forms
+ value of x supplied at the front of the given arguments. The forms
--
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
On Mar 1, 7:00 am, James Reeves wrote:
> On Mar 1, 2:19 am, MarkSwanson wrote:
>
> > For an example outside of JSON: recently Compojure changed how it
> > works so the HTTP request properties are all converted to keywords by
> > default. I can see the appeal, but now an
> separators = "(" | ")" | "<" | ">" | "@" | "," | ";" | ":" | "\" |
> <"> | "/" | "[" | "]" | "?" | "=" | "{" | "}" | SP | HT
>
> As far as I can see, all valid HTTP headers are thus valid Clojure
> keywords. You don't have to worry.
According to the Clojure reader page SP and HT are not a
On Feb 28, 10:34 am, joshua-choi wrote:
> As a small note, according tohttp://clojure.org/reader, Clojure
> keywords and symbols are allowed to contain only alphanumeric
> characters, *, +, !, -, _, and ?. Spaces aren’t allowed, but the
> keyword function allows them anyway because it doesn’t do
works, and so does (get m (keyword "a b c")) - on an
appropriately created map
Cheers.
On Feb 27, 3:55 pm, MarkSwanson wrote:
> Hello,
>
> Consider the following valid JSON:
>
> Clojure=> (def mq "{\"Question one\":\"test\"}")
> #
Hello,
Consider the following valid JSON:
Clojure=> (def mq "{\"Question one\":\"test\"}")
#'user/mq
Clojure=> (read-json mq)
{:Question one "test"}
So the default behaviour fails to work correctly for a common case.
The Clojure failure is not exactly obvious either:
(read-string (str mq))
r
I am unable to view the API docs reliably with firefox 3.0 (I can not
use my scroll wheel with the Clojure API page - it's the only page on
the net that I know of that behaves this way). So I use konqueror to
view the Clojure API docs. I thought it was just my Ubunut 9.04 box so
I wasn't going to m
Just a thought: maybe this is a sign a clearer message should be
placed on the Clojure contributing page. In any case, it can't hurt to
be more clear can it?
FYI I've submitted a couple of small patches to this group and read
the contributors agreement and the SCA FAQ. After going through this
pro
http://mina.apache.org/
--
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 gr
I'm porting some Java code that uses >>>.
Is there a way to do this in Clojure?
FYI: http://java.sun.com/docs/books/tutorial/java/nutsandbolts/opsummary.html
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure
> >> See if this makes a difference:
> >> syntax sync fromstart
I think one of the primary objectives of vimclojure should be to
consistently render correctly - and it can only do that with 'syntax
sync fromstart'.
--
You received this message because you are subscribed to the Google
Groups "Clo
> Does anyone know why if the first character in my *.clj file is '#', then
> when I open it in VIM, ClojureVIM fails to recognise it as a Clojure file?
I don't know why, but I can provide this data point:
It does not do that for me.
Vim 7.2, vimclojure 2.1.2, java 6.0.14
--
You received this me
> I wouldn't bother. The semantics are essentially what the present docs say;
> it's just that where calling seq on its argument would just call a method
> whose body is "return this;" it skips that no-op for efficiency. (At least,
> the body of ASeq.seq() is "return this;"; are there any ISeq im
On Nov 5, 7:00 pm, MarkSwanson wrote:
> (def
> #^{:arglists '([coll])
> :tag clojure.lang.ISeq
> :doc "Returns a seq of the items after the first. Calls seq on its
> argument. If there are no more items, returns nil."}
> next (fn next [x] (. clojur
(def
#^{:arglists '([coll])
:tag clojure.lang.ISeq
:doc "Returns a seq of the items after the first. Calls seq on its
argument. If there are no more items, returns nil."}
next (fn next [x] (. clojure.lang.RT (next x
PROBLEM: seq is not called on its argument.
I think the second
>
> but you can certainly send them the result of (quot 1257316459070 1000).
Wohoo!!! I just wanted a way to do it!
Thanks!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send
Hello,
This should work (I think): (unchecked-divide 1257316459070 1000)
http://groups.google.com/group/clojure?hl=en
-~--~~~~--~~--~--~---
> I'd love to hear success stories from people using nailgun to actually
> run frequent scripted tasks out of cron, as opposed to for
> development. It would make clojure more palatable for my work
> environment.
Nailgun has been a boon to me. I don't believe Nailgun has a problem
with dynamic cl
Thanks for the link.
I read somewhere that Rich asked folks to vet stuff on this Google
Group first, so that's why I posted it here.
I previously posted a "patch" to Clojure here and Rich applied it. I
didn't have to do the CA, and if posting my patches into the public
domain works - then please
This seems like an even better place to post it:
http://paste.lisp.org/display/89307
--~--~-~--~~~---~--~~
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
Not
That's interesting.
I ran this against a quoted Clojure fn of mine and received 92.
I'm curious (general Clojure question) about your use of the quoted
form. The Clojure docs state that this results in an unevaluated form,
but I had trouble finding more details on this. F.E. I'd like to run
count
Ok, I see now I should not post patches here because it messes up the
formatting. I can't seem to find an option to paste text.
I've placed the patch here:
http://www.scheduleworld.com/sw2/arity.patch.gz
--~--~-~--~~~---~--~~
You received this message because yo
Thanks Lauri. I was stuck on this too.
FYI this issue prompted me to submit a patch to improve the arity
error message:
http://groups.google.com/group/clojure/browse_thread/thread/de969a419a535a82
--~--~-~--~~~---~--~~
You received this message because you are s
Hello,
Someone recently posed the question: (why doesn't this work)
(into {} (map #([% (* % %)]) [1 2 3 4]))
(reference:
http://groups.google.com/group/clojure/browse_thread/thread/7d3ee57ee8041353)
The error message was:
Caused by: java.lang.IllegalArgumentException: Wrong number of args
pass
I'm confused about the slide on barging:
"txnB has a status of RUNNING and can be changed to KILLED".
Are you implying that simply having a status of RUNNING is all that is
required for the txn to be killed?
Or, are there other requirements to "can be changed"?
I'm having a hard time wrapping m
Grats. Clojure is amazing.
--~--~-~--~~~---~--~~
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 pat
line: ~476
else {
Class c = coll.getClass();
Class sc = c.getSuperclass();
throw new IllegalArgumentException("Don't know how to create
ISeq from:" + c.getSimpleName() + " / " + c.getName());
}
Rationale: getSimpleName() doesn't provide anything useful when 3rd
pa
> As far as the "sync fromstart" is concerned: I also use this setting
> normally and never had problems. But since there might be a
> performance hit, I didn't want to make it the default in VC. Did
> others experience any slowdown? Or should I assume that modern
> computers are fast enough and
Edit: After using this it seems it didn't stick (or is not always
used?). More searching revealed that putting this in your ~/.vimrc
will work:
(and it seems to work for me - and I don't notice rendering slow down
at all)
autocmd BufEnter * :syntax sync fromstart
Found from here:
http://vim.wiki
0. Perhaps it should go without saying: start with vimclojure and the
vim settings it recommends.
1. syntax sync minlines=200
This made a big difference for me. Without it I would always see
brackets marked as 'not paired' or code as a big red text string
because the syntax parser wouldn't l
On Oct 7, 2:59 am, ngocdaothanh wrote:
> Mark,
> What tool did you use to see the CPU utilization, especially when the
> test run time is so short?
>
> Just curious.
I used the CPU utilization monitor in Linux.
I adjusted the loop so it took about 5-7 seconds.
--~--~-~--~~
Excellent job. It worked ootb for me once I updated my classpath / -
Djava.library.path. I'm running 64-bit Linux with (in this case) the
32-bit JVM as it seems more stable with jogl.
Q: I thought the blue and green pieces were supposed to be opposite.
Penumbra is such a fascinating library. Nice
> (You wrote "atom" several times but I guess you meant "agent".)
Heh heh... yeah.
--~--~-~--~~~---~--~~
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 th
Good catch. I had forgotten that.
I did some more tests with 4 queues and found that there seemed to be
some contention going on that prevented all cores from being utilized
fully.
With the example provided 2 cores will pin at 100% (excellent). With 4
atoms and one test fn one core will stay arou
Thanks John.
I was curious about the details so I took a dive in to the source to
see for myself.
In case anyone else stumbles upon this here's what I found:
In Agent.java, the number of worker threads for (send) are defined
like this:
final public static ExecutorService pooledExecutor =
To expand on Meikel's nice explanation:
(to see if I understand correctly)
1. (defn baz ...)
2. (binding [foo bar] (baz [1 2 3])) - dynamically binds foo and
creates a lazy-seq response to the baz fn. Because map is lazy the [1
2 3] sequence is actually not read by anything within the binding
d
On Oct 5, 2:45 am, ngocdaothanh wrote:
> I think it is not "spawn about 20K agents / second", it is 20K message
> passings / second. The number is about that of Erlang.
As Clojure uses a thread pool for agents I agree 'spawn' was the wrong
word. Thanks for the correction.
--~--~-~--~---
I recently integrated Clojure with two async messaging systems.
I wound up doing "send" operations through a Clojure agent.
I was curious how many agents I could spawn per second and found I
could spawn about 20K agents / second.
Code for testing:
(def t (agent true))
(defn tt [_ num]
(try
In case others wonder how do file a ticket on Assembla:
1. sign up for an Assembla account at www.assembla.com
2. Ack the signup email
3. go to : https://www.assembla.com/spaces/clojure-contrib/tickets
4. look for the 'create ticket' button.
Then tell me where it is so I can also file a ticket. H
Confirmed. I'm using clojure from git:
$ git status
# On branch master
nothing to commit (working directory clean)
I also tried with the ':'
Clojure=> (count {:1 nil :2 nil :3 nil :4 nil :5 nil :6 nil :7 nil :8
nil :9 nil})
0
--~--~-~--~~~---~--~~
You received t
Hello,
I'm trying to use tst/tap.clj but the tap output does not contain the
'not ok' line.
I think this is a bug in tap.clj. Here is the small test:
(ns tc
(:use [clojure.test]))
(deftest addition
(is (= 4 (+ 2 2)))
(is (= 8 (+ 3 4
>(use 'clojure.test)
>(use 'clojure.t
Environment: vimclojure-2.1.2. clojure from git as of a few days ago.
Running the tests in a plain REPL from the command line worked
perfectly!
-=* THANKS GUYS !!! *=-
I wasn't expecting this at all. I thought the REPL in vimclojure
actually supported stdout because this works:
> (def a "abc")
#
Hello,
I'm having trouble unit testing clojure code. To be sure I'm just
testing clojure.test, I'm trying to test clojure.contrib.json.read.
test.clj states:
;; RUNNING TESTS
;;
;; Run tests with the function "(run-tests namespaces...)":
(run-tests 'your.namespace 'some.other.namespace)
Thanks for the note about read-string and the example.
If I only had to consider Clojure I'd probably use that.
The Clojure structures are going to be persisted to/from a DB, and
then also read back (and maybe updated) later using other languages.
The tools I prefer to use for this are based on XM
Thanks for the link. It's a good start and it has prodded me to start
analyzing clojure core and contrib code - which I'm finding are
incredibly good examples of how to do 'stuff'.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Go
Personally, that's not what I want.
I want to download the clojure.org web page - one level deep so the
files api, special_forms, macros, etc. are all available on my laptop
offline.
I tried a couple of programs (wget and httrack) to get this but there
is some strange combobulation of redirects a
I would like to encode/decode Clojure structures to/from a database.
Parsing XML is easy, but I can't seem to find a simple way to encode
Clojure structures to XML and back. Atm my structures are simple: just
simple key/value pairs where the key is always a string and the value
is always a string
> Just thought you would like to know that Wolfram|Alpha agrees (in
> roughly the same time):
>
> http://www.wolframalpha.com/input/?i=factor+1234567890123456789012345...
Thanks!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Goo
Just for fun I actually tried this:
Clojure=> (time (lpf6b 1234567890123456789012345678901234567890))
The prime factorization of 1234567890123456789012345678901234567890
is :5964848081
"Elapsed time: 5519.278432 msecs"
I can't confirm the answer is correct.
5.5 seconds sure beats 10 minutes. :-)
I took a stab at it. I used:
(set! *warn-on-reflection* true)
but it didn't tell me anything.
I found a Java class that did the same thing and created a Clojure
implementation from that. I thought that perhaps if I could force the
data types to be BigInteger Clojure would save time by not having
This doesn't work for me. Here is what happens:
> > 0. Start ng-server
> > 1. Start a fresh vim.
> > 2. :setfiletype clojure (a colon command like :w or :q)
> > 3. \sr (should open a new window)
> > 4. (to go back to first window) ( is Control+w,
> > would be Alt+w)
> > 5. Type in some function:
On Sep 3, 12:09 pm, MarkSwanson wrote:
> Hmm. I just spent some time writing about what I got stuck on and my
> solutions
> and suggestions but Google lost it all when I clicked submit.
Ok... I did wait a bit and refresh the page a couple of times. I guess
I just didn't wait long
Hmm. I just spent some time writing about what I got stuck on and my
solutions
and suggestions but Google lost it all when I clicked submit.
Here is an abbreviated post:
First, thanks for writing vimclojure! I think it's great!
1. README.txt contains incorrect information about what jar files a
I had trouble installing it too. Here is exactly what my problems were
and my solutions:
NOTE: Meikel -> Thank you for writing vimclojure! I think it's great!
Please accept these issues from the perspective of someone who is
trying to help you make vimclojure better.
1. For some reason (and only
78 matches
Mail list logo