including sound or image files with Leiningen uberjar command

2011-09-15 Thread loonster
Sound or image files will show up in the resulting uberjar if they reside in a /resources subdirectory of a Leiningen home project directory. I can't find any documentation for how to refer to and load such resource files within a project.clj and/or a source clj file so that that the resources can

Re: ClojureScript auto-recompile option

2011-09-15 Thread Chris Granger
FWIW there's also cljs-watch: http://github.com/ibdknox/cljs-watch On Sep 15, 6:35 am, Stuart Campbell wrote: > Hello, > > I've written a small hack for the ClojureScript compiler that is useful for > working with static HTML projects. When invoked with the :watch option, the > cljsc program wat

Re: autoboxing in 1.3 RC-0

2011-09-15 Thread pmbauer
see https://github.com/clojure/test.benchmark/blob/master/src/main/clojure/alioth/mandelbrot.clj#L49 There's two ways to get rid of the reflection warning: 1) another function, appropriately type hinted 2) explicit conversion to long According to my measurements for this particular case, option

Re: autoboxing in 1.3 RC-0

2011-09-15 Thread pmbauer
I ran into this exact issue on an alioth benchmark. Adding the explicit (long ...) conversion gets rid of the reflection warning, but didn't have a significant effect on performance. The inner loop is still boxing the return value. On Thursday, September 15, 2011 8:36:53 AM UTC-7, Sean Corfield w

Re: Clojure vs Scala - anecdote

2011-09-15 Thread Tal Liron
On Tuesday, September 13, 2011 1:44:09 PM UTC-5, Sean Corfield wrote: > > It was intended to be purely anecdotal but that doesn't seem to satisfy > anyone! :) > Homer: "You know, when I was a boy, I really wanted a catcher's mitt, but my dad wouldn't get it for me. So I held my breath until I pas

Re: How to convert general recursion to loop .. recur syntax

2011-09-15 Thread octopusgrabbus
Thanks for clarifying the stack space issue. I got confused with the original implementation, and was unsure it would run with a large sequence. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups

Re: autoboxing in 1.3 RC-0

2011-09-15 Thread Ken Wesson
On Thu, Sep 15, 2011 at 10:50 AM, David Nolen wrote: > On Thu, Sep 15, 2011 at 3:18 AM, Sergey Didenko > wrote: >> Auto-boxing loop arg: change" >> >> (loop [x 1 changed 0] >>  (if (= x 10) >>    changed >>    (recur (inc x) >>           (loop [y 1 changed-y changed] >>             changed-y

Re: Watching namespaces

