Re: another question on macros defining functions

2011-06-02 Thread Daniel Renfer
I'm sorry. I misread something in the OP. ignore me, I got nothing. On Fri, Jun 3, 2011 at 1:16 AM, Daniel Renfer wrote: > user> (defmacro foo [x] >        (let [name# (symbol (str "foo-" x))] >          `(defn ~name# [] ( > #'user/foo > user> (let [eff "gee"] (foo eff)) > #'user/foo-eff > >

Re: another question on macros defining functions

2011-06-02 Thread Daniel Renfer
user> (defmacro foo [x] (let [name# (symbol (str "foo-" x))] `(defn ~name# [] ( #'user/foo user> (let [eff "gee"] (foo eff)) #'user/foo-eff On Fri, Jun 3, 2011 at 12:13 AM, Ken Wesson wrote: > On Thu, Jun 2, 2011 at 11:07 PM, Daniel Renfer wrote: >> You don't need to use e

Re: another question on macros defining functions

2011-06-02 Thread Ken Wesson
On Thu, Jun 2, 2011 at 11:07 PM, Daniel Renfer wrote: > You don't need to use eval to create a function dynamically in a macro. You don't need to use eval to create a function via a macro at compile time. But to create a function and intern it in a var whose name is not known until run time is qu

Re: Help with primer on maps, lists or vectors

2011-06-02 Thread MohanR
Atlas is a really useful way to look up information. It even shows the source !! Thanks, Mohan On Jun 1, 4:44 pm, Ambrose Bonnaire-Sergeant wrote: > Hi Mohan, > > If you are exploring the Clojure landscape may I recommend Clojure Atlas. > > http://www.clojureatlas.com/org.clojure:clojure:1.2.0?g

Re: another question on macros defining functions

2011-06-02 Thread Daniel Renfer
You don't need to use eval to create a function dynamically in a macro. For an example, take a look at: https://github.com/duck1123/ciste/blob/master/src/main/clojure/ciste/sections.clj#L34 On Thu, Jun 2, 2011 at 10:34 PM, Ken Wesson wrote: > On Thu, Jun 2, 2011 at 10:06 PM, nil wrote: >> Hi >>

Re: another question on macros defining functions

2011-06-02 Thread Ken Wesson
On Thu, Jun 2, 2011 at 10:06 PM, nil wrote: > Hi > > Here's another macro-noob question. (Thanks for the help on the > previous question and please do let me know if stackoverflow is a more > appropriate place to ask noob questions.) > > I'm trying to write a macro (or a function) that defines/dec

another question on macros defining functions

2011-06-02 Thread nil
Hi Here's another macro-noob question. (Thanks for the help on the previous question and please do let me know if stackoverflow is a more appropriate place to ask noob questions.) I'm trying to write a macro (or a function) that defines/declares specifically named functions. In (let [eff "gee"] (

Re: Announcement: stockings clojure library for easy access to financial data

2011-06-02 Thread fxt
Not exactly. It is more a client API that exposes data from different web services in a consistent way. It takes care of all the tedious stuff: figuring out the right URL and query parameters, parsing the JSON, XML, or CSV responses, handling errors, fixing quirks (e.g. inconsistent time zones in d

Re: Strange Loop 2011 - St. Louis - Sept 18-20

2011-06-02 Thread Martin Kielhorn
2011/3/18 Alex Miller > We do intend to record some or all of the talks. Hi, Are recordings available? Regards, Martin -- 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 f

Re: Help with primer on maps, lists or vectors

2011-06-02 Thread Devin Walters
+1 on the atlas. It's a great way to "surf" clojure. I paid for it not knowing if I'd use it, but the organization is great and would feel comfortable recommending it to a wide range of people interested in clojure. Sent via mobile On Jun 1, 2011, at 6:44 AM, Ambrose Bonnaire-Sergeant wrote:

Re: Best/Idiomatic way of managing data that changes

2011-06-02 Thread yair
Hmm, I posted replies to the previous posters but I might have sent them directly. Apologies. Thanks everyone for the replies, in terms of the game loop itself, it is more or less dictated by using processing, so basically there're callbacks for mouse events and for re-drawing the screen so that'

possible bug in cl-format (rounding floating-point number)

2011-06-02 Thread Travis Treseder
I didn't see this as an open issue on the JIRA bug list, so I thought I would ask about it here. > (cl-format nil "~,5f" -434343.867071) "-434343.86707" > (cl-format nil "~,5f" -434343.867072) "-434343.86707" > (cl-format nil "~,5f" -434343.867075) For input string: "43434386707" [Thrown class

Re: update xml attribute value

2011-06-02 Thread Allen Johnson
> Thanks Allen, it works, I did not know the loc can be treated like a hash. 'loc itself isn't a map even though zip/edit makes it seem that way. Behind the scenes zip/edit calls (zip/node loc) which will return a map, at least in the case of this xml example. zip/edit then applies the function yo

Re: library or namespace doc helper function from repl?

2011-06-02 Thread Alex Robbins
Ironically, I found out about ns-publics from (find-doc "ns-") On Thu, Jun 2, 2011 at 12:57 PM, Avram wrote: > find-doc retrieves too other things though. > > For example, I'm exploring a bunch of libs now (including crane and > fs) but even if I ask only for just "fs" I get the kitchen sink: > >

Re: update xml attribute value

2011-06-02 Thread siyu798
Thanks Allen, it works, I did not know the loc can be treated like a hash. siyu -- 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 p

Re: update xml attribute value

2011-06-02 Thread Allen Johnson
> Does anyone know how to update xml element attribute value on the zipper > data structure? > I have something like > >     >     > > (:require (clojure [xml :as xml] [zip :as zip]) >      [clojure.contrib.zip-filter.xml :as zf]) > (let >   [src (-> "c:/my.xml" io/file xml/parse zip/xml-zip) >

Re: library or namespace doc helper function from repl?

2011-06-02 Thread Avram
find-doc retrieves too other things though. For example, I'm exploring a bunch of libs now (including crane and fs) but even if I ask only for just "fs" I get the kitchen sink: user=> (find-doc "fs") - crane.ec2/cluster-confs ([cluster base-conf]) Return a sequence of co

Re: library or namespace doc helper function from repl?

2011-06-02 Thread James Estes
You could also try (find-doc "libname") On Thu, Jun 2, 2011 at 11:15 AM, Alex Robbins wrote: > (ns-publics 'namespace) will show all the publicly defined things in a > namespace. > > On Thu, Jun 2, 2011 at 11:51 AM, Avram wrote: >> >> Apologies for a silly question, there must be a simple way to

update xml attribute value

2011-06-02 Thread siyu798
Hi, Does anyone know how to update xml element attribute value on the zipper data structure? I have something like (:require (clojure [xml :as xml] [zip :as zip]) [clojure.contrib.zip-filter.xml :as zf]) (let [src (-> "c:/my.xml" io/file xml/parse zip/xml-zip) edf (zf/

Re: library or namespace doc helper function from repl?

2011-06-02 Thread Avram
That's perfect. Thank-you! -A On Jun 2, 10:15 am, Alex Robbins wrote: > (ns-publics 'namespace) will show all the publicly defined things in a > namespace. > > > > On Thu, Jun 2, 2011 at 11:51 AM, Avram wrote: > > > Apologies for a silly question, there must be a simple way to do this > > from

Re: library or namespace doc helper function from repl?

2011-06-02 Thread Alex Robbins
(ns-publics 'namespace) will show all the publicly defined things in a namespace. On Thu, Jun 2, 2011 at 11:51 AM, Avram wrote: > > Apologies for a silly question, there must be a simple way to do this > from the repl, but I can't seem to find it… > > Is there a way from the repl to view all avai

library or namespace doc helper function from repl?

2011-06-02 Thread Avram
Apologies for a silly question, there must be a simple way to do this from the repl, but I can't seem to find it… Is there a way from the repl to view all available functions in the library or namespace? It often happens that I know a library contains functionality I seek, but I don't yet know t

Re: Stout

2011-06-02 Thread Andreas Kostler
Yes, soon programming clojure will be like a night out in town... On 02/06/2011, at 4:31 PM, David Jagoe wrote: > Well I like the name! > > On 2 June 2011 06:21, Andreas Kostler > wrote: >> Hi All, >> >> Stout is a porter stemmer implemention using a snowball-like syntax for >> defining rules

Re: Help with primer on maps, lists or vectors

2011-06-02 Thread Stuart Halloway
Sean, Well said. Just bought my subscription. Stu > On Wed, Jun 1, 2011 at 5:51 PM, Ken Wesson wrote: >> On Wed, Jun 1, 2011 at 10:06 AM, Ambrose Bonnaire-Sergeant >> wrote: >>> Just to be clear, I linked to an unlimited time, free (cost), non-crippled >>> demo. >> Er, if such a thing exists,