Re: Idiomatic way to document defn's

2011-05-13 Thread Steven E. Harris
Paul deGrandis writes: > (defn create-session! > "Create shared sessions and their associated channel. > Arguments: I've found the two-space indentation to be a brittle convention that's not going to port well to other presentations of the text, or adapt well to a change in the `doc' functio

How to defer name resolution till run-time?

2011-05-13 Thread Trastabuga
I am trying to compile a project with lein uberjar. My main function looks like: (defn -main [& args] (do (require 'swank.swank) (swank.swank/start-repl 4006)) (run-jetty main-routes {:port 8080 :join? false}) ) The compiler complains about swank.swank/start-repl because the swank sym

Re: How to merge two ArrayMaps?

2011-05-13 Thread Laurent PETIT
Hello, I'm not seeing clearly what you're after. Given your example, it seems that it can be solved just by the following code: => (def e1 [{:a 1 :b "b" :c 300 }{:a 2 :b "a" :c 500 }]) (def e2 [{:a 1 :d "blah"}{:a 2 :d "blah2"}]) #'user/e1 #'user/e2 => (map merge e1 e2) ({:d "blah", :a 1, :b

Re: Collaboration Proposal: Beyond CLOS Generic Methods, Predicate Dispatch, and Pattern Matching

2011-05-13 Thread Brent Millare
Sounds like a lot of detail oriented improvements. Regardless, you can be sure I'll be using it when its done (or even if its not done yet, I'd be happy to help with real world testing :) ) -Brent On May 13, 3:57 pm, David Nolen wrote: > On Fri, May 13, 2011 at 3:36 PM, Brent Millare wrote: > >

Re: Idiomatic way to document defn's

2011-05-13 Thread Paul deGrandis
I've adopted: (defn create-session! "Create shared sessions and their associated channel. Arguments: some-req-arg - a vector, something descriptive. [session-id] - a String, the session's identifier. [auto-generated UUID] Returns: m - a MapEntry, the stored session Notes: I

Re: Idiomatic way to document defn's

2011-05-13 Thread Stuart Sierra
Hi Ralph, There's no established idiom beyond the guidelines at http://dev.clojure.org/display/design/Library+Coding+Standards I am not aware of any tool that parses Clojure docstrings for Javadoc-style "@param" and "@return", although I would like to see that happen. For now, Clojure docstrin

Re: Collaboration Proposal: Beyond CLOS Generic Methods, Predicate Dispatch, and Pattern Matching

2011-05-13 Thread David Nolen
On Fri, May 13, 2011 at 3:36 PM, Brent Millare wrote: > However, you state here that you will build something more powerful > than predicate dispatch. From the references you cited, I don't > understand how you propose to accomplish this. The first paper says > predicate dispatch is more generaliz

Re: Collaboration Proposal: Beyond CLOS Generic Methods, Predicate Dispatch, and Pattern Matching

2011-05-13 Thread Brent Millare
"After a bit of reading and prototyping, I'm quite confident that it's possible to build something considerably more powerful than generic methods or predicate dispatch" David, I'm trying to understand some of the details of the big picture and motivation. I was skimming through the first paper y

Re: Clojure 1.3 Alpha 7

2011-05-13 Thread Sean Corfield
On Fri, May 13, 2011 at 2:07 PM, Christopher Redinger wrote: > You are correct, it was added in Alpha 7. Thanx Christopher. -- Sean A Corfield -- (904) 302-SEAN An Architect's View -- http://corfield.org/ World Singles, LLC. -- http://worldsingles.com/ Railo Technologies, Inc. -- http://www.getr

Re: Clojure 1.3 Alpha 7

2011-05-13 Thread Christopher Redinger
On Friday, May 13, 2011 3:03:11 PM UTC-4, Sean Corfield wrote: > > To save me digging into git commits, do you (or anyone else) happen to > > know for sure when "realized?" was added? It's not in the release > notes below... I *think* it's new in Alpha 7...? > You are correct, it was added in Alph

Re: Clojure 1.3 Alpha 7

2011-05-13 Thread Sean Corfield
Thank you! To save me digging into git commits, do you (or anyone else) happen to know for sure when "realized?" was added? It's not in the release notes below... I *think* it's new in Alpha 7...? Sean On Fri, May 13, 2011 at 1:42 PM, Christopher Redinger wrote: > Clojure 1.3 Alpha 7 is now ava

Clojure 1.3 Alpha 7

2011-05-13 Thread Christopher Redinger
Clojure 1.3 Alpha 7 is now available at http://clojure.org/downloads 0 Changes from 1.3 Alpha 6 to 1.3 Alpha 7 1 Changes from 1.3 Alpha 5 to 1.3 Alpha 6 2 Changes from 1.3 Alpha 4 to 1.3 Alpha 5 3 Changes from 1.3 Alpha 3 to 1.3 Alpha 4 4 Changes from 1.3 Alpha 2 to 1.3 Alpha 3 5 Changes fr

Re: possibly non-intuitive behaviour of clojure.set/rename-keys and possible enhancement suggestion

2011-05-13 Thread Steve Miner
Using the array-map sounds like a good work-around when you know there are potential key collisions. It would also allow you to swap keys reliably using a temporary key. (rename-keys {:a 1 :b 2 :c 3} (array-map :a :tmp :b :a :tmp :b)) ;; {:b 1, :a 2, :c 3} The larger question is: Should ren

Re: extend-type at runtime?

2011-05-13 Thread Base
SWEET! Thank you David! Fantastic job on the the logic programming by the way! I was so excited to see this implemented in Clojure and cannot wait to dig into this more. I am eagerly awaiting the predicate dispatch and matching! On May 13, 11:06 am, David Nolen wrote: > On Fri, May 13, 2011 a

Re: extend-type at runtime?

2011-05-13 Thread David Nolen
On Fri, May 13, 2011 at 12:04 PM, Base wrote: > It is possible to extend types at runtime to add new behavior > dynamically? > Yes, an example here, http://dosync.posterous.com/51626638 David -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post

extend-type at runtime?

2011-05-13 Thread Base
It is possible to extend types at runtime to add new behavior dynamically? -- 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

Idiomatic way to document defn's

2011-05-13 Thread Ralph
What is the idiomatic way to document defn's? In particular, should we use "@param", "@returns", etc. to document parameters, return values, etc. It might be good to have some standard way to specify expected parameter types (other that type hints), especially for a dynamically typed language.

Re: Collaboration Proposal: Beyond CLOS Generic Methods, Predicate Dispatch, and Pattern Matching

2011-05-13 Thread David Nolen
On Fri, May 13, 2011 at 2:04 AM, Heinz N. Gies wrote: > Hearing Pattern Matching, > do you mean Erlang like Pattern matching? > > Regards, > Heinz Erlang, OCaml, SML, Haskell, Scala all have the kind of pattern matching I'm talking about. One important point is that they all support guards on p

Re: Collaboration Proposal: Beyond CLOS Generic Methods, Predicate Dispatch, and Pattern Matching

2011-05-13 Thread David Nolen
On Fri, May 13, 2011 at 4:18 AM, Antony Blakey wrote: > > On 13/05/2011, at 2:21 PM, David Nolen wrote: > > > - instance? or custom predicate matches done w/ if > > I did quite a bit of this in the context of a Smalltalk implementation. One > of the key features is fast type testing. I note in you

Re: Collaboration Proposal: Beyond CLOS Generic Methods, Predicate Dispatch, and Pattern Matching

2011-05-13 Thread picoVerse
I am a Dolphin Smalltalk programmer. I am making a multi dialect combination of Lisp and Smalltalk. I would like to add something called ClojureLisp to it. I think that I could learn a lot from your project. But I don't know that I know enough of the right things to be able to help you. I spend all

Re: Import other .clj files

2011-05-13 Thread Jonathan Fischer Friberg
With the structure: test - test1.clj - test2.clj then test1.clj should start with (ns test.test1) and test2.clj should start with (ns test.test2) Jonathan On Fri, May 13, 2011 at 9:15 AM, MohanR wrote: > It is solved but the rules are not clear. > > If I have (ns test) in both .clj files and t

Re: Collaboration Proposal: Beyond CLOS Generic Methods, Predicate Dispatch, and Pattern Matching

2011-05-13 Thread Antony Blakey
On 13/05/2011, at 2:21 PM, David Nolen wrote: > - instance? or custom predicate matches done w/ if I did quite a bit of this in the context of a Smalltalk implementation. One of the key features is fast type testing. I note in your example case you are relying on an id generic to provide the t

Re: Import other .clj files

2011-05-13 Thread MohanR
It is solved but the rules are not clear. If I have (ns test) in both .clj files and the files are in /test then I am able to call one from the other. I am not specifically pointing my classpath to /test at all. What is the link between classpath, ns and the folder structure ? Thanks, Mohan --