Hmm, looks like I broke some logic when I hand unrolled the original
cl-format based dispatch to get better performance for lists, vectors, and
maps. (Really I shouldn't have to do this, but I need to make cl-format
itself generate code rather than threaded functions which are slow and tend
to blow
If you want native with enough reflection to compile clojure,
Objective-C might be a better choice than C++.
--
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, December 20, 2010 8:54:14 PM UTC+1, kaveh_shahbazian wrote:
>
> I understand hosting on a VM has it's own (huge) advantages: GC,
> libraries, proved practices and vast amount of research and community
> effort already available; no doubt on that part.
>
> It is just having a mature an
You can use
http://docs.google.com/viewer?url=http://url_to_pdf_or_doc_or_xls_or_something
to see those documents converted to html. Works ok in most of the cases,
even on my phone.
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this gr
On Dec 20, 7:09 am, Tim Daly wrote:
> It is the algebra language in the Axiom project called
> Spad.http://axiom-developer.org
> It is open source
There is also Qi (http://www.lambdassociates.org/qilisp.htm). It is
now morphing into Shen (http://www.lambdassociates.org/Shen/
appeal.htm) with C
Hi everybody,
Just for kicks I took Chouser's good start on the PersistentVector port and
threw it in a Github gist, and demonstrated using it in jsFiddle. I love the
cloud these days ;)
Anyway, I hope you don't mind Chouser. I plan to refactor your code to use
Javascript's prototype system, b
Hello there again.
After reading my above post you were probably frustrated, as was I when I
realized I had completely forgotten to include links to actual resources.
D'oh.
The gist is here: https://gist.github.com/749750
The jsFiddle demonstration (outputs to console) is here:
http://jsfiddle
On Tue, Dec 21, 2010 at 6:51 AM, Shane Daniel wrote:
> Hi everybody,
> Just for kicks I took Chouser's good start on the PersistentVector port and
> threw it in a Github gist, and demonstrated using it in jsFiddle. I love the
> cloud these days ;)
> Anyway, I hope you don't mind Chouser. I plan to
I was involved with Ruby and Rails in the early days. The Ruby mailing lists /
conferences were always kind / helpful and the Rails lists / confs were always
hit and miss. There were plenty of great Rails people, and enough jerks to
upset anyone.
I read this (Clojure) google group pretty frequ
On Tue, Dec 21, 2010 at 3:26 PM, Alessio Stalla wrote:
>
> It could be written on top of Common Lisp. There are natively compiled,
> multithreaded, cross-platform implementations of it, and building on another
> Lisp should be much easier than on C/C++. Of course, since Clojure programs
> often r
I think those are fine points. And to reciprocate, I think it's important
when you read someone's comments to give the writer the benefit of a doubt.
Sometimes it helps to read between the lines. If you can tone down your
emotional reaction to a comment that feels unpleasant, you may find th
>
> I am not a Clojure expert. But if I understood Clojure correctly,
> Clojure would not be Clojure if it where natively compiled. Eg. The
> whole lazy seq's are required because of lack of tail call
> optimization in the JVM. Or am I wrong?
>
>
I don't think the lazy seq are necessary because of
Jay,
[snip]
I agree with your observations. The last few days have indeed been
kind of upsetting. I hope everyone follows your suggestions.
> Also, what happened to Rich? It seems like many wasteful discussions could be
> more easily put to bed by his response
> instead of the current "here's a
Why does this cause an out of memory error:
(def out_of_mem
(reduce + 0 (range 5000)))
while this does not:
(def not_out_of_mem
(let [result 0]
(reduce + result (range 5000
and neither does this in the REPL:
(reduce + 0 (range 5000)))
- Miles
--
You received this mes
I am attempting to interop with scala. In scala, if you have a class
which is a var, a method is defined in the .class file called varname_
$eq which will set the var. Problem is, clojure apprent converts
dollar signs to the text _DOLLARSIGN_. Is there any way to prevent
this?
--
You received t
oh, and the public var is defined as private in the .class file, so i
can't use set!
--
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 Tuesday, December 21, 2010 2:55:58 PM UTC+1, Santosh Rajan wrote:
>
> On Tue, Dec 21, 2010 at 3:26 PM, Alessio Stalla
> wrote:
>
> >
> > It could be written on top of Common Lisp. There are natively compiled,
> > multithreaded, cross-platform implementations of it, and building on
> another
>
On Tue, Dec 21, 2010 at 9:12 AM, nicolas.o...@gmail.com <
nicolas.o...@gmail.com> wrote:
> (defn my-map [f l]
> (when l
>(cons (f (first l)) (my-map f (next l)))
>
> You can write a tail recursive version, but it would be equivalent to
> accumulating with a loop and reversing the result.
> Wh
I would like to think is a symptom of the growth of Clojure. More
Clojure users from different perspectives and attitudes means more
potential for conflict. But some attitudes only causes noise: in
particular people who requires without counterpart and think Clojure
is like Visual Basic and this gr
The dream would be to have:
- Everything for clojure in clojure
- A nice compiler in clojure
- java speed clojure
- Collections and multimethodes in clojure
- A js generating backend for the compiler that works with GWT for the
required java stuff
Unfortunately I do not (jet) have the skill to do
> In my experience lazy-seqs are a reasonable replacement for the lack of TCO,
> and from what I've heard that is one of the reasons they exist.
> (defn a [x]
> (lazy-seq
> (cons x (b (inc x)
> (defn b [x]
> (lazy-seq
> (cons x (a (inc x)
> David
>
I am not sure I get you. C
On Tue, Dec 21, 2010 at 11:28 AM, nicolas.o...@gmail.com <
nicolas.o...@gmail.com> wrote:
> I am not sure I get you. COuld you elaborate a bit more this example,
> please?
> Which tail-call functions are you trying to replace by a and b?
> Nicolas.
>
Those are mutual recursive functions. Trying t
> Those are mutual recursive functions. Trying to define them as regular
> functions will quickly result in a stack overflow.
> You could use trampoline but in my experience you will take a significant
> performance hit.
> Lazy sequences are a way to efficiently represent mutually recursive
> compu
On Tue, Dec 21, 2010 at 11:41 AM, nicolas.o...@gmail.com <
nicolas.o...@gmail.com> wrote:
> > Those are mutual recursive functions. Trying to define them as regular
> > functions will quickly result in a stack overflow.
> > You could use trampoline but in my experience you will take a significant
> With TCO mutually recursive functions do not consume the stack. The same is
> true for well constructed lazy sequences.
> David
With TCO, mutually *tail* recursive functions do not consume the stack.
non-tail call always consume the stack in non CPS compiled languages.
(In which, it consumes th
On Tue, Dec 21, 2010 at 11:54 AM, nicolas.o...@gmail.com <
nicolas.o...@gmail.com> wrote:
> > With TCO mutually recursive functions do not consume the stack. The same
> is
> > true for well constructed lazy sequences.
> > David
>
> With TCO, mutually *tail* recursive functions do not consume the s
> With TCO mutually recursive functions do not consume the stack. The same is
> true for well constructed lazy sequences.
If the functions were:
(defn f [x] (g x))
(defn g [x] (f x))
They would operate in constant space with tail-call optimization.
(defn f [x] (cons x (g x)))
(defn g [x] (cons
> Yes I know, I thought the way I wrote the code was clear about that :)
I am sorry, I did not understand.
So let me try to explicit your transformation (please correct me if I am wrong):
- start with some mutually recursive functions: a and b, for example
- create a "lazy stack" for the recursiv
On Tue, Dec 21, 2010 at 12:09 PM, nicolas.o...@gmail.com <
nicolas.o...@gmail.com> wrote:
> > Yes I know, I thought the way I wrote the code was clear about that :)
>
> I am sorry, I did not understand.
>
> So let me try to explicit your transformation (please correct me if I am
> wrong):
> - star
I have an example to clarify what I understood of your idea:
(declare odd)
(defn even [x]
(if (zero? x)
[true]
(lazy-seq nil (odd (dec x)
(defn odd [ x]
(if (zero? x)
[false]
(lazy-seq nil (even (dec x)
(defn get-value [l]
On Tue, Dec 21, 2010 at 12:20 PM, nicolas.o...@gmail.com <
nicolas.o...@gmail.com> wrote:
> I have an example to clarify what I understood of your idea:
>
> (declare odd)
>
> (defn even [x]
>(if (zero? x)
> [true]
> (lazy-seq nil (odd (dec x)
>
> (defn odd [ x]
>
It's a funy and original trick but on this example at least,
it seems slower (and it can use a lot of memory, because it retains a
stack in the heap) than trampoline:
(time (get-value (even 1500)))
"Elapsed time: 1899.881769 msecs"
And a version with trampoline
(defn odd [^long x]
(i
great, yet another email on the list so unrelated to clojure that not
only does it contain no code, but no reference to code. if you need to
whinge publicly please do it on your own blog. if you don't feel like
the clojure community is giving you the love and support you need then
I am sure rails w
Hi again,
I still don't know how to use the filter function.
I have a map of "provinces - seats" like: (def provs {"p1" "5", "p2"
"8", "p3" "13", "p4" "11"})
And a sequence of "province - party - votes" like: (def votes [["A"
"p1" "32"] ["B" "p1" "55"] ["A" "p2" "77"] ["B" "p2" "21"]])
In order
On Tue, Dec 21, 2010 at 12:44 PM, nicolas.o...@gmail.com <
nicolas.o...@gmail.com> wrote:
> It's a funy and original trick but on this example at least,
> it seems slower (and it can use a lot of memory, because it retains a
> stack in the heap) than trampoline:
>
> (time (get-value (even 1500
'filter' is for getting a subset of the elements in a collection. For
getting the names of the provinces, what you want is to get all the
keys from your 'provs' map, which can be done via the 'keys' function.
user=> (keys provs)
("p1" "p2" "p3" "p4")
Personally, I find ClojureDocs' Quick Referen
On Tue, Dec 21, 2010 at 12:08 PM, Andrew Boekhoff wrote:
> > With TCO mutually recursive functions do not consume the stack. The same
> is
> > true for well constructed lazy sequences.
>
> If the functions were:
> (defn f [x] (g x))
> (defn g [x] (f x))
>
> They would operate in constant space wit
On 12/17/2010 09:54 AM, Trevor wrote:
> 2. Is there a form for anonymous macros?
>
> i.e. I know I can do : (fn[x](do x)), but can I not do: (macro[x](let
> [x# x] `(do x))) ?
>
> Thanks!
>
A little tardy, but Konrad Hinsen has written a handful of CL-like
functions for symbol macros and macr
Hi everyone,
My typical development workflow is to use leiningen to create a
project stub, modify project.clj to add swank-clojure as a dev-
dependency, and run lein-swank and connect from Emacs slime. As I
create and modify files in the test and src namespaces/directory
structures, I use C-c C-k
On Tue, Dec 21, 2010 at 9:09 AM, Miles Trebilco wrote:
> Why does this cause an out of memory error:
>
> (def out_of_mem
> (reduce + 0 (range 5000)))
>
> while this does not:
>
> (def not_out_of_mem
> (let [result 0]
> (reduce + result (range 5000
>
> and neither does this in the RE
You may want to consider the heap size you have allocated to java. I
believe the default is 128.
For example you can set this yourself:
java -Xms256m -Xmx1024m
This provides 256mb initial heap and permits heap to grow to 1024mb.
I've been using Leiningen, so in my case I just changed the settin
user=> (first (first provs))
"p1"
user=>
On Tue, Dec 21, 2010 at 1:18 PM, Benny Tsai wrote:
> 'filter' is for getting a subset of the elements in a collection. For
> getting the names of the provinces, what you want is to get all the
> keys from your 'provs' map, which can be done via the 'keys
2010/12/21 Tim Robinson
> You may want to consider the heap size you have allocated to java. I
> believe the default is 128.
>
> For example you can set this yourself:
>
> java -Xms256m -Xmx1024m
>
Indeed, but in this example, there is a problem. As Ken said, it seems that
the "locals clearing"
Right now, probably not. But you can use the Java Reflection API to work
around it.
-S
--
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 - ple
You can delete the entire test namespace with `remove-ns` and then do
`(require ... :reload)`.
Or try Lazytest. :)
-Stuart Sierra
--
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 tha
Well, I'm glad to have you in the Clojure community, Jay. I come from
a Ruby background too, and I've enjoyed your blog over the years. Your
interest in Clojure has helped me get other Rails developers at work
excited about Clojure.
On the topic of community attitude, I agree with you. There are s
The link to the SCA FAQ on the page at clojure.org/contributing now
returns a document not found page. Given that the Clojure CA is based
on the Sun Contributor Agreement and what Oracle has since done with
NotQuiteSoOpenSolaris, this would seem to be an important document to
have available.
Indeed, this has been a problem for me too. I also tried to get it via the
backdoors, e.g. via the Open JDK, Netbeans, etc., websites, but they did
respect the "DRY" principle correctly, and all I found was just links to the
missing page :-/
2010/12/21 Mike Meyer
> The link to the SCA FAQ o
On Tue, Dec 21, 2010 at 3:43 PM, Laurent PETIT wrote:
> Indeed, this has been a problem for me too. I also tried to get it via the
> backdoors, e.g. via the Open JDK, Netbeans, etc., websites, but they did
> respect the "DRY" principle correctly, and all I found was just links to the
> missing pag
2010/12/21 Ken Wesson
> On Tue, Dec 21, 2010 at 3:43 PM, Laurent PETIT
> wrote:
> > Indeed, this has been a problem for me too. I also tried to get it via
> the
> > backdoors, e.g. via the Open JDK, Netbeans, etc., websites, but they did
> > respect the "DRY" principle correctly, and all I found
Simpler solution: Don't feed the trolls. We know who they are.
On Tue, Dec 21, 2010 at 5:36 AM, Jay Fields wrote:
> I was involved with Ruby and Rails in the early days. The Ruby mailing lists
> / conferences were always kind / helpful and the Rails lists / confs were
> always hit and miss. The
> > Lazy-seq's are often handy in Clojure to subvert the stack limit imposed
> > by the the JVM, but it's not quite the same problem that TCO solves.
>
> Having recently converted some Scheme that leaned heavily on the presence
> of TCO, I'm curious as to what situations you think could not be sol
Darn. I actually noticed this and redirected to a better link at the
beginning of November but it seems to have gone broken again.
The best alternative I can seem to find right now is this:
http://oss.oracle.com/oca-faq.pdf
I've updated the page with this for now.
Alex
On Dec 21, 2:39 pm, Mik
Hi,
Am 21.12.2010 um 22:00 schrieb Laurent PETIT:
> Now yes, and no, no more chances :-(
Seems the link is fixed? http://oss.oracle.com/oca-faq.pdf
Sincerely
Meikel
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email
On Tue, Dec 21, 2010 at 8:36 AM, Jay Fields wrote:
> I was involved with Ruby and Rails in the early days. The Ruby mailing
> lists / conferences were always kind / helpful and the Rails lists / confs
> were always hit and miss. There were plenty of great Rails people, and
> enough jerks to upset
Some good guidelines to foster communities:
http://freenode.net/channel_guidelines.shtml
On Dec 21, 1:15 pm, David Nolen wrote:
> On Tue, Dec 21, 2010 at 8:36 AM, Jay Fields wrote:
> > I was involved with Ruby and Rails in the early days. The Ruby mailing
> > lists / conferences were always kind
Great Kevin,
you just poured more oil on the fire...
Code is not the only thing about Clojure. Getting newbies on board is
needed and if they need pointers fine with me. There has to be a place to
jump start people. This mailing is a starting point and has to be somewhat
friendly.
I myself can
On Tue, Dec 21, 2010 at 4:01 PM, Andrew Boekhoff wrote:
>
> (defn [f k x]
> (if (time-to-return? x)
>(k x)
>(g (fn [x*] (k (do-stuff-to x*)))
> x)))
>
> (defn [g k x]
> (if (time-to-return? x)
>(k x)
>(f (fn [x*] (k (do-other-stuff-to x*)))
> x)))
No, great example!
On Mon, Dec 20, 2010 at 6:06 PM, rob levy wrote:
> I have posted a repository containing the code for a web application I made
> using a server push (AKA Comet, long polling) architecture. The front end
> is in Javascript, and the back end is in Clojure. The clojure code is able
> to send notifi
On Dec 21, 10:35 am, Alyssa Kwan wrote:
> What about when I need to delete a unit test? Reloading the test
> buffer doesn't remove it, and I need to either restart swank or
> reconnect slime, or manually remove those tests using (unmap-ns).
> Surely there's a better way...
If you're already usin
This is another view of the Clojure STM idea, from the Haskell camp:
http://channel9.msdn.com/Shows/Going+Deep/Programming-in-the-Age-of-Concurrency-Software-Transactional-Memory
Recently, we visited MSR Cambridge(UK) to meet some of the great minds
working there. In this case, we were fortuna
I think it's a pretty complex problem to solve. Although one could re-
word a statement to be polite, it's still just window dressing what
are still potentially just thoughtless arrogant statements that still
insult people within the community.
In other words, I'd rather someone say "Why would you
On Tue, Dec 21, 2010 at 7:47 PM, Tim Robinson wrote:
> In my humble opinion, I don't think what you're experiencing will get
> any better, but here are a few thoughts:
>
> 1. You can still enjoy the community by changing your expectations and
> adopting 1 single rule (which I constantly try to rem
Hi,
I wrote a small log file analyzer for IRC logs. We use nickname++ and
nickname-- to track the "karma", so after trying to write it in
JavaScript (failed due to to the fact that Gjs/Seed are unmature yet),
Factor (failed because I am just too stupid to understand it), Guile
(failed because I ra
> You might be interested to google "fundamental attribution error".
After a briefly read on Wikipedia, I'm glad you pointed that out. I'll
read more.
Any other comment I could make on that seems to open too many doors
to discussions
not related to Clojure, but thank you for sharing.
As for the
Awesome!!! This absolutely does the trick!
On Dec 21, 7:16 pm, Phil Hagelberg wrote:
> On Dec 21, 10:35 am, Alyssa Kwan wrote:
>
> > What about when I need to delete a unit test? Reloading the test
> > buffer doesn't remove it, and I need to either restart swank or
> > reconnect slime, or manu
On Sun, Dec 19, 2010 at 3:36 AM, HiHeelHottie wrote:
>
> In Joy of Clojure, there is a callback API to blocking API example in
> the section on promises. Chouser outlines it a briefly in a
> discussion on Promise/Deliver use cases here -
> http://groups.google.com/group/clojure/browse_thread/thre
Hi Marek,
Here's my tweaked version:
(ns karma
(:use [clojure.contrib.duck-streams :only (read-lines)])
(:use [clojure.contrib.generic.functor :only (fmap)]))
(def allowed-nickname "[A-z]{1,16}")
(def upvote-regexp (re-pattern (format "(%s)\\+\\+" allowed-
nickname)))
(def downvote-regexp (r
Here's my version. Main points:
* Use with-open & line-seq for worry-free laziness
* Do everything in one swoop (reduce)
* Perform one regexp match per line
* Leverage ->>
;;
(ns user
(use [clojure.java.io :only [reader]]))
(def re-vote #"([A-z]{1,16})(\+\+|\-\-)")
(defn extract-votes
[lin
Hi everyone,
Does anyone have any experience in mocking multimethods? I'm working
on a version control framework modeled after Git:
(def
^{:private true}
patches- (ref [])
(defn patches []
(seq @patches-))
(defn do-patch! [fn & args]
(dosync
(apply fn args)
(let [patch {:fn fn
On Tue, Dec 21, 2010 at 16:16, Phil Hagelberg wrote:
>
>
> It also highlights failures in the test buffer for better feedback.
when there is a failure where are the details of the failure printed out to?
I love that the highlight shows me which test have errors, but since I've
moved over to the
On Tue, Dec 21, 2010 at 21:36, Michael Ossareh wrote:
> On Tue, Dec 21, 2010 at 16:16, Phil Hagelberg wrote:
>>
>>
>> It also highlights failures in the test buffer for better feedback.
>
>
> when there is a failure where are the details of the failure printed out
> to? I love that the highlight
Hi Alyssa,
Using the midje library I was able to do your first test. I'm pretty tired
so I this might be it for the night.
(fact "throws an error if can't resolve undo function"
(undo-patch [2]) => (throws IllegalArgumentException "No method in
multimethod 'undo-fn' for dispatch value: null"))
So I lied, I couldn't resist doing just one more:
(defn some-fn [] nil)
(fact "calls the anonymous function that undo-fn returns"
(undo-patch ...patch...) => @patches-
(provided
(undo-fn ...patch...) => some-fn
(some-fn) => nil))
The two provided statements are mboth mocking and stub
Hi Alex,
Unfortunately the some-fn has to be created at the top level; it has
to be a var to be dynamically bindable, and Midje (and AFAIK, all
other mocking frameworks) use dynamic binding.
Here's what I came up with, using clojure.contrib.mock.test-adapter:
(deftest test-undo-patch!-calls-undo
75 matches
Mail list logo