Re: small project to learn clojure

2011-09-17 Thread Dennis Haupt
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 i DID care about my robot :) Am 17.09.2011 04:57, schrieb Alan Malloy: Notice something you do often, and try to automate it. Or find an open- source project you use, and you wish were better in some way, and improve it. Learning a language by

Re: small project to learn clojure

2011-09-17 Thread Thorsten Wilms
On 09/16/2011 11:50 PM, Dennis Haupt wrote: i feel compelled to do something more complex in clojure. not too big, but bigger than what fits in 100 lines and offers some chances to use macros. it should also be fun, maybe something like robocode. Something that is not primitive but may stay

Re: including sound or image files with Leiningen uberjar command

2011-09-17 Thread Dave Ray
Did you forget to set the name of the main class/namespace in project.clj? that would cause the behavior you're seeing. Dave On Saturday, September 17, 2011, loonster tbur...@acm.org wrote: On Sep 16, 1:24 am, Joost jo...@zeekat.nl wrote: On Sep 16, 7:20 am, loonster tbur...@acm.org wrote:

Re: A bit of fun with core.logic

2011-09-17 Thread Tassilo Horn
Ambrose Bonnaire-Sergeant abonnaireserge...@gmail.com writes: Hi Ambrose, For those with a bit of free time to experiment at a REPL this weekend. https://github.com/frenchy64/Logic-Starter/wiki/Arithmetic Oh, I didn't know that one times three is four! :-) Bye, Tassilo -- You received

Re: A bit of fun with core.logic

2011-09-17 Thread Ambrose Bonnaire-Sergeant
Hi Tassilo, On Sat, Sep 17, 2011 at 8:13 PM, Tassilo Horn tass...@member.fsf.orgwrote: Ambrose Bonnaire-Sergeant abonnaireserge...@gmail.com writes: Hi Ambrose, For those with a bit of free time to experiment at a REPL this weekend.

Re: A bit of fun with core.logic

2011-09-17 Thread Tassilo Horn
Ambrose Bonnaire-Sergeant abonnaireserge...@gmail.com writes: Hi Ambrose, https://github.com/frenchy64/Logic-Starter/wiki/Arithmetic Oh, I didn't know that one times three is four! :-) Are you referring to this example? Yes. logic-introduction.numbers= (run 1 [q]

Is there a reason that def- isn't part of the core lib?

2011-09-17 Thread Rob Lally
Hi all, Whilst trying to minimise the visible surface areas of namespaces, I've often felt the need for a def- function/macro that marks a def'ed var with :private metadata. An analog of defn-, if you will. Is there a reason that I shouldn't do this or a reason that it doesn't seem to be a

clojure type casting vs java type casting

2011-09-17 Thread Brent Millare
Is the following clojure code: (long (.some-method-that-returns-int this)) equivalent in semantics and performance to the following java code: (long)some-method-that-returns-int(); I need to make type casts in an inner loop (hot zone), and I was wondering if there was something implicit that

Re: including sound or image files with Leiningen uberjar command

2011-09-17 Thread loonster
Nope. The project.clj is: (defproject depExp 1.0.0-SNAPSHOT :description FIXME: write :dependencies [[org.clojure/clojure 1.2.1] [org.clojure/clojure-contrib 1.2.0]] :main depExp) Tim On Sep 17, 5:05 am, Dave Ray dave...@gmail.com wrote: Did you forget to set the name

Re: including sound or image files with Leiningen uberjar command

2011-09-17 Thread Dave Ray
Ah. I think there are issues with single-segment namespaces and AOT. See comment on first answer here [1]. Maybe converting to depExp.core would help. Dave [1] http://stackoverflow.com/questions/3390268/how-to-setup-the-classpath-when-running-the-jar-made-from-lein-uberjar On Sat, Sep 17, 2011

Re: Is there a reason that def- isn't part of the core lib?

2011-09-17 Thread Mark Rathwell
A previous discussion on the topic can be found here [1]. You can easily add the private metadata yourself: Clojure 1.2: (def ^{:private true} size 25) Clojure 1.3: (def ^:private size 25) I think probably the reason against it is that generally there is not as much reason to use a constant,

Re: including sound or image files with Leiningen uberjar command

2011-09-17 Thread loonster
Dave: I tried adding .core, but to no avail. Still get null pointer exception. This is very puzzling; thanks for the effort...Tim On Sep 17, 8:06 am, Dave Ray dave...@gmail.com wrote: Ah. I think there are issues with single-segment namespaces and AOT. See comment on first answer here [1].

Re: ClojureBox on Window 7: classpath in .emacs file not working

2011-09-17 Thread Roberto Mannai
Update: setting manually an environment variable named HOME, you can choose where clojurebox/emacs will search your .emacs file. On Thu, Sep 15, 2011 at 9:13 PM, Roberto Mannai roberm...@gmail.com wrote: Hi rsgoheen, Here how I'm now able to work with Clojurebox on Windows 7. Perhaps mine it

Re: including sound or image files with Leiningen uberjar command

2011-09-17 Thread loonster
I found the problem. It turns out that uberjar doesn't like .au files; when I converted the audio file into a .wav, the standalone jar works fine. Weird. On Sep 17, 8:51 am, loonster tbur...@acm.org wrote: Dave: I tried adding .core, but to no avail.  Still get null pointer exception.  This

Re: Is there a reason that def- isn't part of the core lib?

2011-09-17 Thread Armando Blancas
There are other nine defs in core that don't have a dash version, either. I guess if they were to take def- they'd have to add the others and then add any new defs in pairs. But there's no reason to write ugly code; just write your own or use a contrib, if available. On Sep 17, 7:54 am, Rob Lally

Re: Reuse of generic Clojure/ClojureScript code?

2011-09-17 Thread Dave Sann
ok -- 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 with your first post. To unsubscribe from this group, send email to

Clojurescript reader cannot handle \ in strings?

2011-09-17 Thread Dave Sann
The cljs reader does not seem able to read strings that contain \ characters. Has anyone else seen this behaviour? probably causes: https://github.com/ibdknox/pinot/issues/4 (ns test (:require [cljs.reader :as reader] )) (defn log [x] (.log js/console x)) (def string

Re: why expressions in macro are not evaluated?

2011-09-17 Thread jingguo
Michael, thanks for your explanation. I have used dorun to solve my problem following your suggestion. -- 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

Re: Clojure embedded in a Java Application

2011-09-17 Thread Eamonn
Hi Meikel Thank you for your reply. Is there a way to populate the HashMap before passing it to the invoke method I tried the following Var keyword = RT.var(clojure.core, keyword); Var hashMap = RT.var(clojure.core, hash-map); hashMap.invoke(keyword.invoke(a), 1); then I created the following

Re: Clojure embedded in a Java Application

2011-09-17 Thread Ken Wesson
On Sat, Sep 17, 2011 at 10:58 PM, Eamonn odon...@gmail.com wrote: Hi Meikel Thank you for your reply.  Is there a way to populate the HashMap before passing it to the invoke method The easiest might be to just pass a map literal (in String form) through the Clojure reader. Variable integers or

Casting numbers to ints

2011-09-17 Thread Brent Millare
Is it possible to cast a number into an int in 1.3.0-RC0? ;user= (type 0) java.lang.Long ;user= (type (int 0)) java.lang.Long -- 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