"closed" maps / reducing runtime errors due to mistyped keywords

2011-04-21 Thread Christian Schuhegger
I am taking up a discussion from 2010: https://groups.google.com/group/clojure/browse_frm/thread/60dff89149c3d2e6/ I would prefer if it would be possible to define "closed maps", e.g. maps that allow only a certain set of keywords, both for get and "set" (like in assoc, assoc-in, update-in, ...).

Re: lein deps error, please help...

2011-04-21 Thread uMany
Thank you very much Mr Hugo. I'm now able to continue with my learning. Hope to be helping people here soon :-) -- 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 memb

Re: lein deps error, please help...

2011-04-21 Thread Hugo Duncan
On Thu, 21 Apr 2011 20:24:15 -0400, uMany wrote: when I try lein deps at a test-project with this I got this long error message: tmp/test-project$ lein deps Downloading: org/clojure/clojure/1.2.0-master-SNAPSHOT/clojure-1.2.0-master-SNAPSHOT.jar from clojure-snapshots Downloading: org/clojure/c

lein deps error, please help...

2011-04-21 Thread uMany
Hi, I'm learning to program Common Lisp and Clojure all at once. I just like them a lot. I like them so much that I am also using Emacs, which is like a pain in the a.. for a total newbie. Any way, I installed sun-java6-jdk ant maven (3.0.2) clojure-contrib jline emacs slime clojure-mode leining

Re: Two types of special symbol

2011-04-21 Thread Kevin Downey
the current compiler doesn't namespace qualify special forms (forms which are built into the compiler) but somethings that the documentation lists as "special forms" are infact macros defined in clojure.core based on the real special forms provided by the compiler. macros are namespace qualified so

ANN: pallet.thread-expr, a macro lib for use with -> argument threading

