Has anyone on this group ever tried Forth?

2009-04-10 Thread CuppoJava
Hi everyone, I was browsing through webpages and the language Forth caught my eye. Reading through it's supposed advantages it sounded very interesting, and I was wondering if anyone here has any experience with it, and can comment. I'm asking on the Clojure forum instead of the Forth forum becau

Re: Has anyone on this group ever tried Forth?

2009-04-10 Thread Antony Blakey
On 10/04/2009, at 4:43 PM, CuppoJava wrote: > > Hi everyone, > I was browsing through webpages and the language Forth caught my eye. > Reading through it's supposed advantages it sounded very interesting, > and I was wondering if anyone here has any experience with it, and can > comment. > > I'm

Re: DISCUSS: clojure.contrib.java-utils/as-str

2009-04-10 Thread Eric Tschetter
Sure enough, I get the same results user=> (defn as-str [& args] (apply str (map #(if (instance? clojure.lang.Named %) (name %) %) args))) #'user/as-str user=> (time (dotimes [i 100] (as-str :a))) "Elapsed time: 416.497348 msecs" nil user=> (time (dotimes [i 100] (as-str :a 1))) "Elapse

Suggestion - change doc string of "rand-int"

2009-04-10 Thread hjlee
Hi. (doc rand-int) says "([n]) Returns a random integer between 0 (inclusive) and n (exclusive)." I think the word "integer" may cause some confusion, because it can be interpreted as clojure integer - including int, long and BigInteger. But the reality is with long or BigInteger n, rand-int

Re: clojure dependency management and build

2009-04-10 Thread ronen
Iv been using gant which has built in support for Ivy & Ant (for example http://tiny.cc/tRGKB), since the build scripts are code they make it easier to keep build scripts DRY. On Apr 9, 9:40 pm, Bradford Cross wrote: > On Thu, Apr 9, 2009 at 11:34 AM, Stuart Sierra > wrote: > > > > > > > I keep

Behaviour of clojure.core/print and clojure.core/println

2009-04-10 Thread Laurent PETIT
Hello, While trying to create a very small Hello world demonstration to a friend, I saw that (print) and (println) are concatenating their arguments with spaces interposed. I thought at first (println "a") was a shorter variant of (.println *out* "a") and (println "a" "b" "c") of (doseq [str ["a

Re: DISCUSS: clojure.contrib.java-utils/as-str

2009-04-10 Thread Stephen C. Gilardi
On Apr 10, 2009, at 3:55 AM, Eric Tschetter wrote: Sure enough, I get the same results user=> (defn as-str [& args] (apply str (map #(if (instance? clojure.lang.Named %) (name %) %) args))) #'user/as-str user=> (time (dotimes [i 100] (as-str :a))) "Elapsed time: 416.497348 msecs" nil us

Re: Question about metadata on map keys

2009-04-10 Thread Stuart Sierra
On Apr 10, 12:14 am, Jason Wolfe wrote: ... > Namely, if a map already contains a given key, when you attempt to > assoc in a version of the key with new metadata this is not recorded. > It seems that the map always retains the original key: >... > Is this desired behavior?  If so, is there a bet

Re: set-system-properties

2009-04-10 Thread Stuart Sierra
On Apr 9, 10:48 pm, Stuart Halloway wrote: > Yes to almost all of this (r662). I am not totally comfortable with   > the false/"false" conversion. Cool. I'm not crazy about false/"false" either, since it's not symmetric. -Stuart --~--~-~--~~~---~--~~ You received

Re: Has anyone on this group ever tried Forth?

2009-04-10 Thread Martial Boniou
Hi, I confirm. Factor deserves a look: it's a genuine combination of the Common Lisp world (homoiconic, macros, CLOS) and the Smalltalk RAD created by mixing Self and Forth. Plus there's concurrency support and native code compilation. I always liked concatenative programming I discovered 15 year

Re: Question about metadata on map keys

2009-04-10 Thread Kevin Downey
I think you misunderstand, I don't think he is expecting to being able to use :foo as a key twice with different metadata. I think he wants something like: (def x {[:a] 1 [:b] 2}) then (meta (first (keys (assoc x (with-meta [:a] {:x 1}) 2 ;(-> (assoc x (with-meta [:a] {:x 1})) keys first m

Re: Enlive questions

2009-04-10 Thread David Nolen
This is great. I had thought that supporting some kind of partial template thing would be interesting, but that's actually just my poor logic at work ;) It seems like with the new version of Enlive I could do something like this: (deftemplate pageA-template path [] [[:div (attr? :tiptree:repl

Re: Enlive questions

2009-04-10 Thread David Nolen
Real quick thought: (deftemplate-generator template-generator [args] rule-vector transform-fn) Would produce a template generator. (def template-name (template-generator path-to-xml-or-file-or-xml-string)) Would produce a real template. (apply str (template-name arg1 arg2 arg3)) --~--~

Re: Has anyone on this group ever tried Forth?

2009-04-10 Thread Rayne
Factor is a positively amazing language that I've checked out in the past. It has virtually no step-by-step tutorial-like information to teach you the language so you are forced to read source code and raw documentation. While it's documented thoroughly I can't bring myself to try to learn it to a

Re: Got a Clojure library?

2009-04-10 Thread Tom Faulhaber
Rich, Since cl-format/pprint has now moved into contrib, we should remove the existing cl-format entry and replace it with this: Name: pprint URL :http://code.google.com/p/clojure-contrib/ Author: Tom Faulhaber Tags: pretty printing, formatted output, Common Lisp compatibility License: EPL Depen

update-in wildcards?

2009-04-10 Thread Ozzi Lee
I have a structure of nested Maps and Vectors as follows: (def document {:sections [{:items [{:quantity 1} {:quantity 2}]} {:items [{:quantity 3} {:quantity 4}]}]}) The document has a vector of sections (one, in this case), each section has a v

Re: Has anyone on this group ever tried Forth?

2009-04-10 Thread CuppoJava
Factor sounds very interesting. But I'm concerned about Slava's decision to run it off his own VM and write his own set of standard libraries. Have you guys ever run into any problems with the lack of libraries? -Patrick --~--~-~--~~~---~--~~ You received this messa

Re: Question about metadata on map keys

2009-04-10 Thread Jason Wolfe
> Probably this is expected, since metadata is defined not to affect > equality, and maps rely on equality semantics.  I would recommend > against storing metadata on map keys.  In general, if the metadata > matters for the "value" of an object, then it shouldn't be metadata. > > Some alternatives

Re: Got a Clojure library?

2009-04-10 Thread Laurent PETIT
Hi, Beware there's a repetition of the "this" word in the definition of cl-format : 2009/4/10 Tom Faulhaber > > > perform destructuring on the the input arguments rather than having > --~--~-~--~~~---~--~~ You received this message because you are subscribed to

Re: Has anyone on this group ever tried Forth?

2009-04-10 Thread Dave Rothlisberger
I can't speak for "getting real work done", but out of academic / enlightening-in-its-simplicity interest, I think everyone should read Leo Brodie's "Starting Forth": http://www.forth.com/starting-forth/sf1/sf1.html On Apr 10, 2:13 am, CuppoJava wrote: > Hi everyone, > I was browsing through

Re: Got a Clojure library?

2009-04-10 Thread Rich Hickey
On Apr 10, 2:07 pm, Tom Faulhaber wrote: > Rich, > > Since cl-format/pprint has now moved into contrib, we should remove > the existing cl-format entry and replace it with this: > > Name: pprint > URL :http://code.google.com/p/clojure-contrib/ > Author: Tom Faulhaber > Tags: pretty printing, fo

Re: Has anyone on this group ever tried Forth?

2009-04-10 Thread Rayne
It has libraries for freakin' everything. On Apr 10, 1:47 pm, CuppoJava wrote: > Factor sounds very interesting. But I'm concerned about Slava's > decision to run it off his own VM and write his own set of standard > libraries. Have you guys ever run into any problems with the lack of > librarie

Re: DISCUSS: clojure.contrib.java-utils/as-str

2009-04-10 Thread Eric Tschetter
That makes sense. On Fri, Apr 10, 2009 at 6:16 AM, Stephen C. Gilardi wrote: > > On Apr 10, 2009, at 3:55 AM, Eric Tschetter wrote: > >> Sure enough, I get the same results >> >> user=> (defn as-str >> [& args] >> (apply str (map #(if (instance? clojure.lang.Named %) (name %) %) args))) >> #'use

Re: Has anyone on this group ever tried Forth?

2009-04-10 Thread e
J seems cool, and, from what I understand, is a descendant of forth. How does Factor compare to J? Rayne, what is "it" forth or Factor? I know J has awesome documentation . . . but I still haven't taken the time for it. Lotta languages on the list, but I need one from that category. I guess it

Re: Question about metadata on map keys

2009-04-10 Thread Stuart Sierra
On Apr 10, 3:54 pm, Jason Wolfe wrote: > In case this helps, my use case is as follows.  I'm working on search > algorithms that manage maps from keys representing reachable states to > values representing the cost of reaching those states.  When I union > two such maps, I retain the minimum valu

Re: Has anyone on this group ever tried Forth?

2009-04-10 Thread Pinocchio
Martial Boniou wrote: > Hi, > > I confirm. Factor deserves a look: it's a genuine combination of the > Common Lisp world (homoiconic, macros, CLOS) and the Smalltalk RAD > created by mixing Self and Forth. Plus there's concurrency support and > native code compilation. > I always liked concatenati