Re: A Common Lisp format function for Clojure now up

2008-12-22 Thread Josip Gracin
On Mon, Dec 22, 2008 at 8:30 AM, Tom Faulhaber wrote: > You can see/download the current state of it in its github project: > http://github.com/tomfaulhaber/cl-format/ Great job! CL format is a great tool. --~--~-~--~~~---~--~~ You received this message because

Re: non recursive impl in presence of persistence?

2009-01-11 Thread Josip Gracin
On Sun, Jan 11, 2009 at 10:33 PM, e wrote: > thanks for your patience. I think I'm starting to get it. > Interesting discussion on tail recursion. Just to add $0.02... The fact that 'recur' in Clojure is actually used to implement iterative and not recursive processes is easier to understand af

Re: Common Lisp format function is now fully* CL-compatible

2009-01-29 Thread Josip Gracin
Tom, great job!! On Thu, Jan 29, 2009 at 11:38 AM, Marko Kocić wrote: > Tom Faulhaber је написао: >> The cl-format library now implements the full* Common Lisp spec for >> format (* = with the exception of a couple of things used by the >> internals of the CL pretty printer). > > Any plans to in

Extending clojure.contrib.json.write/print-json

2009-05-12 Thread Josip Gracin
(coll? x) :array (keyword? x) :keyword :else :default))) -- mr.sc. Josip Gracin, dipl.ing. direktor razvoja Inge-mark d.o.o., Zavrtnica 17, Zagreb tel: +38516658139, +385919009420 --~--~-~--~~~---~--~~ You receive

Re: Extending clojure.contrib.json.write/print-json

2009-05-14 Thread Josip Gracin
On Thu, May 14, 2009 at 1:57 AM, Stuart Sierra wrote: > The latest version of c.c.json dispatches on the "type" function, > which in turn uses "class."  It should be pretty easily extendible. Thanks! -- mr.sc. Josip Gracin, dipl.ing. direktor razvoja Inge-mark d.o.o.

Var binding and lazy structures behavior (bug?)

2009-05-22 Thread Josip Gracin
Hi! I'm getting unexpected behavior trying to use binding and map. Here's what happens. (def *v*) (defn fun [i] *v*) (defn bv [] (binding [*v* 100] (map fun [1 2]))) Evaluating (bv) throws "Var *v* is unbound exception". I expected it to return (100 100). Using the released Clojure 1.0

Re: Var binding and lazy structures behavior (bug?)

2009-05-23 Thread Josip Gracin
On Sat, May 23, 2009 at 9:37 AM, Meikel Brandmeyer wrote: > So this is no bug, but expected behaviour. I get it. Thanks Meikel! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this grou

How to use primitive array as dispatch value?

2009-06-19 Thread Josip Gracin
Hi! How do I dispatch on Java primitive array? I mean, my dispatch function is 'class' and I'd like to add method for byte arrays. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this grou

Re: How to use primitive array as dispatch value?

2009-06-19 Thread Josip Gracin
On Fri, Jun 19, 2009 at 2:13 PM, pmf wrote: > On Jun 19, 1:31 pm, Josip Gracin wrote: >> How do I dispatch on Java primitive array? I mean, my dispatch >> function is 'class' and I'd like to add method for byte arrays. > > A not very elegant way would be t

Issue with spec-ing higher-order functions; clojure.lang.AFunction$1 cannot be cast to clojure.lang.MultiFn

2019-01-17 Thread Josip Gracin
Hi! The following test throws an exception when run using "lein test" and I can't figure out why. (ns issue (:require [clojure.test :as t] [clojure.spec.alpha :as s] [clojure.spec.test.alpha :as st])) (s/fdef ::boolean-supplier :args (s/cat) :ret boolean?) (def

Re: Issue with spec-ing higher-order functions; clojure.lang.AFunction$1 cannot be cast to clojure.lang.MultiFn