2011-04-21 Thread Hugo Duncan
By popular demand (well at least two requests), pallet.thread-expr is now an independent lib, extracted from pallet. The library provides a number of macros for use within a -> expression. A couple of examples: (-> 2 (arg-> [x] (* (inc x => 6 (-> 1 (for-> [x [1 2 3]] (+ x)))

Two types of special symbol

2011-04-21 Thread Simon Katz
Hi. (In case it makes a difference, I'm using Clojure 1.2.) If one creates a new namespace using in-ns, the new namespace does not refer to clojure.core, as explained at http://clojure.org/namespaces. I noticed one can use certain special forms in a namespace created using in-ns, but not others:

Re: Resolution of in-ns in a namespace that does not refer clojure.core

2011-04-21 Thread Simon Katz
OK, thanks, will do. Simon On Thu, Apr 21, 2011 at 20:01, Stuart Halloway wrote: > Let's say that little surprises are not a design objective. :-) > > Please do follow up with additional questions as you have them. > > Stu > > Hi Stu. > > Thanks. That makes sense. > > Is this special-casing doc

Re: Meta-circular STM for teaching purposes

2011-04-21 Thread Devin Walters
+1 Thanks so much. Looking forward to digging into the code this evening. Any chance you will have any online course materials for public consumption? Thanks again, Sent via mobile On Apr 21, 2011, at 1:25 PM, Ambrose Bonnaire-Sergeant wrote: > This is great, thanks for sharing! > > Ambros

Re: Resolution of in-ns in a namespace that does not refer clojure.core

2011-04-21 Thread Stuart Halloway
Let's say that little surprises are not a design objective. :-) Please do follow up with additional questions as you have them. Stu > Hi Stu. > > Thanks. That makes sense. > > Is this special-casing documented somewhere, or is it something one can only > discover by playing? More generally,

Re: Resolution of in-ns in a namespace that does not refer clojure.core

2011-04-21 Thread Simon Katz
Hi Stu. Thanks. That makes sense. Is this special-casing documented somewhere, or is it something one can only discover by playing? More generally, I'm wondering whether I'm likely to come across other areas with little surprises as I learn more. An example: I've been exploring special symbols

Re: Meta-circular STM for teaching purposes

2011-04-21 Thread Ambrose Bonnaire-Sergeant
This is great, thanks for sharing! Ambrose On Thu, Apr 21, 2011 at 10:57 PM, Tom Van Cutsem wrote: > The following might be of interest to Clojurians: > > https://github.com/tvcutsem/stm-in-clojure is a meta-circular > implementation of STM in Clojure. It was created purely for educational > pu

Re: Resolution of in-ns in a namespace that does not refer clojure.core

2011-04-21 Thread Stuart Halloway
Hi Simon, in-ns and ns are special cased for convenience. Usually in-ns is used to enter a namespace that has already been loaded, so that core names are available. For example: ;; in a file (ns my.ns) ;; stuff (comment (require 'my.ns) (in-ns 'my.ns) ;; tests ) Stu > Hi. > > I'm l

Resolution of in-ns in a namespace that does not refer clojure.core

2011-04-21 Thread Simon Katz
Hi. I'm learning Clojure, currently using Clojure 1.2. http://clojure.org/namespaces when talking about creating namespaces says: At the Repl it's best to use in-ns, in which case the new namespace will contain mappings only for the classnames in java.lang. In order to access the names from

Re: Emacs 23 issues.

2011-04-21 Thread Vincent Liard
Hi Manoj, > "unreadable message: (:emacs-rex (swank:autodoc (quote ("d" swank:: > %cursor-marker%)) :print-right-margin 132) "user" :repl-thread 4) > exception in read loop > java.lang.RuntimeException: java.lang.Exception: Invalid token: > swank::" I have experienced a similar (or the same) prob

Re: Meta-circular STM for teaching purposes

2011-04-21 Thread Tom Van Cutsem
The following might be of interest to Clojurians: https://github.com/tvcutsem/stm-in-clojure is a meta-circular implementation of STM in Clojure. It was created purely for educational purposes (to allow people to better understand STM by reading a Clojure implementation, without having to descend

Re: Future of clojure.contrib.core/-?> macro

2011-04-21 Thread Ivan Koblik
Hi Paul, Thanks, good to know. Sorry for the misleading email. Cheers, Ivan. On 21 April 2011 08:47, pmbauer wrote: > Ivan, > clojure/core use a different workflow than is typical for github > projects. > The github readme doesn't indicate, but you may find the process here: > > http://clojur

Emacs 23 issues.

2011-04-21 Thread mmwaikar
I am facing problem in using Emacs with Clojure. I am able to use it with Lisp without any problems. The problem is - I start the server using "lein swank" (from my project dir) and then I start Emacs using "M-x slime-connect" but then as soon as I start typing something in Emacs I get the error -

RE: Why I'm getting an empty result?

2011-04-21 Thread Bhinderwala, Shoeb
Your function objects-at is correct but you have mixed up keywords and strings in the definitions. Try the following: (def *objects* '(:bottle :bucket :frog :chain)) (def *object-locations* {:bottle 'living-room, :bucket 'living-room, :chain 'garden, :frog 'garden}) (defn objects-at [loc objs ob

Re: Sharing a frustrating bug: using an atom to a hash as a hash

2011-04-21 Thread Armando Blancas
A type hint makes no difference because the param "state" is treated as an Object instance. user=> (:x @*aa*) 3 user=> (.invoke :x @*aa*) ; [16] invoke : Object (Object) 3 Besides, I don't think it's a good idea trying to setup some sort of static type-checker and strongly-typed functions. You're

Re: Future of clojure.contrib.core/-?> macro

2011-04-21 Thread pmbauer
Ivan, clojure/core use a different workflow than is typical for github projects. The github readme doesn't indicate, but you may find the process here: http://clojure.org/contributing http://clojure.org/patches Cheers, pm On Apr 20, 1:44 am, Ivan Koblik wrote: > Hello Konrad, > > Git workflow i

Re: Future of clojure.contrib.core/-?> macro

2011-04-21 Thread pmbauer
clojure/core use an alternative workflow to typical OSS on github, so the eqqon link is not apropos. The clojure github readme doesn't advertise the workflow, but you can find it here: http://clojure.org/contributing http://clojure.org/patches On Apr 20, 1:44 am, Ivan Koblik wrote: > Hello Konra

Re: Meta

2011-04-21 Thread Nick Zbinden
>What are meta data used for? Its a open system it can be used for anything. If you have data about your data that does not effect equality. Examples: The docstrings you can write in clojure are metadata. (defn my-func "my-func does XY" [] "whatever") This will be expanded to metadata l

Meta

2011-04-21 Thread MohanR
I am just trying to understand the meta data support. What are meta data used for ? Are they similar to the reflective API in Java ? Are they related to any FP theory ? -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send ema

Re: Future of clojure.contrib.core/-?> macro

2011-04-21 Thread Konrad Hinsen
On 20 Apr 2011, at 13:58, Stuart Halloway wrote: There are several new top-level projects at https://github.com/ clojure to cover the various contrib libraries people have asked for. Thanks! I just pushed tools.macro to github. I'll wait a while to see if this causes any catastrophes. If no

Re: Sharing a frustrating bug: using an atom to a hash as a hash

2011-04-21 Thread Albert Cardona
2011/4/21 Tzach : > I made a stupid mistake, and I want to share. This is not the actual code, I > simplify it to demonstrate the point. > > I use a atom to a global hash as follow: > >  (def *aa* (atom {:x 3 :y 4 :z 17})) > > Somewhere on the code, I have a function which look at the state and do