Re: defrecord with default values

2010-09-07 Thread Meikel Brandmeyer
Hi, first of all we should start with the form we finally want to have: (defrecord Foo [a b c]) (defn make-Foo [ {:keys [a b c] :or {a :x c :z}}] (Foo. a b c)) ; Use as: (make-Foo :b :f) = (Foo. :x :f :z) The only annoying part is the boilerplate of defining make-Foo. What we would like

Re: Documentation tools

2010-09-07 Thread Tom Faulhaber
Hey Mark, I don't know of any publicly available tools besides autodoc. My understanding is that Zack was keeping the source to clojuredocs closed, at least for now. While I assume his extraction code is in Clojure, the actual clojuredocs presentation code is a Ruby on Rails app [1] Whether

Re: Binding and temporary global state

2010-09-07 Thread Michael Wood
On 6 September 2010 23:22, Cameron Pulsford cpuls...@gmail.com wrote: [...] Changing my declares to defs did the trick did though and learning Does this break it again? (do (def *macros*)) Because that's all that declare does: user= (macroexpand-1 '(declare *macros*)) (do (def *macros*)) --

Re: Documentation tools

2010-09-07 Thread Mark Engelberg
Docstrings seem designed for fairly terse comments about the nature of the function. It's great for providing little hints about how the function works to jog one's memory by typing (doc ...) in the REPL, or for searching with find-doc. But I just don't think I can fit the kind of full

Re: Documentation tools

2010-09-07 Thread Laurent PETIT
Hi, 2010/9/7 Mark Engelberg mark.engelb...@gmail.com: Docstrings seem designed for fairly terse comments about the nature of the function.  It's great for providing little hints about how the function works to jog one's memory by typing (doc ...) in the REPL, or for searching with find-doc.  

Re: agents, await and Swing thread