2019-01-17 Thread Josip Gracin
> :ret boolean?)) > > > > On Thursday, January 17, 2019 at 6:38:44 AM UTC-6, Josip Gracin wrote: >> >> Hi! >> >> The following test throws an exception when run using "lein test" and I >> can't figure out why. >> >>

Re: Issue with spec-ing higher-order functions; clojure.lang.AFunction$1 cannot be cast to clojure.lang.MultiFn

2019-01-17 Thread Josip Gracin
Thanks! I've created an issue in Leiningen tracker (https://github.com/technomancy/leiningen/issues/2524) because it might have to do with it. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.c

Exception while setting namespace from Java

2008-09-03 Thread Josip Gracin
Hi! Why is the following code throwing an exception? PushbackReader rdr = new PushbackReader( new StringReader( "(in-ns 'user)" ) ); Object input = LispReader.read(rdr, false, null, false ); clojure.lang.Compiler.eval( input ); java.lang.IllegalStateException: Can't change/establish

Re: Exception while setting namespace from Java

2008-09-04 Thread Josip Gracin
On Wed, Sep 3, 2008 at 11:48 PM, Michael Reid <[EMAIL PROTECTED]> wrote: > The key is that you need to wrap the call to in-ns in > Var.pushThreadBindings(IPersistentMap) / Var.popThreadBindings(). Thanks, Mike! Works perfectly! (btw, only on Java 1.5 and not on 1.6. On 1.6 there's a problem with

Does new ns macro work with add-classpath?

2008-09-04 Thread Josip Gracin
Here's what happens: (add-classpath "file:///home/gracin/src/workspaces/main/maven-cljexec-plugin/target/classes") Under target/classes there's fileutils/fileutils.clj file. (ns testing (:require fileutils)) Could not locate Clojure resource on classpath: fileutils/fileutils.clj [Thrown c

Re: Exception while setting namespace from Java

2008-09-04 Thread Josip Gracin
On Thu, Sep 4, 2008 at 5:41 PM, Michael Reid <[EMAIL PROTECTED]> wrote: > On Thu, Sep 4, 2008 at 6:19 AM, Josip Gracin <[EMAIL PROTECTED]> wrote: >> Thanks, Mike! Works perfectly! (btw, only on Java 1.5 and not on 1.6. >> On 1.6 there's a problem with arguments to

What "reasoner"?

2008-10-03 Thread Josip Gracin
Hi! Rich, in the Boston talk you mentioned that you're considering some kind of a "reasoner" (if I understood correctly) for working with databases. You also mentioned a project whose name sounded like "ios reasoner". I can't find references on anything spelled "ios reasoner". Could you tell m

"Can't create defs outside of current namespace"

2008-11-10 Thread Josip Gracin
Hi! I'd like to use a macro in a configuration .clj file. This macro is supposed to def some vars in appropriate namespaces. However, I'm getting the exception from the subject. Is there a way to write a macro which temporarily binds *ns* to some namespace so that it can "def" things in there?

Re: "Can't create defs outside of current namespace"

2008-11-12 Thread Josip Gracin
Guys, thanks for all the answers. I was posting my follow ups to this thread via Gmail until I realized that Google Groups was bouncing my posts. @#$! Anyway, I used a ref to store my function instead of defn'ing it. Macro expands to (dosync (ref-set fun (fn [] ...))) --~--~-~--~~

Problem with loading, classpath, svn 1106

2008-11-16 Thread Josip Gracin
Hi! I'm getting exception "Could not locate Clojure resource on classpath" and I don't understand why. From the stack trace it seems like it's trying to load stuff according to the old library scheme, i.e. config/ config.clj. Here's the info: Clojure svn 1106. Main jar file contains: com/inge

Re: Problem with loading, classpath, svn 1106

2008-11-16 Thread Josip Gracin
Please disregard! It seems I've had an older version of Clojure in classpath. [EMAIL PROTECTED] Sorry for the noise. On Nov 16, 4:24 pm, Josip Gracin <[EMAIL PROTECTED]> wrote: > I'm getting exception > "Could not locate Clojure resourc