2011-09-15 Thread Chas Emerick
Yes, this has been suggested in the past, and would enable all sorts of useful tooling features. The off-the-top-of-my-head solution (a priori of a proper statement of the problem :-P would be for all namespaces (c.l.Namespace/namespaces) and each namespace's aliases and mappings to be held in

Re: ClojureScript gets defrecord

2011-09-15 Thread Tom Hickey
Printing is not meant to be different. Maybe I was using against an older version of Clojure when I was comparing output. Should be fixed on master. Thanks for the report. Tom On Sep 15, 4:00 pm, David Nolen wrote: > Any particular reason that records print differently than in Clojure? I also >

Re: ClojureScript gets defrecord

2011-09-15 Thread David Nolen
Any particular reason that records print differently than in Clojure? I also see that records don't print w/ their namespace attached. A related bug I encountered was that when I try to put the record literal back into the REPL, Java complains about not being able to find the class. David On Wed

Re: ClojureBox on Window 7: classpath in .emacs file not working

2011-09-15 Thread Roberto Mannai
Hi rsgoheen, Here how I'm now able to work with Clojurebox on Windows 7. Perhaps mine it isn't exactly the same as yours but can give some hints. After some process sniffing, I found that Emacs was searching the .emacs file under C:\, so I created it. In order to create it, you have to do it in D

Re: autoboxing in 1.3 RC-0

2011-09-15 Thread Sergey Didenko
Thanks! Though it is not obvious IMHO. > (loop [x 1 changed 0] >  (if (= x 10) >   changed >   (recur (inc x) >          (long (loop [y 1 changed-y changed] >                  changed-y) -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to

Re: java interop question: how to access Class object statically

2011-09-15 Thread Dave Ray
How about just "Integer"? :) Clojure> Integer java.lang.Integer Clojure> (class Integ­er) java.lang.Class Dave On Thu, Sep 15, 2011 at 1:31 PM, Andrew Xue wrote: > Hi all -- > > Trying to basically do something like Integer.class -- but ... > > user=> (Integer/class) > user=> java.lang.NoSuchFi

java interop question: how to access Class object statically

2011-09-15 Thread Andrew Xue
Hi all -- Trying to basically do something like Integer.class -- but ... user=> (Integer/class) user=> java.lang.NoSuchFieldException: class (NO_SOURCE_FILE:2) user=> (Integer/getClass) java.lang.NoSuchFieldException: getClass (NO_SOURCE_FILE:4) Some (not so pretty) workarounds are (.getClass

Re: Clojure vs Scala - anecdote

2011-09-15 Thread Raoul Duke
On Thu, Sep 15, 2011 at 9:24 AM, Edward Garson wrote: > Native Erlang does have a macro facility, but it is not as powerful as > Lisp/Clojure's. lfe, baby, though of course that is not "native" erlang. -- You received this message because you are subscribed to the Google Groups "Clojure" group.

Re: Clojure vs Scala - anecdote

2011-09-15 Thread Edward Garson
Native Erlang does have a macro facility, but it is not as powerful as Lisp/Clojure's. On Sep 15, 2:15 am, cig wrote: [snip] > In a wide spread environment I think Erlang would be the true winner, > though it does not natively have macros :-( [snip] -- You received this message because you are

Re: autoboxing in 1.3 RC-0

2011-09-15 Thread Sean Corfield
On Thu, Sep 15, 2011 at 7:50 AM, David Nolen wrote: > Loop itself will return boxed values I think. Looks that way. The following code has no reflection warning: (loop [x 1 changed 0] (if (= x 10) changed (recur (inc x) (long (loop [y 1 changed-y changed] chang

Re: Rounding the edges of an Emacs beginner

2011-09-15 Thread gaz jones
M-{ and M-} in emacs go forward/backwards a paragraph. when in code, this often translates well to moving around between fragments/functions etc. you also have C-v and M-v for forward/backward a page and then C-l for centering on the current line. i use all of those a lot... On Thu, Sep 15, 2011 a

Re: ClojureScript gets defrecord

2011-09-15 Thread Devin Walters
Great news! Looking forward to trying it out this afternoon. Cheers, Devin On Sep 14, 2011, at 2:48 PM, Tom Hickey wrote: > Hi all, > > With sign-off from Rich, I have pushed my defrecord work onto master. > > Please try it out and let me know if you experience any issues. > > Cheers, > Tom H

Re: Clojure vs Scala - anecdote

2011-09-15 Thread Sean Corfield
On Wed, Sep 14, 2011 at 11:15 PM, cig wrote: > Impressive, wonder if they were running this on a single node or more > widespread? We run an instance of the process on multiple nodes, configured slightly differently. We needed "some" parallelization to improve throughput but didn't need a massive

Re: autoboxing in 1.3 RC-0

2011-09-15 Thread David Nolen
On Thu, Sep 15, 2011 at 3:18 AM, Sergey Didenko wrote: > Hi, > > Is it a bug or I'm doing something wrong? I can't get rid of > auto-boxing in the second example, neither by type hinting nor by type > coercing of "changed*" locals. > > (set! *warn-on-reflection* true) > > This compiles fine: > > (

Re: How to convert general recursion to loop .. recur syntax

2011-09-15 Thread Ken Wesson
On Thu, Sep 15, 2011 at 8:56 AM, Herwig Hochleitner wrote: > Consider > > (defn find-in-tree >  ([tree pred?] >    (concat >      (filter pred? tree) >      (mapcat find-in-tree (filter sequential? tree) (repeat pred?) > > which of course is much simpler written as > > (defn find-in-tree >  ([

Re: Watching namespaces

2011-09-15 Thread Laurent PETIT
2011/9/15 Stathis Sideris > Hello, > > Is it somehow possible to monitor all namespaces for new defs or re- > defs (and defns etc). Generally, it it possible to implement some sort > of notification whenever something is added or updated to a namespace? > Not that I'm aware of. > I don't mind

Re: How to convert general recursion to loop .. recur syntax

2011-09-15 Thread Chouser
On Thu, Sep 15, 2011 at 8:56 AM, Herwig Hochleitner wrote: > Hi, > > as you might know, the original version actually does run in fixed > stack space, thanks to lazy sequences. You are right! Without testing it I had thought that the way recursion was used would cause skl to overflow the stack i

ClojureScript auto-recompile option

2011-09-15 Thread Stuart Campbell
Hello, I've written a small hack for the ClojureScript compiler that is useful for working with static HTML projects. When invoked with the :watch option, the cljsc program watches a source directory and recompiles sources whenever a change is detected. https://github.com/harto/clojurescript/comm

Re: Watching namespaces

2011-09-15 Thread Herwig Hochleitner
I was about to say that you best bet would be redefining the relevant functions/macros, when I realized that you cannot do that with def, because it's a special form. So short of patching clojure, I don't think one can monitor var interning. (addition to a namespace) What you can do, is monitoring

Re: Generating Bash scripts from Clojure

2011-09-15 Thread Denis Labaye
On Thu, Sep 15, 2011 at 4:23 AM, Hugo Duncan wrote: > On Wed, 14 Sep 2011 15:34:25 -0400, Denis Labaye > wrote: > > I played with it a little bit, can't make the latest version (0.7) to >> work, only the 0.5. >> > > The current version will require you use (with-script-language > :pallet.steved

Watching namespaces

2011-09-15 Thread Stathis Sideris
Hello, Is it somehow possible to monitor all namespaces for new defs or re- defs (and defns etc). Generally, it it possible to implement some sort of notification whenever something is added or updated to a namespace? I don't mind even the solution is hacky or not very fast. The reason I'm asking

Clojure videocast mentioning SuperCSV?

2011-09-15 Thread James P
I've been watching a bunch of Clojure videocasts lately, and there was one which mentioned using the Java library SuperCSV. Unfortunately I can't recall which videocast it was, can someone remind me please? Many thanks. -- You received this message because you are subscribed to the Google Group

Re: Clojure vs Scala - anecdote

2011-09-15 Thread cig
Impressive, wonder if they were running this on a single node or more widespread? In a wide spread environment I think Erlang would be the true winner, though it does not natively have macros :-( There is an implementation of Lisp for Erlang called LFE (lisp flavored Erlang) which I looked at, whic

Re: How to convert general recursion to loop .. recur syntax

2011-09-15 Thread Herwig Hochleitner
Hi, as you might know, the original version actually does run in fixed stack space, thanks to lazy sequences. (defn skl [tree] (map skl (filter seq? tree))) loop .. recur is the moral equivalent of a while(true) loop in imperative style. i.e. a slightly disguised (and somewhat more structure

Re: Binding *out*

2011-09-15 Thread Nick Mudge
Thanks Stuart and Dave. On Sep 14, 10:30 am, Stuart Sierra wrote: > Hi Nick, > > *out* and *err* are already dynamic, which is what allows `binding` to work. > You can the  root binding of any Var (even non-dynamic Vars) with `def` or > `alter-var-root`. > > -Stuart Sierra -- You received this

Re: Overtone 0.3 released

2011-09-15 Thread Herwig Hochleitner
Thanks, Sam! I'm really looking forward to play a bit more in depth with overtone and try to use it in a jam session. kind regards -- __ Herwig Hochleitner -- You received this message because you are subscribed to the Google Grou

Re: Mocking out namespaces

2011-09-15 Thread Chris Perkins
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, >

Re: heaps in clojure

2011-09-15 Thread David Powell
Ah yeah. Sorry, I'd superimposed something I was thinking about on to the original problem. -- Dave On 15 Sep 2011 09:07, "Mark Engelberg" wrote: > The initial problem statement is to figure out what would be the first 10 > items if you sorted the list. > > I don't see anything about frequency

Re: heaps in clojure

2011-09-15 Thread Mark Engelberg
The initial problem statement is to figure out what would be the first 10 items if you sorted the list. I don't see anything about frequency or how many times you've seen a given item in the statement of the problem. When I talk about a "best" item, I mean it is the first with regard to whatever

Re: heaps in clojure

2011-09-15 Thread David Powell
But when an element is dropped from the list, you're effectively resetting its seen-count to zero. It might be seen again, and it might (if you hadn't reset the seen-count), have ended up in the top 10. Or have I misunderstood? -- Dave On 15 Sep 2011 08:54, "Mark Engelberg" wrote: > If you mai

Re: heaps in clojure

2011-09-15 Thread Mark Engelberg
If you maintain the invariant that at each point, your sorted set contains the top 10 you've seen so far, then from that invariant you can conclude that at the end of the traversal, your sorted set contains the top 10 for the overall list. On Thu, Sep 15, 2011 at 12:34 AM, David Powell wrote: >

Re: heaps in clojure

2011-09-15 Thread David Powell
Does that work? There is no guarantee that the top 10 of the overall list matches the top 10 of earlier prefixes, so the candidates that get discarded might be part of the overall top 10, and the elements that pushed them out could just be local maxima. -- Dave On 15 Sep 2011 08:23, "Mark Engelb

Re: heaps in clojure

2011-09-15 Thread Mark Engelberg
You can do one linear pass over your data, accumulating a sorted set of the best 10 items you've found so far. You seed the sorted set with the first 10 items from your list, then continue traversing your list. With each new item you encounter, you ask if it is any better than the worst of the be

autoboxing in 1.3 RC-0

2011-09-15 Thread Sergey Didenko
Hi, Is it a bug or I'm doing something wrong? I can't get rid of auto-boxing in the second example, neither by type hinting nor by type coercing of "changed*" locals. (set! *warn-on-reflection* true) This compiles fine: (loop [x 1 changed 0] (if (= x 10) changed (recur (inc x)

Re: Rounding the edges of an Emacs beginner

2011-09-15 Thread Stefan Kamphausen
Hi, we're getting totally OT here and should probably better head for gnu.emacs.help. Anyway, just one more bark from me and then I'll be quiet (but will respond to mail ;-) On Thursday, September 15, 2011 2:08:28 AM UTC+2, frye wrote: > > In Vim , you press *Ctrl-d* and *Ctrl-u* to go down an

using finger trees in two dimensions

2011-09-15 Thread Sunil S Nandihalli
Hi everybody, Thanks to Chouser's finger tree data structure, it makes it very simple to keep some elements in a tree/sequence and efficiently maintain values by some associative operation on all the elements of the collection .. I guess chouser himself has given series of talks on that. However,