2010-09-07 Thread Mark Nutter
Just a quick thought (and before I've had my coffee no less!), but I think what I'd do is replace the boolean *end-search* with a *search-state* var that could be either :idle, :running or :stopping. Then in search-stops, just set *search-state* to :stopping -- you don't need to actually wait for

Re: external clojure lib

2010-09-07 Thread Abraham Varghese
Hello Sunil , Using windows xp , just got into clojure , not much knowledge Thanks AV On Sep 6, 8:00 pm, Sunil S Nandihalli sunil.nandiha...@gmail.com wrote: Hi Abraham,  Make sure that the jar file of the external library you are referring to is in path. If you are developing clojure code

Re: clojure Image/video processing?

2010-09-07 Thread Sean Grove
I'd be happy to show my frame-hash implementation as long as you won't laugh too hard at it. I'll throw it up on github sometime soon after I clean it up a bit. I like it because a video treated as just a sequence of hash-maps which flows through an image processing pipeline. Sounds excellent

Re: agents, await and Swing thread

2010-09-07 Thread Alessio Stalla
On Sep 6, 5:48 pm, K. kotot...@gmail.com wrote: Hello, I've got a concurrency problem and it's not really clear to me how to solve it. I have a Swing GUI doing a search in background with agents and the results are displayed one after the other, also in background. Here is, largely

Leiningen + dropbox

2010-09-07 Thread Karol Adamiec
Hello, I am trying to set up an env that would be hosted on my dropbox or usb stick so i can access it anywhere. Problem is that it works at home, but at work lein deps is unable to fetch the jars. C:\TEMP\My Dropbox\dev\hello-wwwlein deps Downloading:

Re: agents, await and Swing thread

2010-09-07 Thread Laurent PETIT
Hi, Several questions / thoughts: 2010/9/6 K. kotot...@gmail.com: Hello, I've got a concurrency problem and it's not really clear to me how to solve it. I have a Swing GUI doing a search in background with agents and the results are displayed one after the other, also in background. Here

Re: Leiningen + dropbox

2010-09-07 Thread Karol Adamiec
Solved. The problem was maven proxy settings. After adding settings.xml file to home works like a charm. I am answering here for future googlers. Best regards, Karol Adamiec On Tue, Sep 7, 2010 at 12:44 PM, Karol Adamiec karol.adam...@gmail.comwrote: Hello, I am trying to set up an env

can't def m-bind because namespace

2010-09-07 Thread MohanR
java.lang.Exception: Name conflict, can't def m-bind because namespace: user refers to:#'clojure.contrib.monads/m-bind What namespace help doc. should I read to resolve this issue ? Maybe I should not read about monads first. -- You received this message because you are subscribed to the Google

Re: can't def m-bind because namespace

2010-09-07 Thread Nicolas Oury
http://clojure.org/namespaces You should require clojure.contrib.monad and bot use it. (ns my-namespace (:require (clojure.contrib.monad :as m)) m/m-bind, for example. Then you can define your own m-bind without conflict with an existing one. On Tue, Sep 7, 2010 at 1:13 PM, MohanR

Re: defrecord with default values

2010-09-07 Thread anthonyghr
Awesome! Thanks so much! Anthony On Sep 7, 2:10 am, Meikel Brandmeyer m...@kotka.de wrote: Hi, first of all we should start with the form we finally want to have: (defrecord Foo [a b c]) (defn make-Foo   [ {:keys [a b c] :or {a :x c :z}}]   (Foo. a b c)) ; Use as: (make-Foo :b :f) =

Re: can't def m-bind because namespace

2010-09-07 Thread Jacek Laskowski
On Tue, Sep 7, 2010 at 2:13 PM, MohanR radhakrishnan.mo...@gmail.com wrote: Maybe I should not read about monads first. ...and report your findings here or blog somewhere if you don't mind :) I've been reading a lot about monads lately and can't get my head around it yet so any help appreciated

Re: Extending Clojure's STM with external transactions

2010-09-07 Thread Constantine Vetoshev
On Sep 5, 8:56 pm, Alyssa Kwan alyssa.c.k...@gmail.com wrote: Any thoughts on how to marshal functions? What about vars and dynamic binding? I don't think marshaling closures will ever happen without changes to Clojure itself. I haven't looked into how much work it would require, or how much it

Re: can't def m-bind because namespace

2010-09-07 Thread Jacek Laskowski
On Tue, Sep 7, 2010 at 4:04 PM, Nicolas Oury nicolas.o...@gmail.com wrote: Hope that helps. It did. Thanks. Would you share some examples of its use in Clojure apps? I'd love seeing more examples where a monad-based solution is contrasted/compared to its more traditional, common approach. I

Re: Typical usage of Compojure

2010-09-07 Thread James Reeves
On 5 September 2010 20:53, HB hubaghd...@gmail.com wrote: It is public idea in Ruby community that Sinatra is best used for rapid prototyping and creating API for web application. This opinion tends to come from developers used to larger web frameworks like Ruby on Rails. I don't agree with

Re: can't def m-bind because namespace

2010-09-07 Thread Joop Kiefte
Monads are mostly used because they are necessary in Haskell. In Clojure the urgent need is not there. However, you can sure get some cleaner and/or more composable code if you use monads in your advantage. 2010/9/7 Jacek Laskowski ja...@laskowski.net.pl: On Tue, Sep 7, 2010 at 4:04 PM, Nicolas

Re: Documentation tools

2010-09-07 Thread Mark Fredrickson
Perhaps you would be interested in postdoc: http://github.com/markmfredrickson/postdoc Postdoc allows structured documentation, runnable examples, and related items based on namespaced identifiers. One was to allow for separate files that included the documentation away from the code, so as not

Re: external clojure lib

2010-09-07 Thread Abraham
still i am not getting , i meant to say that , i want to use clojure.contrib. libraries , how to make it work with my system . from where this lib has to copied and which directory to copy... may be lib is clj's files Anybody' Thanks in advance AV On Sep 7, 11:02 am, Abraham Varghese

Re: Documentation tools

2010-09-07 Thread Eric Schulte
Hi, I'd recommend looking at how plt-scheme solved this problem (see [1]). They actually defined alternative readers in which either prose or code can be the default input mechanism (with the other escaped in some way). I don't know if Clojure's reading system is quite flexible enough to support

Re: JSON lib of choice?

2010-09-07 Thread Michael Ossareh
On Mon, Sep 6, 2010 at 19:50, Wilson MacGyver wmacgy...@gmail.com wrote: I figure enough time has passed that I want to bring this up again. For JSON, are you using clojure.contrib.json or clj-json? Why? We use org.danlarkin.json, because it encodes and decodes (contrib.json didn't when we

Re: external clojure lib

2010-09-07 Thread Alan
You've seen a lot of recommendations for Leiningen. I suggest you try it out: everyone seems to think it will solve your problem (Hint: it will). But even if you have no idea what it is, the fact that everyone is suggesting it means you should try it out before you simply repeat the question

Re: external clojure lib

2010-09-07 Thread Mike Meyer
On Tue, 7 Sep 2010 08:36:27 -0700 (PDT) Abraham vincent@gmail.com wrote: still i am not getting , i meant to say that , i want to use clojure.contrib. libraries , how to make it work with my system . from where this lib has to copied and which directory to copy... may be lib is clj's

Re: Documentation tools

2010-09-07 Thread Phil Hagelberg
On Tue, Sep 7, 2010 at 1:25 AM, Mark Engelberg mark.engelb...@gmail.com wrote: Docstrings seem designed for fairly terse comments about the nature of the function.  It's great for providing little hints about how the function works to jog one's memory by typing (doc ...) in the REPL, or for

How to :use a defrecord from another source file and namespace?

2010-09-07 Thread Chris Jenkins
I'm having trouble writing code in one namespace that instantiates a type that is defined in another namespace. I have two source files: other.clj defines a function called my-fn and a type called huss: (ns my-project.other) (defrecord huss [x y z]) (defn my-fn [] (println my-fn))

Re: How to :use a defrecord from another source file and namespace?

2010-09-07 Thread Michał Marczyk
Types created by deftype defrecord are Java classes and you'd have to use :import to bring them into another namespace: (ns ... (:import my-project.other.huss)) Or if you have multiple types, (:import [foo.bar Wibble Wobble]) It might be simpler to define a factory function and use that

Re: cool compiler-project?

2010-09-07 Thread Sreeraj a
Hi, I'm trying to develop a clojure compiler for LLVM. may need a small nudge in the right direction. anyone who can mentor me on this project? Thanks Sreeraj. -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to

Re: RFC: updated c.c.logging with some breaking changes

2010-09-07 Thread ka
These seem like good changes to me! Any plans to push? -- 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

Re: How to :use a defrecord from another source file and namespace?

2010-09-07 Thread Michał Marczyk
On 7 September 2010 23:56, Chris Jenkins cdpjenk...@gmail.com wrote: why don't I fall back on defstruct and defmulti, at least until performance becomes important I believe defrecord was meant to supersede defstruct, but apparently defstruct is not (yet?) marked as deprecated in 1.2, so sure,

clojure.contrib.trace not working on 1.2?

2010-09-07 Thread Scott Jaderholm
Why does c.c.trace give different output on 1.2 than it did on 1.1? From http://learnclojure.blogspot.com/2010/02/slime-2009-10-31-user-defn-fib-n-if-n-2.html On 1.1 user (dotrace (fib) (fib 3)) TRACE t1880: (fib 3) TRACE t1881: |(fib 2) TRACE t1882: ||(fib 1) TRACE t1882: ||

Re: clojure.contrib.trace not working on 1.2?

2010-09-07 Thread Michał Marczyk
Hm, I would guess that the self-call gets hard-wired, since if you define fib thus: (defn fib [n] (if (#{0 1} n) n (+ (#'fib (- 2 n)) (#'fib (dec n) then it works as you expect. Not that I'm really sure what's happening; just a conjecture. Also, I believe I already bumped into

2 lein swank instances on same project and compiling src from emacs

2010-09-07 Thread HiHeelHottie
I have two lein swanks going on different ports against the same project. I open up two slime-connect's in emacs. How can I compile (C-c C-k) my core.clj to the two different slime-connect's. hhh -- You received this message because you are subscribed to the Google Groups Clojure group. To

Re: 2 lein swank instances on same project and compiling src from emacs

2010-09-07 Thread Robert McIntyre
I don't think you can do that, but you can connect to the same swank instance twice with M-x slime-connect and function updates will be reflected in both repls. --Robert McIntyre On Tue, Sep 7, 2010 at 8:54 PM, HiHeelHottie hiheelhot...@gmail.com wrote: I have two lein swanks going on

ANN: Indyvon - GUI library

2010-09-07 Thread Mikhail Kryshen
Hi, I have recently published Indyvon -- an experimental multithreaded GUI library for Clojure. The main idea behind the library is that base UI element (called layer) does not define any state (has no location, size, parent element). Dynamic layout of layers is captured at the rendering time and

Re: Documentation tools

2010-09-07 Thread Eric Schulte
Phil Hagelberg p...@hagelb.org writes: On Tue, Sep 7, 2010 at 1:25 AM, Mark Engelberg mark.engelb...@gmail.com wrote: [...] Javadoc has an interesting property: it considers that the first sentence serves as a summary for the doc. The sentence delimiter is just the point in the case of

Re: Documentation tools

2010-09-07 Thread Sean Corfield
On Tue, Sep 7, 2010 at 1:25 AM, Mark Engelberg mark.engelb...@gmail.com wrote: Docstrings seem designed for fairly terse comments about the nature of the function.  It's great for providing little hints about how the function works to jog one's memory by typing (doc ...) in the REPL, or for

giws a window for people using c/c++ into clojure ..

2010-09-07 Thread Sunil S Nandihalli
Hello everybody, I recently came across giws http://www.scilab.org/products/other/giws a tool to call java code from c/c++ all it really needs to generate all the jni-wrappers is a simple xml file which indicates the class name and the member functions .. some thing as simple as ... package