Re: Looking to fit Clojure into my architecture and am in need of your informed advice!

2010-08-02 Thread Saul Hazledine
Hello Kent, On Aug 1, 2:00 pm, Kent Larsson kent.lars...@gmail.com wrote: I'm planning to reduce my time at my full time job to create a small startup. And I am thinking about create a lean and mean architecture which will enable me to get things done. Cool! I am thinking about creating a

Re: Looking to fit Clojure into my architecture and am in need of your informed advice!

2010-08-02 Thread nickikt
Just a little add on to Clojure on Google this is a blog of a company that uses Clojure for a project and the have a DSL for Bigtable. (There is a second blog with only talks about Clojure on google app engine as well) -- http://www.hackers-with-attitude.com/ On Aug 2, 8:47 am, Saul Hazledine

Re: setting classpath and using namespace: how to enable example scripts in library?

2010-08-02 Thread jandot
Thank you Nikita. This looks very much what I need; I now have it running using your first example. jan. On Aug 2, 7:54 am, Nikita Beloglazov nikelandj...@gmail.com wrote: I don't know how my example fits your needs, but I use something like: # /bin/sh java -cp lib/*:src clojure.main -e

Re: Symbol substitution in macro

2010-08-02 Thread Andrew Boekhoff
On Sunday 01 August 2010 21:34:16 Kyle Schaffrick wrote: Hi, The following technique seems to work for finding out if you've been aliased: (ns somewhere.trial) (let [here *ns*] (defmacro whats-my-name [] (some (fn [[k v]] (when (= here v) `(quote ~k))) (ns-aliases

Re: setting classpath and using namespace: how to enable example scripts in library?

2010-08-02 Thread Yang Dong
Sorry don't know the liebke's cljr repl. But I'd like to show the clojure 1.2 script I used to generate a `run.bat'. (I'm using windows) == (ns genrun (:use [clojure.java.io :only (file)]) (:use [clojure.contrib.str-utils :only (str-join)])) (def

Records can't be treated as functions anymore

2010-08-02 Thread Baishampayan Ghose
Hello, I just discovered that records (created using defrecord) can't be treated as functions (like maps) anymore. Consider this - user= (defrecord Bird [nom species]) user.Bird user= (def crow (Bird. Crow Corvus corax)) #'user/crow user= (:nom crow) Crow user= (crow :nom)

Re: Looking to fit Clojure into my architecture and am in need of your informed advice!

2010-08-02 Thread Kent Larsson
Hi! A big thanks for both of you! I will start experimenting with a Clojure and Compojure based REST JSON web service which takes som data from PostgreSQL. Although graph databases looks interesting too, I will surely check out neo4j (I've actually been eye balling it previously too) and try some

let binding and recursive function

2010-08-02 Thread John Sanda
I've just implemented an inorder traversal function for a vector-based tree. The functions look like, (defn- do-traversal [tree idx traversal] (cond (not (node-exists? tree idx)) traversal (leaf? tree idx) (conj traversal (tree idx)) :else (apply conj (do-traversal tree

Re: let binding and recursive function

2010-08-02 Thread Justin Kramer
I think you want: (defn- do-traversal [tree idx [tree-traversal]] ...) Note the extra brackets for destructuring. Another alternative is using multiple arg lists: (defn- do-traversal ([tree idx] (do-traversal tree idx [])) ([tree idx traversal] ...)) Lastly, FYI, the form (if

Re: let binding and recursive function

2010-08-02 Thread John Sanda
Thanks for the response and suggestions Justin. A co-worker also just suggested multiple arg lists which is perfect. He also suggested (or foo bar) to further simplify my code. It definitely cleans the code up and improves readability. - John On Mon, Aug 2, 2010 at 5:37 PM, Justin Kramer

ns-resolve throws ClassNotFoundException

2010-08-02 Thread Adam Schmideg
While (ns-resolve nspace 'unknown) returns nil, if I try (ns-resolve nspace 'something.unknown) it throws a ClassNotFoundException. I would expect it to silently return nil. Is this a bug, or it has a rationale? -- You received this message because you are subscribed to the Google Groups

bugs in with-local-vars and lexically-nested-function access to outer function parameters

2010-08-02 Thread Dale
In the program below, if I use the commented-out version of thsolve (program is the N queens puzzle), the with-local-vars construct causes a NullPointerException when its block exits, after appearingt o work correctly. The same thing happens if I use binding instead. The non-commented version of

Why no tail call optimization

2010-08-02 Thread Dale
The JVM has an unconditional goto opcode and the ability to re-bind function parameters, so why no tail-call optimization? Thanks. Dale -- 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

Clojure for audio signal processing

2010-08-02 Thread klancaster1957
I'm about to begin work updating an older C / C++ audio signal processing application, and would like to make the core of the app cross-platform (rather than Windows only as it is now). There is _some_ possibility that it aspects could be parallelized as well. The work will involve writing some C

Clojure Job Opportunity

2010-08-02 Thread Jack_Kennedy - AVID
Looking for a Senior Software Engineer with experience working with Clojure to join a fantastic company in the Boston area. This person will be responsible for designing and developing next generation software for the purpose of delivering mobile content running on a large network of servers. If

Re: Why no tail call optimization

2010-08-02 Thread Frederick Polgardy
It means that the JVM doesn't look at method calls and figure out that they're in tail call position and optimize them. You can hand-write code that performs a goto in a tight loop (like recur does), but means you can't assume that method calls in general will be tail call optimized. -Fred --

Re: Why no tail call optimization

2010-08-02 Thread Kevin Downey
the jvm goto's only can jump around inside method bodies, so it is a very restricted goto On Mon, Aug 2, 2010 at 2:09 PM, Dale dpar...@ptd.net wrote: The JVM has an unconditional goto opcode and the ability to re-bind function parameters, so why no tail-call optimization? Thanks. Dale --

Re: bugs in with-local-vars and lexically-nested-function access to outer function parameters

2010-08-02 Thread Mark Engelberg
Can you distill this down to the smallest possible example that demonstrates the error? -- 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 -

Re: Why no tail call optimization

2010-08-02 Thread Dan Kersten
Why can't the clojure bytecode compiler hand-perform this like functional languages do when compiling to native code? Is it to keep the clojure compiler fast (for dynamic runtime compilation), since performing tail call optimisation presumably requires a bunch of extra checks and more complex code

Re: Why no tail call optimization

2010-08-02 Thread Wilson MacGyver
as Rich Hickey stated question: Is it fundamentally impossible to do TCO on JVM due to current JVM lack of primitives to do so? Would TCO ever be possible on the JVM without a new JVM design? rhickey: TCO is easy if you are an interpreter - see SISC Scheme. Using Java's call stack, the JVM would

Re: Records can't be treated as functions anymore

2010-08-02 Thread Krukow
On Aug 2, 3:50 pm, Baishampayan Ghose b.gh...@gmail.com wrote: Hello, [snip..] The documentation says defrecord provides a complete implementation of a persistent map. If a record is analogous to a map, why can't we treat it as one? If it's not a bug, what is the rationale behind it?