Re: Cyber Dungeon Quest Alpha 1

2011-04-15 Thread Daniel Kersten
Excellent work! Its surprisingly addictive, I wasn't expecting to play
it the whole way through, but after I cleared the first area, I wanted
to keep going :)

Also, its incredibly smooth and the lowest framerate I saw was at the
start of the blood caves, it briefly dropped to 57. The rest of the
time it was pegged at 60 and average processor usage of 75% on a dual
core machine.

Again, great work! I'd love to hear more about your experiences with
writing a game in Clojure.

On 15 April 2011 05:56, msappler  wrote:
> I think I fixed that yesterday evening:
>
> Unable to load resource:http://sappler.ls4.allbytes.de/resatori/
> webstart/cdq.jnlp
> 403 is forbidden.
>
> I wrote deny all in the .htaccess file :)
>
> -
> Want to highlight anything you did in the game? I'm interested in any
> use of agents, etc that you used.
>
> Yes I am thinking of that. Any other things you may want to know
> about?
>
> On 14 Apr., 21:20, Alan  wrote:
>> Similar error for me, on Ubuntu. Exception and "wrapped exception"
>> follow. Looks like you may need permissions set better? 403 is
>> Forbidden.
>>
>> com.sun.deploy.net.FailedDownloadException: Unable to load 
>> resource:http://sappler.ls4.allbytes.de/resatori/webstart/cdq.jnlp
>>         at
>> com.sun.deploy.net.DownloadEngine.actionDownload(DownloadEngine.java:
>> 1372)
>>         at
>> com.sun.deploy.net.DownloadEngine.getCacheEntry(DownloadEngine.java:
>> 1525)
>>         at
>> com.sun.deploy.net.DownloadEngine.getCacheEntry(DownloadEngine.java:
>> 1503)
>>         at
>> com.sun.deploy.net.DownloadEngine.getResourceCacheEntry(DownloadEngine.java:
>> 1609)
>>         at
>> com.sun.deploy.net.DownloadEngine.getResourceCacheEntry(DownloadEngine.java:
>> 1534)
>>         at com.sun.deploy.net.DownloadEngine.getResource(DownloadEngine.java:
>> 217)
>>         at com.sun.deploy.net.DownloadEngine.getResource(DownloadEngine.java:
>> 201)
>>         at com.sun.javaws.Launcher.updateFinalLaunchDesc(Launcher.java:469)
>>         at com.sun.javaws.Launcher.prepareToLaunch(Launcher.java:248)
>>         at com.sun.javaws.Launcher.prepareToLaunch(Launcher.java:199)
>>         at com.sun.javaws.Launcher.launch(Launcher.java:116)
>>         at com.sun.javaws.Main.launchApp(Main.java:416)
>>         at com.sun.javaws.Main.continueInSecureThread(Main.java:248)
>>         at com.sun.javaws.Main$1.run(Main.java:110)
>>         at java.lang.Thread.run(Thread.java:662)
>>
>> java.io.IOException: Server returned HTTP response code: 403 for 
>> URL:http://sappler.ls4.allbytes.de/resatori/webstart/cdq.jnlp
>>         at sun.reflect.GeneratedConstructorAccessor1.newInstance(Unknown
>> Source)
>>         at
>> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:
>> 27)
>>         at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
>>         at sun.net.www.protocol.http.HttpURLConnection
>> $6.run(HttpURLConnection.java:1491)
>>         at java.security.AccessController.doPrivileged(Native Method)
>>         at
>> sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnec...
>> 1485)
>>         at
>> sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection
>> 1139)
>>         at
>> com.sun.deploy.net.BasicHttpRequest.doRequest(BasicHttpRequest.java:
>> 229)
>>         at
>> com.sun.deploy.net.BasicHttpRequest.doRequest(BasicHttpRequest.java:
>> 113)
>>         at
>> com.sun.deploy.net.BasicHttpRequest.doGetRequest(BasicHttpRequest.java:
>> 78)
>>         at
>> com.sun.deploy.net.DownloadEngine.actionDownload(DownloadEngine.java:
>> 1182)
>>         at
>> com.sun.deploy.net.DownloadEngine.getCacheEntry(DownloadEngine.java:
>> 1525)
>>         at
>> com.sun.deploy.net.DownloadEngine.getCacheEntry(DownloadEngine.java:
>> 1503)
>>         at
>> com.sun.deploy.net.DownloadEngine.getResourceCacheEntry(DownloadEngine.java:
>> 1609)
>>         at
>> com.sun.deploy.net.DownloadEngine.getResourceCacheEntry(DownloadEngine.java:
>> 1534)
>>         at com.sun.deploy.net.DownloadEngine.getResource(DownloadEngine.java:
>> 217)
>>         at com.sun.deploy.net.DownloadEngine.getResource(DownloadEngine.java:
>> 201)
>>         at com.sun.javaws.Launcher.updateFinalLaunchDesc(Launcher.java:469)
>>         at com.sun.javaws.Launcher.prepareToLaunch(Launcher.java:248)
>>         at com.sun.javaws.Launcher.prepareToLaunch(Launcher.java:199)
>>         at com.sun.javaws.Launcher.launch(Launcher.java:116)
>>         at com.sun.javaws.Main.launchApp(Main.java:416)
>>         at com.sun.javaws.Main.continueInSecureThread(Main.java:248)
>>         at com.sun.javaws.Main$1.run(Main.java:110)
>>         at java.lang.Thread.run(Thread.java:662)
>> Caused by: java.io.IOException: Server returned HTTP response code:
>> 403 for URL:http://sappler.ls4.allbytes.de/resatori/webstart/cdq.jnlp
>>         at
>> sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection
>> 1436)
>>         at java.net.HttpURL

Re: Clojure interest in Zurich

2011-04-15 Thread Albert Cardona
Clojure user here, based in Zurich.
Unfortunately I'll be away during Brian's visit.

There's another clojure user in the city: a Google employee by the
name of Pablo. He may speak up by himself.

Albert
-- 
http://albert.rierol.net

-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Clojure interest in Zurich

2011-04-15 Thread Jeff Rose
I'm hacking Clojure down in Lugano every day for the next couple
months, and I'd be happy to make the trip up to Zurich and/or Geneva.

-Jeff

On Apr 14, 6:39 pm, Nick Zbinden  wrote:
> Hi im not from zurich but I life near enough. There is no clojure user
> group (sadly). I acctualy don't know of anybody else using clojure in
> Switzerland.
>
> There is however a new "Lisp and Stuff"-Meeting more or less every
> month. It get hosted by a Startup that uses CL. The first to Meetings
> were quite intressting.http://zslug.wordpress.com/
>
> Would be great if there were enough people for a actual clojure user
> group.
>
> On Apr 14, 6:06 pm, Brian Marick  wrote:
>
>
>
>
>
>
>
> > I'll be working in Zurich from 16 May through 3 June. Anyone interested in 
> > weekend or evening Clojure hacking? Clojure user's group?
>
> > -
> > Brian Marick, Artisanal Labrador
> > Contract programming in Ruby and Clojure
> > Occasional consulting on Agilewww.exampler.com,www.twitter.com/marick

-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Is this a good idea? (merging let, cond and ->)

2011-04-15 Thread Alan
Someone implements ilet every couple of months on the mailing list. It
gets a little support as like "well that could be handy", but the
consensus seems to be that the value it adds is not much greater than
the complexity it adds. So some people keep their own private versions
that they use for whatever, but it's unlikely to make it into the
language.

On Apr 14, 4:39 pm, icemaze  wrote:
> I was developing this project of mine, which has an intricate business
> logic, and I wrote a macro that makes programming this kind of stuff
> more comfortable. It's called "ilet", which stands for "implicit let".
> The name is probably no longer appropriate, since I added more
> features to it, but I can't make up anything better right now.
>
> I'd really appreciate it if you could dissuade (or persuade) me from
> posting this to clojure-dev for inclusion in contrib. I need to know
> if this could be useful to someone besides me.
>
> Here's the rationale of the ilet macro. (Warning: the examples are
> silly. See below for a real world example.)
>
> We have "->" in Clojure because it lets you do dataflow-programming-
> like manipulations. The first version of ilet was used in a similar
> way, but it simply bound a symbol ($). It works like "->" but it's
> more flexible, because you can put the value of the previous
> expression wherever you want (e.g., seehttp://pastebin.com/g7k8wK4a).
>
> This is nice, but it's often useful to bind symbols explicitly. Using
> a "let" inside an "ilet" is clunky, so I added this capability inside
> "ilet" itself. If you write [symbol] [expression], ilet interprets
> that as an explicit binding (seehttp://pastebin.com/2VJ8D738).
>
> Finally, I wanted to be able to interrupt this kind of calculations.
> Unfortunately, Clojure doesn't provide any return-like constructs:
> you'd need to use if's and cond's. So I added a new syntax to ilet:
> "<" [condition] [expression]
> where if [condition] is true, the value of the whole ilet expression
> is just [expression] (seehttp://pastebin.com/np2M9kZr).
>
> I hope my explanation was clear, in spite of my poor English.
>
> This is the definition of the ilet macro:http://pastebin.com/nHLifsu3
>
> And this is a real world example, straight from my 
> repository:http://pastebin.com/xGQT1c5h
>
> Thank you all for your input!

-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: call to idiomatic loop works as stand alone but not when wrapped in my function

2011-04-15 Thread Alan
I would do it by making read-files-into-memory take a single argument,
a list of filenames, rather than N arguments, each of which is a
filename. Just drop the & in the function's definition and you should
be done.

On Apr 14, 4:21 pm, Avram  wrote:
> Yes, I am missing a way to turn the [& filenames] into something like
> "name1" "name2" …
>
> How might this be done?  (I am not certain what "type" this would be,
> a stringified version of each item in the sequence, not a sequence
> itself! )
>
> (defn read-files-into-memory
>   [ & filenames ]
>   (print filenames)
>   (map #(read-json-filename %1) filenames))
>
> Many thanks,
> Avram

-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Very odd memory allocation behavior

2011-04-15 Thread Alan
Holy cow wall of text. I really couldn't get through the whole thing,
but I scanned it and I don't see you mentioning output-stream
buffering, which would be one of my primary suspects for this sort of
behavior. Sorry if you've already considered this. As for why it
allocated a bunch of heap: if you tell it it can have a bunch of
memory, it won't bother to GC until it starts to feel pressure. So
even if you only have a 4K "main" object that you reuse, you may have
a lot of transient objects piling up because nobody is in a hurry to
clean them up.

On Apr 14, 7:57 pm, Ken Wesson  wrote:
> I've been using Clojure to automate some file management tasks over
> here; in particular, I whipped together about 100 lines of code to
> build and maintain a hash database of certain files and thereby
> efficiently discover duplications among these files. (Basically, it
> uses a subdirectory of the filesystem as a persisted hashmap, with the
> first few bytes of the hash used to make a tree of subdirectories, the
> leaves of which are hash buckets that collect files;
> FileInputStream/MessageDigest is used to compute file hashes, and
> byte-by-byte comparisons detect identical files from among those with
> identical hashes.)
>
> I noticed something odd after spending a while working in other file
> management tools, then switching to my REPL and hammering off an
> (add-files! "/some/directory"). I flipped to NB's *out* tab to monitor
> its progress and ... what progress? It had printed nothing, and as I
> watched, it continued to print nothing. I switched back to the REPL
> and it looked like it had submitted the sexp to the evaluator. But no
> output. Then I checked the process list and saw the java task
> consuming no CPU (unsusprising since I'd given it an I/O bound task)
> but rapidly growing in memory use. It bloated up by several tens of
> megs before I finally saw "Entering /some/directory" in *out*.
>
> The funny thing is, the code is basically this:
>
> (defn add-files! [dir]
>   (sysprint "Entering " dir)
>   (doseq [f (file-seq dir)]
>     ...))
>
> and sysprint is basically this:
>
> (defn sysprint [& objs]
>   (.println System/out (apply str objs)))
>
> (so the output goes to *out* instead of blitzkrieging the REPL tab's
> scrollback with thousands of lines of output, which then makes looking
> things up from earlier in the REPL session very annoying).
>
> Since the thing froze for a significant amount of time allocating a
> significant amount of memory before the (.println System.out ...)
> succeeded, I conclude that the rest of add-files! is irrelevant here
> and it was something in (apply str "Entering " "/some/directory") or
> in (.println System/out ...) that spent a long time allocating tens of
> megabytes of heap. I'm mystified as to why. The add-files! function
> doesn't usually do this, and it recurses for subdirectories, so the
> "Entering ..." message is printed several times in a typical use.
> After the one long pause, this particular run generated several more
> such messages without any noticeable pauses.
>
> What the heck was it? A GC pause? Why would that grow the heap? The
> heap should be near max size already and perhaps shrink somewhat in a
> GC pause. On the other hand, a long pause accompanied by rapid heap
> growth suggests the construction of a large data structure, so large
> it's not only big in memory but slow to build. But there was no
> significant CPU use by the Java process during the pause, which
> suggests that it was performing *blocking I/O*. That suggests it was
> loading something big from disk, but a) it hadn't even reached the
> doseq yet to start reading and hashing files, b) the files never
> reside completely in live heap at one time (only in 4KB chunks), and
> c) the files themselves were smallish, few exceeding 1MB and none even
> approaching 10MB.
>
> The nearest thing I can figure out is that the process was going ahead
> and hashing files, but the *out* display was lagging way behind. So,
> the sysprint ran, then the doseq was well underway, and the heap grew
> for a while as 4KB chunks were allocated ...
>
> Except a single (byte-array 4096) is being recycled in the hashing
> loop. It's a mutable Java array and DigestInputStream.read() is
> overwriting its contents for each new chunk. And unless the attached
> MessageDigest is building huge temporary data structures, which seems
> unlikely, that's basically it. The heap should have grown by a few
> megs, total, from String, String[], and File object churn, and
> creating one more 4KB array for each new entire file (not each 4KB of
> data), over the entire operation. If there were 20 subdirectories and
> 1000 files, a reasonable estimate, we're looking at:
>
> 20 String[] from File.list() on the subdirectories, average length 51
> (1020/20), average size 212 bytes or so, for 4240 bytes.
>
> 1020 String for file paths, average length say around 30, for 30600 bytes.
>
> 1000 4KB byte[] arrays for just under 4MB.

odd reflection warning

2011-04-15 Thread Jules
I've reduced a compile-time reflection warning that I am getting to the 
following :

put this in a file and compile it (I am using clojure-1.3.0alpha5 and 
clojure-maven-plugin-1.3.7) :

(ns org.dada.demo.mytest)

(if true
  (do
(def ^java.util.Collection some-numbers [0 23 45 64 67 78])
(def ^java.util.NavigableSet numbers (java.util.TreeSet. some-numbers))
))

upon compilation I see :

Reflection warning, org/dada/demo/mytest.clj:6 - call to java.util.TreeSet 
ctor can't be resolved.

but if I strip off the surrounding 'if' e.g. :

(ns org.dada.demo.mytest)

 (do
   (def ^java.util.Collection some-numbers [0 23 45 64 67 78])
   (def ^java.util.NavigableSet numbers (java.util.TreeSet. some-numbers))
   )

and recompile, I do not see the warning.

does anyone else see this ? am I going mad ? :-)

wierd !

Jules



-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Adding key values in a list of maps

2011-04-15 Thread Laurent PETIT
For some people this might read better also :

user=> (->> p (map :b) (reduce +))
9


2011/4/15 Andreas Kostler :
> Or: (reduce #(+ %1 (:b %2)) 0 p)
>
> :)
> On Apr 15, 10:51 am, Andreas Kostler  geosystems.com> wrote:
>> (reduce + (map :b p))
>> Cheers
>> Andreas
>>
>> On 15 April 2011 10:43, Bhinderwala, Shoeb 
>> wrote:
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> >  I am a beginner in Clojure.
>>
>> > I have a list of maps:
>>
>> > (def p '({:a 1 :b 2 :c 4}, {:a 2 :b 3 :c 5}, {:a 3 :b 4 :c 6}))
>>
>> > How do I add up all the :b values in the map? Result should be 9 (=2+3+4)
>>
>> > I know I should be using one of the higher level functions like apply,
>> > reduce and combine it with a custom filter function. But not sure how to
>> > write it.
>>
>> > ***-- Shoeb*
>>
>> >  --
>> > 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
>> > clojure+unsubscr...@googlegroups.com
>> > For more options, visit this group at
>> >http://groups.google.com/group/clojure?hl=en
>>
>> --
>> **
>> Andreas Koestler, Software Engineer
>> Leica Geosystems Pty Ltd
>> 270 Gladstone Road, Dutton Park QLD 4102
>> Main: +61 7 3891 9772     Direct: +61 7 3117 8808
>> Fax: +61 7 3891 9336
>> Email: andreas.koest...@leica-geosystems.com
>>
>> www.leica-geosystems.com*
>>
>> when it has to be right, Leica Geosystems
>>
>> Please  consider the environment before printing this email.
>
> --
> 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
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en

-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Adding key values in a list of maps

2011-04-15 Thread Ulises
> user=> (->> p (map :b) (reduce +))

Alternatively:

user> (def p '({:a 1 :b 2 :c 4}, {:a 2 :b 3 :c 5}, {:a 3 :b 4 :c 6}))
#'user/p
user> (:b (apply merge-with + p))
9

Depending on whether you'll want the other sums or not, this approach
might be appropriate.

U

-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Cyber Dungeon Quest Alpha 1

2011-04-15 Thread Alfredo
Working here too! S cool!!
it remembers me ultima online!!

On Apr 15, 9:27 am, Daniel Kersten  wrote:
> Excellent work! Its surprisingly addictive, I wasn't expecting to play
> it the whole way through, but after I cleared the first area, I wanted
> to keep going :)
>
> Also, its incredibly smooth and the lowest framerate I saw was at the
> start of the blood caves, it briefly dropped to 57. The rest of the
> time it was pegged at 60 and average processor usage of 75% on a dual
> core machine.
>
> Again, great work! I'd love to hear more about your experiences with
> writing a game in Clojure.
>
> On 15 April 2011 05:56, msappler  wrote:
>
>
>
>
>
>
>
> > I think I fixed that yesterday evening:
>
> > Unable to load resource:http://sappler.ls4.allbytes.de/resatori/
> > webstart/cdq.jnlp
> > 403 is forbidden.
>
> > I wrote deny all in the .htaccess file :)
>
> > -
> > Want to highlight anything you did in the game? I'm interested in any
> > use of agents, etc that you used.
>
> > Yes I am thinking of that. Any other things you may want to know
> > about?
>
> > On 14 Apr., 21:20, Alan  wrote:
> >> Similar error for me, on Ubuntu. Exception and "wrapped exception"
> >> follow. Looks like you may need permissions set better? 403 is
> >> Forbidden.
>
> >> com.sun.deploy.net.FailedDownloadException: Unable to load 
> >> resource:http://sappler.ls4.allbytes.de/resatori/webstart/cdq.jnlp
> >>         at
> >> com.sun.deploy.net.DownloadEngine.actionDownload(DownloadEngine.java:
> >> 1372)
> >>         at
> >> com.sun.deploy.net.DownloadEngine.getCacheEntry(DownloadEngine.java:
> >> 1525)
> >>         at
> >> com.sun.deploy.net.DownloadEngine.getCacheEntry(DownloadEngine.java:
> >> 1503)
> >>         at
> >> com.sun.deploy.net.DownloadEngine.getResourceCacheEntry(DownloadEngine.java
> >>  :
> >> 1609)
> >>         at
> >> com.sun.deploy.net.DownloadEngine.getResourceCacheEntry(DownloadEngine.java
> >>  :
> >> 1534)
> >>         at 
> >> com.sun.deploy.net.DownloadEngine.getResource(DownloadEngine.java:
> >> 217)
> >>         at 
> >> com.sun.deploy.net.DownloadEngine.getResource(DownloadEngine.java:
> >> 201)
> >>         at com.sun.javaws.Launcher.updateFinalLaunchDesc(Launcher.java:469)
> >>         at com.sun.javaws.Launcher.prepareToLaunch(Launcher.java:248)
> >>         at com.sun.javaws.Launcher.prepareToLaunch(Launcher.java:199)
> >>         at com.sun.javaws.Launcher.launch(Launcher.java:116)
> >>         at com.sun.javaws.Main.launchApp(Main.java:416)
> >>         at com.sun.javaws.Main.continueInSecureThread(Main.java:248)
> >>         at com.sun.javaws.Main$1.run(Main.java:110)
> >>         at java.lang.Thread.run(Thread.java:662)
>
> >> java.io.IOException: Server returned HTTP response code: 403 for 
> >> URL:http://sappler.ls4.allbytes.de/resatori/webstart/cdq.jnlp
> >>         at sun.reflect.GeneratedConstructorAccessor1.newInstance(Unknown
> >> Source)
> >>         at
> >> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstru
> >>  ctorAccessorImpl.java:
> >> 27)
> >>         at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
> >>         at sun.net.www.protocol.http.HttpURLConnection
> >> $6.run(HttpURLConnection.java:1491)
> >>         at java.security.AccessController.doPrivileged(Native Method)
> >>         at
> >> sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnec...
> >> 1485)
> >>         at
> >> sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection
> >> 1139)
> >>         at
> >> com.sun.deploy.net.BasicHttpRequest.doRequest(BasicHttpRequest.java:
> >> 229)
> >>         at
> >> com.sun.deploy.net.BasicHttpRequest.doRequest(BasicHttpRequest.java:
> >> 113)
> >>         at
> >> com.sun.deploy.net.BasicHttpRequest.doGetRequest(BasicHttpRequest.java:
> >> 78)
> >>         at
> >> com.sun.deploy.net.DownloadEngine.actionDownload(DownloadEngine.java:
> >> 1182)
> >>         at
> >> com.sun.deploy.net.DownloadEngine.getCacheEntry(DownloadEngine.java:
> >> 1525)
> >>         at
> >> com.sun.deploy.net.DownloadEngine.getCacheEntry(DownloadEngine.java:
> >> 1503)
> >>         at
> >> com.sun.deploy.net.DownloadEngine.getResourceCacheEntry(DownloadEngine.java
> >>  :
> >> 1609)
> >>         at
> >> com.sun.deploy.net.DownloadEngine.getResourceCacheEntry(DownloadEngine.java
> >>  :
> >> 1534)
> >>         at 
> >> com.sun.deploy.net.DownloadEngine.getResource(DownloadEngine.java:
> >> 217)
> >>         at 
> >> com.sun.deploy.net.DownloadEngine.getResource(DownloadEngine.java:
> >> 201)
> >>         at com.sun.javaws.Launcher.updateFinalLaunchDesc(Launcher.java:469)
> >>         at com.sun.javaws.Launcher.prepareToLaunch(Launcher.java:248)
> >>         at com.sun.javaws.Launcher.prepareToLaunch(Launcher.java:199)
> >>         at com.sun.javaws.Launcher.launch(Launcher.java:116)
> >>         at com.sun.javaws.Main.launchApp(Main.java:416)
> >>         at com.sun.javaws.Main.continueInSecureThread(Main.java:248)

def and ;dynamic

2011-04-15 Thread Jules
since moving up to 1.3.0alphaxx I've seen lots of compile time warnings 
telling me, as I understand it, that I am dynamically resetting the root 
binding of a var ?

e.g.

Var *session-manager-name* not marked :dynamic true, setting to :dynamic. 
You should fix this before next release!

I've let these go for a while, but was determined to nail them today :

I don't want to add ^dynamic to their definitions, because my intention is 
that they are immutable/const, but I do want to get rid of the warnings.

I figured that somehow, I was resetting them.

So, I look for *session-manager-name* in my code:

[jules@megalodon dada-core]$ find . -name "*.clj" | xargs grep 
session-manager-name
./src/main/clojure/org/dada/core.clj:(def *session-manager-name* 
"SessionManager")
[jules@megalodon dada-core]$ 

So, in the module that I am compiling, there is only one mention and that is 
in the original def.

Then I think that perhaps use-ing or require-ing this module into others 
multiple times (i.e. by pulling in two modules that each pull in the one in 
which the definition resides) may be causing the problem (although I'd be 
very surprised if the runtime did not guard against this happening). So, I 
start thinking about surrounding each def with a check to see if it is 
already bound. Then I start thinking about doing this in a macro. Then I 
figure that it must have already been done. Then I find defonce.

So, I change my const defs to defonces and recompile :

no joy :

Var *session-manager-name* not marked :dynamic true, setting to :dynamic. 
You should fix this before next release!

[jules@megalodon dada-core]$ find . -name "*.clj" | xargs grep 
session-manager-name
./src/main/clojure/org/dada/core.clj:(defonce *session-manager-name* 
"SessionManager")
[jules@megalodon dada-core]$ 

I must be missing something somewhere ?

If the intention of def was to define vars with mutable root bindings then I 
would not need to explicitly declare that intent. So its intention must be 
that root bindings are immutable by default - as mine are. defonce must be 
there to enforce this. So why am I getting all these warnings ?

I must be being dumb, because no-one else seems to have asked this question 
- so, please be gentle :-)

Jules




-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: def and ;dynamic

2011-04-15 Thread David McNeil
Try removing the "*" characters from the names. E.g change *session-
manager-name* to session-manager.

-David

-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: def and ;dynamic

2011-04-15 Thread Jules
It worked !!!

I thought that *xxx* was just a _convention_ to mark a variable as global, 
not a syntax to mark a global as mutable... ?

Thank you for your solution, but can you explain why it works ?

Jules

-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Very odd memory allocation behavior

2011-04-15 Thread Ken Wesson
On Fri, Apr 15, 2011 at 4:17 AM, Alan  wrote:
> Holy cow wall of text. I really couldn't get through the whole thing,
> but I scanned it and I don't see you mentioning output-stream
> buffering, which would be one of my primary suspects for this sort of
> behavior.

I didn't mention it because it isn't that. The println methods flush
the output buffer.

> Sorry if you've already considered this. As for why it
> allocated a bunch of heap: if you tell it it can have a bunch of
> memory, it won't bother to GC until it starts to feel pressure. So
> even if you only have a 4K "main" object that you reuse, you may have
> a lot of transient objects piling up because nobody is in a hurry to
> clean them up.

Yeah, a big chunk of my post was an attempt to estimate how much
volume of such transient objects should have piled up, and it was
nowhere near several tens of meg.

-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Cyber Dungeon Quest Alpha 1

2011-04-15 Thread Wei Hsu
Very cool! I really enjoyed playing it.

On Apr 14, 12:20 pm, Alan  wrote:
> Similar error for me, on Ubuntu. Exception and "wrapped exception"
> follow. Looks like you may need permissions set better? 403 is
> Forbidden.
>
> com.sun.deploy.net.FailedDownloadException: Unable to load 
> resource:http://sappler.ls4.allbytes.de/resatori/webstart/cdq.jnlp
>         at
> com.sun.deploy.net.DownloadEngine.actionDownload(DownloadEngine.java:
> 1372)
>         at
> com.sun.deploy.net.DownloadEngine.getCacheEntry(DownloadEngine.java:
> 1525)
>         at
> com.sun.deploy.net.DownloadEngine.getCacheEntry(DownloadEngine.java:
> 1503)
>         at
> com.sun.deploy.net.DownloadEngine.getResourceCacheEntry(DownloadEngine.java :
> 1609)
>         at
> com.sun.deploy.net.DownloadEngine.getResourceCacheEntry(DownloadEngine.java :
> 1534)
>         at com.sun.deploy.net.DownloadEngine.getResource(DownloadEngine.java:
> 217)
>         at com.sun.deploy.net.DownloadEngine.getResource(DownloadEngine.java:
> 201)
>         at com.sun.javaws.Launcher.updateFinalLaunchDesc(Launcher.java:469)
>         at com.sun.javaws.Launcher.prepareToLaunch(Launcher.java:248)
>         at com.sun.javaws.Launcher.prepareToLaunch(Launcher.java:199)
>         at com.sun.javaws.Launcher.launch(Launcher.java:116)
>         at com.sun.javaws.Main.launchApp(Main.java:416)
>         at com.sun.javaws.Main.continueInSecureThread(Main.java:248)
>         at com.sun.javaws.Main$1.run(Main.java:110)
>         at java.lang.Thread.run(Thread.java:662)
>
> java.io.IOException: Server returned HTTP response code: 403 for 
> URL:http://sappler.ls4.allbytes.de/resatori/webstart/cdq.jnlp
>         at sun.reflect.GeneratedConstructorAccessor1.newInstance(Unknown
> Source)
>         at
> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstru 
> ctorAccessorImpl.java:
> 27)
>         at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
>         at sun.net.www.protocol.http.HttpURLConnection
> $6.run(HttpURLConnection.java:1491)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at
> sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnec...
> 1485)
>         at
> sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection
> 1139)
>         at
> com.sun.deploy.net.BasicHttpRequest.doRequest(BasicHttpRequest.java:
> 229)
>         at
> com.sun.deploy.net.BasicHttpRequest.doRequest(BasicHttpRequest.java:
> 113)
>         at
> com.sun.deploy.net.BasicHttpRequest.doGetRequest(BasicHttpRequest.java:
> 78)
>         at
> com.sun.deploy.net.DownloadEngine.actionDownload(DownloadEngine.java:
> 1182)
>         at
> com.sun.deploy.net.DownloadEngine.getCacheEntry(DownloadEngine.java:
> 1525)
>         at
> com.sun.deploy.net.DownloadEngine.getCacheEntry(DownloadEngine.java:
> 1503)
>         at
> com.sun.deploy.net.DownloadEngine.getResourceCacheEntry(DownloadEngine.java :
> 1609)
>         at
> com.sun.deploy.net.DownloadEngine.getResourceCacheEntry(DownloadEngine.java :
> 1534)
>         at com.sun.deploy.net.DownloadEngine.getResource(DownloadEngine.java:
> 217)
>         at com.sun.deploy.net.DownloadEngine.getResource(DownloadEngine.java:
> 201)
>         at com.sun.javaws.Launcher.updateFinalLaunchDesc(Launcher.java:469)
>         at com.sun.javaws.Launcher.prepareToLaunch(Launcher.java:248)
>         at com.sun.javaws.Launcher.prepareToLaunch(Launcher.java:199)
>         at com.sun.javaws.Launcher.launch(Launcher.java:116)
>         at com.sun.javaws.Main.launchApp(Main.java:416)
>         at com.sun.javaws.Main.continueInSecureThread(Main.java:248)
>         at com.sun.javaws.Main$1.run(Main.java:110)
>         at java.lang.Thread.run(Thread.java:662)
> Caused by: java.io.IOException: Server returned HTTP response code:
> 403 for URL:http://sappler.ls4.allbytes.de/resatori/webstart/cdq.jnlp
>         at
> sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection
> 1436)
>         at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:
> 379)
>         at
> com.sun.deploy.net.BasicHttpRequest.doRequest(BasicHttpRequest.java:
> 190)
>         ... 17 more
>
> On Apr 14, 12:03 pm, mark skilbeck 
> wrote:
>
>
>
>
>
>
>
> > Still doesn't work for me. Same error as Alfredo.
>
> > On Thu, Apr 14, 2011 at 1:26 PM, msappler  wrote:
> > > Hmm I updated the natives-mac.jar.
> > > But dont know this error I dont have a mac..
>
> > > On 14 Apr., 14:16, Walter Chang  wrote:
> > >> failed to run on mbp osx 10.6.7 (java version "1.6.0_24").  here is the
> > >> stack trace:
>
> > >> java.lang.NullPointerException
> > >> at
> > >> org.lwjgl.opengl.MacOSXContextImplementation.setSwapInterval(MacOSXContextI
> > >>  mplementation.java:121)
> > >> at org.lwjgl.opengl.Context.setSwapInterval(Context.java:231)
> > >> at org.lwjgl.opengl.Display.setSwapInterval(Display.java:993)
> > >> at org.lwjgl.opengl.Display.setVSyncEnabled(Display.java:1005)

Re: def and ;dynamic

2011-04-15 Thread David McNeil
> Thank you for your solution, but can you explain why it works ?

As best I recall... in Clojure 1.3 vars are no longer dynamic by
default. In the short-term, to ease the pain of this change, Clojure
1.3 will automatically make vars with earmuffs (e.g. *foo*) into
dynamic variables. But it warns you so you can correct it and
explicitly identify them as dynamic if you need them to be.

-David

-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: def and ;dynamic

2011-04-15 Thread Jules
Aha !

Thanks, David. Now I can sort all those annoying warnings :-)

Jules

-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: You should fix this before next release!

2011-04-15 Thread Stuart Sierra
If you're referring to clojure-contrib in its current, monolithic form, it 
is all deprecated.  New development is happening in new, per-library 
repositories at http://github.com/clojure

-Stuart Sierra
clojure.com

-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: odd reflection warning

2011-04-15 Thread Stuart Sierra
I can't reproduce this in a bare REPL in Clojure 1.3.0-master-SNAPSHOT at 
commit f0a46155ba3b7243.

Probably just a fluke.

-Stuart Sierra
clojure.com

-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: odd reflection warning

2011-04-15 Thread Jules
I don't get it if I type into a repl - only when I put it into a file and 
compile it... It's been hanging around for a while so I figured it was time 
to get to the bottom of it :-)

Jules

-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: odd reflection warning

2011-04-15 Thread Jules
Originally I thought it might be something to do with the overload on the 
TreeSet ctor expecting a Collection when I am probably only able to 
provide Collection, but then I discovered the wierdness around the 'if'...

Jules

-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: odd reflection warning

2011-04-15 Thread Stuart Sierra
It's definitely not caused by the generics: they're a fiction of javac, and 
Clojure ignores them completely.

-S

-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: odd reflection warning

2011-04-15 Thread Laurent PETIT
2011/4/15 Jules :
> I've reduced a compile-time reflection warning that I am getting to the
> following :
>
> put this in a file and compile it (I am using clojure-1.3.0alpha5 and
> clojure-maven-plugin-1.3.7) :
>
> (ns org.dada.demo.mytest)
>
> (if true
>   (do
>     (def ^java.util.Collection some-numbers [0 23 45 64 67 78])
>     (def ^java.util.NavigableSet numbers (java.util.TreeSet. some-numbers))
>     ))
>
> upon compilation I see :
>
> Reflection warning, org/dada/demo/mytest.clj:6 - call to java.util.TreeSet
> ctor can't be resolved.
>
> but if I strip off the surrounding 'if' e.g. :
>
> (ns org.dada.demo.mytest)
>
>  (do
>    (def ^java.util.Collection some-numbers [0 23 45 64 67 78])
>    (def ^java.util.NavigableSet numbers (java.util.TreeSet. some-numbers))
>    )

In the former, the if top level form (and all its content) is compiled
and evaluated at the same time.

In the latter, the top level do is exploded as as many top level forms
as it contains, so the first def is compiled and evaluated, and then
the second def is compiled and evaluated.

So a difference may lie there, between the time were the type hint on
some-numbers is made available to the special form (java.util.TreeSet.
) ...

-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: You should fix this before next release!

2011-04-15 Thread Hugo Duncan
On Fri, 15 Apr 2011 09:28:39 -0400, Stuart Sierra  
 wrote:


If you're referring to clojure-contrib in its current, monolithic form,  
it is all deprecated.  New development is happening in new, per-library

repositories at http://github.com/clojure


A couple of questions to help consider how/when to move to these new repos:

Is there a policy as regards whether the new per-library repos will run  
against clojure 1.2?


Are all contrib libs going to move to new repos? if some existing contrib  
libs will not be moved to new repos, will they be ported to 1.3?


--
Hugo Duncan

--
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Very odd memory allocation behavior

2011-04-15 Thread Alex Miller
Presuming this is reproducible, you should enter this state, then take
thread dumps (via ctrl-break, ctrl-\, jconsole, jstack, jvisualvm,
etc).

If you want more info on what's happening with gc, use -verbose:gc and/
or -XX:+PrintGCDetails

If you want another level of analysis, use a performance profiler like
YourKit or a heap profiler.


On Apr 14, 9:57 pm, Ken Wesson  wrote:
> I've been using Clojure to automate some file management tasks over
> here; in particular, I whipped together about 100 lines of code to
> build and maintain a hash database of certain files and thereby
> efficiently discover duplications among these files. (Basically, it
> uses a subdirectory of the filesystem as a persisted hashmap, with the
> first few bytes of the hash used to make a tree of subdirectories, the
> leaves of which are hash buckets that collect files;
> FileInputStream/MessageDigest is used to compute file hashes, and
> byte-by-byte comparisons detect identical files from among those with
> identical hashes.)
>
> I noticed something odd after spending a while working in other file
> management tools, then switching to my REPL and hammering off an
> (add-files! "/some/directory"). I flipped to NB's *out* tab to monitor
> its progress and ... what progress? It had printed nothing, and as I
> watched, it continued to print nothing. I switched back to the REPL
> and it looked like it had submitted the sexp to the evaluator. But no
> output. Then I checked the process list and saw the java task
> consuming no CPU (unsusprising since I'd given it an I/O bound task)
> but rapidly growing in memory use. It bloated up by several tens of
> megs before I finally saw "Entering /some/directory" in *out*.
>
> The funny thing is, the code is basically this:
>
> (defn add-files! [dir]
>   (sysprint "Entering " dir)
>   (doseq [f (file-seq dir)]
>     ...))
>
> and sysprint is basically this:
>
> (defn sysprint [& objs]
>   (.println System/out (apply str objs)))
>
> (so the output goes to *out* instead of blitzkrieging the REPL tab's
> scrollback with thousands of lines of output, which then makes looking
> things up from earlier in the REPL session very annoying).
>
> Since the thing froze for a significant amount of time allocating a
> significant amount of memory before the (.println System.out ...)
> succeeded, I conclude that the rest of add-files! is irrelevant here
> and it was something in (apply str "Entering " "/some/directory") or
> in (.println System/out ...) that spent a long time allocating tens of
> megabytes of heap. I'm mystified as to why. The add-files! function
> doesn't usually do this, and it recurses for subdirectories, so the
> "Entering ..." message is printed several times in a typical use.
> After the one long pause, this particular run generated several more
> such messages without any noticeable pauses.
>
> What the heck was it? A GC pause? Why would that grow the heap? The
> heap should be near max size already and perhaps shrink somewhat in a
> GC pause. On the other hand, a long pause accompanied by rapid heap
> growth suggests the construction of a large data structure, so large
> it's not only big in memory but slow to build. But there was no
> significant CPU use by the Java process during the pause, which
> suggests that it was performing *blocking I/O*. That suggests it was
> loading something big from disk, but a) it hadn't even reached the
> doseq yet to start reading and hashing files, b) the files never
> reside completely in live heap at one time (only in 4KB chunks), and
> c) the files themselves were smallish, few exceeding 1MB and none even
> approaching 10MB.
>
> The nearest thing I can figure out is that the process was going ahead
> and hashing files, but the *out* display was lagging way behind. So,
> the sysprint ran, then the doseq was well underway, and the heap grew
> for a while as 4KB chunks were allocated ...
>
> Except a single (byte-array 4096) is being recycled in the hashing
> loop. It's a mutable Java array and DigestInputStream.read() is
> overwriting its contents for each new chunk. And unless the attached
> MessageDigest is building huge temporary data structures, which seems
> unlikely, that's basically it. The heap should have grown by a few
> megs, total, from String, String[], and File object churn, and
> creating one more 4KB array for each new entire file (not each 4KB of
> data), over the entire operation. If there were 20 subdirectories and
> 1000 files, a reasonable estimate, we're looking at:
>
> 20 String[] from File.list() on the subdirectories, average length 51
> (1020/20), average size 212 bytes or so, for 4240 bytes.
>
> 1020 String for file paths, average length say around 30, for 30600 bytes.
>
> 1000 4KB byte[] arrays for just under 4MB.
>
> 1000 byte[]s of length 20 to hold the 160-bit hashes generated by
> MessageDigests, for around 28000 bytes.
>
> 1000 MessageDigest objects. If we assume that they contain 20-element
> byte[]s but return defen

Re: You should fix this before next release!

2011-04-15 Thread Armando Blancas
I'm using:

  org.clojure.contrib
  repl-utils
  1.3.0-SNAPSHOT

...

  clojure-snapshots
  http://build.clojure.org/snapshots

...
My user.clj has: (use '[clojure.contrib.repl-utils :only (show run
run*)])
And I launch the repl with:

java -cp "C:\Documents and Settings\ablancas\.m2\repository\org\clojure
\clojure\1.3.0-alpha6\clojure-1.3.0-alpha6.jar;C:\Documentsand Settings
\ablancas\.m2\repository\org\clojure\contrib\repl-utils\1.3.0-SNAPSHOT
\repl-utils-1.3.0-SNAPSHOT.jar;C:\Documents and Settings\ablancas
\.m2\repository\org\clojure\contrib\seq\1.3.0-SNAPSHOT\seq-1.3.0-
SNAPSHOT.jar";c:\dev\projects\clojure clojure.main

Var *feeling-lucky-url* not marked :dynamic true, setting to :dynamic.
You should fix this before next release!
Var *feeling-lucky* not marked :dynamic true, setting to :dynamic. You
should fix this before next release!
Var *local-javadocs* not marked :dynamic true, setting to :dynamic.
You should fix this before next release!
Var *core-java-api* not marked :dynamic true, setting to :dynamic. You
should fix this before next release!
Var *remote-javadocs* not marked :dynamic true, setting to :dynamic.
You should fix this before next release!
Clojure 1.3.0-alpha6
user=>

On Apr 15, 6:28 am, Stuart Sierra  wrote:
> If you're referring to clojure-contrib in its current, monolithic form, it
> is all deprecated.  New development is happening in new, per-library
> repositories athttp://github.com/clojure
>
> -Stuart Sierra
> clojure.com

-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: You should fix this before next release!

2011-04-15 Thread Armando Blancas
> New development is happening in new, per-library
> repositories athttp://github.com/clojure

BTW, last night I noticed that this file hasn't been updated for 1.3:

https://github.com/clojure/clojure-contrib/blob/master/modules/repl-utils/src/main/clojure/clojure/contrib/repl_utils/javadoc.clj

but didn't ask for a fix directly because then they'll tell me that if
it bothers me that much... you know.

-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: You should fix this before next release!

2011-04-15 Thread ataggart
Note that the master branch no longer infers dynamic from the
earmuffs, though a warning will still be emitted:

https://github.com/clojure/clojure/commit/dd49d07b75c619075156d1b38bae9a364ffb63b1


On Apr 14, 9:36 pm, Armando Blancas  wrote:
> Could "before next release" be changed to something like, er, "real
> soon"? (at least for c.c namespaces)
>
> Var *feeling-lucky-url* not marked :dynamic true, setting to :dynamic.
> You should fix this before next release!
> Var *feeling-lucky* not marked :dynamic true, setting to :dynamic. You
> should fix this before next release!
> Var *local-javadocs* not marked :dynamic true, setting to :dynamic.
> You should fix this before next release!
> Var *core-java-api* not marked :dynamic true, setting to :dynamic. You
> should fix this before next release!
> Var *remote-javadocs* not marked :dynamic true, setting to :dynamic.
> You should fix this before next release!

-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: You should fix this before next release!

2011-04-15 Thread Stuart Sierra
On Apr 15, 9:53 am, "Hugo Duncan"  wrote:
> Is there a policy as regards whether the new per-library repos will run  
> against clojure 1.2?

New contrib libraries should work with any version of Clojure that has
the necessary features (such as protocols).

> Are all contrib libs going to move to new repos?

Only if they have a volunteer maintainer and are under active
development. This is not the case for most of the libraries in "old"
clojure-contrib.

In addition, creating a new contrib repo requires the approval of the
Clojure/core team and Rich Hickey. See 
http://dev.clojure.org/display/design/Contrib+Library+Names

> if some existing contrib libs will not be moved to new repos, will they be 
> ported to 1.3?

No.

To put this in context: many, if not most, of the libraries in "old"
contrib are one-offs, hacks, or casual projects. (I'm guilty of this
myself.) They were not subject to design review by Rich or the
rigorous standards he applied to Clojure itself. In an effort to
improve the overall quality of the Clojure library ecosystem, Rich and
Clojure/core have decided to enforce those standards for "new"
contrib.

In the short term, this means that some "creature comfort" libraries
like clojure.contrib.def might become deprecated. In the long term, it
means that Clojure will have a standard library of the highest
possible quality.

Some libraries have already been packaged into Clojure itself: pprint,
java.io, java.browse, java.javadoc, java.shell, reflect, string, and
test.

In "new" contrib we already have tools.logging, tools.macro, java.jmx,
data.json, core.unify, tools.nrepl, data.finger-tree, and data.xml.

-Stuart Sierra
clojure.com

-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: call to idiomatic loop works as stand alone but not when wrapped in my function

2011-04-15 Thread Avram
Thank-you, I think that works for me!  I do need the & to be able to
take in a variable number of arguments, but it looks like I can call
"vec" to convert this to a vector, then call the read-files-into-
memory function that now will take a single argument. Such an elegant
language but difficult to search for things like args or % or & to
find answers ;)

Best,
Avram

On Apr 15, 1:10 am, Alan  wrote:
> I would do it by making read-files-into-memory take a single argument,
> a list of filenames, rather than N arguments, each of which is a
> filename. Just drop the & in the function's definition and you should
> be done.
>
> On Apr 14, 4:21 pm, Avram  wrote:
>
>
>
> > Yes, I am missing a way to turn the [& filenames] into something like
> > "name1" "name2" …
>
> > How might this be done?  (I am not certain what "type" this would be,
> > a stringified version of each item in the sequence, not a sequence
> > itself! )
>
> > (defn read-files-into-memory
> >   [ & filenames ]
> >   (print filenames)
> >   (map #(read-json-filename %1) filenames))
>
> > Many thanks,
> > Avram

-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: call to idiomatic loop works as stand alone but not when wrapped in my function

2011-04-15 Thread Alan
You never "need" & when you are defining your own functions. It's
equivalent to declaring that your function takes one argument, a
vector, and then always wrapping up in a vector whatever args you want
to use.

On Apr 15, 11:05 am, Avram  wrote:
> Thank-you, I think that works for me!  I do need the & to be able to
> take in a variable number of arguments, but it looks like I can call
> "vec" to convert this to a vector, then call the read-files-into-
> memory function that now will take a single argument. Such an elegant
> language but difficult to search for things like args or % or & to
> find answers ;)
>
> Best,
> Avram
>
> On Apr 15, 1:10 am, Alan  wrote:
>
>
>
>
>
>
>
> > I would do it by making read-files-into-memory take a single argument,
> > a list of filenames, rather than N arguments, each of which is a
> > filename. Just drop the & in the function's definition and you should
> > be done.
>
> > On Apr 14, 4:21 pm, Avram  wrote:
>
> > > Yes, I am missing a way to turn the [& filenames] into something like
> > > "name1" "name2" …
>
> > > How might this be done?  (I am not certain what "type" this would be,
> > > a stringified version of each item in the sequence, not a sequence
> > > itself! )
>
> > > (defn read-files-into-memory
> > >   [ & filenames ]
> > >   (print filenames)
> > >   (map #(read-json-filename %1) filenames))
>
> > > Many thanks,
> > > Avram

-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Agent action queuing is asynchronous.

2011-04-15 Thread Ivan Koblik
Hello André,

Just wanted to mention that Java 7 is feature complete. You can see the list
of approved features here:
http://openjdk.java.net/projects/jdk7/features/

It seems that JSR203 was selected for the release, although I remember
reading that Clojure won't support Java 7 for awhile.

Cheers,
Ivan.


On 15 April 2011 02:13, André Caron  wrote:

> After further analysis, I don't think this is globally a good
> strategy.
>
> I looked into a solution with a "(ref (clojure.lang.PersistentQueue/
> EMPTY))" in the selector agent.  The plan was to have be able to queue
> "updates" to the schedule synchronously.  Half-way through the
> implementation, I realized this is equivalent to by-passing the entire
> agent system and still wouldn't work anyways.
>
> Even *if* send/send-off were forced to queue synchronously, the wakeup
> strategy isn't guaranteed to work.  There is still the possibility
> that "Selector.wakeup()" will be executed after the "dispatch" action
> has started, but before it calls "Selector.select()".  What would be
> necessary is for the agent system to sort-of interrupt calls to
> "dispatch" as soon as something else is sent to the agent.  Apart from
> requiring the most insane hack ever, this solution would be nothing
> close to elegant.
>
> Basically, I can't block on "Selector.select()", so I have to poll.
> Can't wait for JSR203 (http://www.jcp.org/en/jsr/detail?id=203) to be
> approved as part of Java 7.  Maybe that API will be less of a
> hassle...
>
> By the way, this is all for an open source project.  I've got the
> basic parts working, but it's still under heavy architectural
> changes.  As soon as version "0.1" is decent, I'll push the repository
> to GitHub and notify you guys.
>
>
> Regards,
>
> André Caron
>
> On Apr 14, 5:58 pm, André Caron  wrote:
> > I've posted this question on StackOverflow[1], but it might be a bit
> > technical, so I'll ask it on the mailing list where I might get more
> > precise expertise on Clojure.
> >
> > [1]:
> http://stackoverflow.com/questions/5669084/clojures-send-is-asynchronous
> >
> > I'm writing a simple networking framework for Clojure using Java's
> > "New I/O" package. It manages a pool of "selector agents", each of
> > which holds a `java.nio.channels.Selector`.
> >
> > I defined a `dispatch` action to for the selector agent. This action
> > blocks on a call to `Selector.select()`. When that returns, the
> > selector agent iterates over the selected keys and performs I/O. When
> > I/O is completed, the selector agent send's itself the dispatch action
> > using `send-off`, effectively looping on calls to `Selector.select()`.
> >
> > When I want to add a new channel or change a channel's interest ops, I
> > send the selector agent the appropriate action and then unblock the
> > selector (it's blocked on `Selector.select()`). This ensures that
> > `(send-off selector-agent dispatch)` in the selector agent is executed
> > after `(send selector-agent add-channel channel)` in whatever agent
> > changed the `SelectionKey.inrestOps()`.
> >
> > I thought this would be bullet-proof since the call to `send-off` is
> > performed before the selector waking up, and thus, before the selector
> > agent send itself the `dispatch` action.  However, this yields
> > inconsistent behavior.  Sometimes, the `dispatch` action occurs first
> > and sometimes it doesn't.  My understanding is that `send` and `send-
> > off` are themselves asynchronous in that they return before the agent
> > action being sent is actually queued in the agent's action backlog.
> >
> > Is this correct?
> >
> > This is normally not an issue; the action dispatch from different
> > agents/threads to the same agent is usually unpredictable and a non-
> > issue.  In this case, the real culprit is that I need to block on
> > `Selector.select()`.  One obvious workaround is to put a timeout on
> > the sleep operation, so that I don't need to manually unblock the
> > selector.  This puts me in the classic polling lose/lose situation,
> > where I need to decide on the polling frequency: too few polls and
> > suffer latency, too many polls and slow down the whole machinery.
> >
> > Does anyone have any better ideas, or can `send`/`send-off` be made to
> > actually queue the actions synchronously such that they are executed
> > int the *exact* order they are sent?
> >
> > Thanks,
> >
> > André Caron
>
> --
> 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
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
>

-- 
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 p

Re: call to idiomatic loop works as stand alone but not when wrapped in my function

2011-04-15 Thread Avram

This makes perfect sense. I reached for this strategy initially but
got lost along the way trying to consider how to enable N inputs via a
-main function.
I'm all set now.
Many thanks,
Avram


On Apr 15, 11:11 am, Alan  wrote:
> You never "need" & when you are defining your own functions. It's
> equivalent to declaring that your function takes one argument, a
> vector, and then always wrapping up in a vector whatever args you want
> to use.
>
> On Apr 15, 11:05 am, Avram  wrote:
>
>
>
> > Thank-you, I think that works for me!  I do need the & to be able to
> > take in a variable number of arguments, but it looks like I can call
> > "vec" to convert this to a vector, then call the read-files-into-
> > memory function that now will take a single argument. Such an elegant
> > language but difficult to search for things like args or % or & to
> > find answers ;)
>
> > Best,
> > Avram
>
> > On Apr 15, 1:10 am, Alan  wrote:
>
> > > I would do it by making read-files-into-memory take a single argument,
> > > a list of filenames, rather than N arguments, each of which is a
> > > filename. Just drop the & in the function's definition and you should
> > > be done.
>
> > > On Apr 14, 4:21 pm, Avram  wrote:
>
> > > > Yes, I am missing a way to turn the [& filenames] into something like
> > > > "name1" "name2" …
>
> > > > How might this be done?  (I am not certain what "type" this would be,
> > > > a stringified version of each item in the sequence, not a sequence
> > > > itself! )
>
> > > > (defn read-files-into-memory
> > > >   [ & filenames ]
> > > >   (print filenames)
> > > >   (map #(read-json-filename %1) filenames))
>
> > > > Many thanks,
> > > > Avram

-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Clojure interest in Zurich

2011-04-15 Thread mrzepka
Great I'm also a clojure user and live near Zurich.

Ready for clojure hacking anytime.
See you soon,
Maximilien

On 14 Apr., 18:39, Nick Zbinden  wrote:
> Hi im not from zurich but I life near enough. There is no clojure user
> group (sadly). I acctualy don't know of anybody else using clojure in
> Switzerland.
>
> There is however a new "Lisp and Stuff"-Meeting more or less every
> month. It get hosted by a Startup that uses CL. The first to Meetings
> were quite intressting.http://zslug.wordpress.com/
>
> Would be great if there were enough people for a actual clojure user
> group.
>
> On Apr 14, 6:06 pm, Brian Marick  wrote:
>
> > I'll be working in Zurich from 16 May through 3 June. Anyone interested in 
> > weekend or evening Clojure hacking? Clojure user's group?
>
> > -
> > Brian Marick, Artisanal Labrador
> > Contract programming in Ruby and Clojure
> > Occasional consulting on Agilewww.exampler.com,www.twitter.com/marick

-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Agent action queuing is asynchronous.

2011-04-15 Thread André Caron
Hi Ivan,

Thanks for the tip.  I'll get the polling solution working until Java 7 is
supported by Clojure.  I really want to see how well I can model different
network protocols using Clojure's agents as asynchronous state machines, as
this is why I started looking at Clojure in the first place.

I have an partial FTP implementation in C++ using I/O completion ports, but
I'm fed up of writing state machines in C++/Java/Python.  It's such a hassle
and Clojure makes this so natural and easy that they're fun to write!

Regards,
André

On Fri, Apr 15, 2011 at 2:22 PM, Ivan Koblik  wrote:

> Hello André,
>
> Just wanted to mention that Java 7 is feature complete. You can see the
> list of approved features here:
> http://openjdk.java.net/projects/jdk7/features/
>
> It seems that JSR203 was selected for the release, although I remember
> reading that Clojure won't support Java 7 for awhile.
>
> Cheers,
> Ivan.
>
>
> On 15 April 2011 02:13, André Caron  wrote:
>
>> After further analysis, I don't think this is globally a good
>> strategy.
>>
>> I looked into a solution with a "(ref (clojure.lang.PersistentQueue/
>> EMPTY))" in the selector agent.  The plan was to have be able to queue
>> "updates" to the schedule synchronously.  Half-way through the
>> implementation, I realized this is equivalent to by-passing the entire
>> agent system and still wouldn't work anyways.
>>
>> Even *if* send/send-off were forced to queue synchronously, the wakeup
>> strategy isn't guaranteed to work.  There is still the possibility
>> that "Selector.wakeup()" will be executed after the "dispatch" action
>> has started, but before it calls "Selector.select()".  What would be
>> necessary is for the agent system to sort-of interrupt calls to
>> "dispatch" as soon as something else is sent to the agent.  Apart from
>> requiring the most insane hack ever, this solution would be nothing
>> close to elegant.
>>
>> Basically, I can't block on "Selector.select()", so I have to poll.
>> Can't wait for JSR203 (http://www.jcp.org/en/jsr/detail?id=203) to be
>> approved as part of Java 7.  Maybe that API will be less of a
>> hassle...
>>
>> By the way, this is all for an open source project.  I've got the
>> basic parts working, but it's still under heavy architectural
>> changes.  As soon as version "0.1" is decent, I'll push the repository
>> to GitHub and notify you guys.
>>
>>
>> Regards,
>>
>> André Caron
>>
>> On Apr 14, 5:58 pm, André Caron  wrote:
>> > I've posted this question on StackOverflow[1], but it might be a bit
>> > technical, so I'll ask it on the mailing list where I might get more
>> > precise expertise on Clojure.
>> >
>> > [1]:
>> http://stackoverflow.com/questions/5669084/clojures-send-is-asynchronous
>> >
>> > I'm writing a simple networking framework for Clojure using Java's
>> > "New I/O" package. It manages a pool of "selector agents", each of
>> > which holds a `java.nio.channels.Selector`.
>> >
>> > I defined a `dispatch` action to for the selector agent. This action
>> > blocks on a call to `Selector.select()`. When that returns, the
>> > selector agent iterates over the selected keys and performs I/O. When
>> > I/O is completed, the selector agent send's itself the dispatch action
>> > using `send-off`, effectively looping on calls to `Selector.select()`.
>> >
>> > When I want to add a new channel or change a channel's interest ops, I
>> > send the selector agent the appropriate action and then unblock the
>> > selector (it's blocked on `Selector.select()`). This ensures that
>> > `(send-off selector-agent dispatch)` in the selector agent is executed
>> > after `(send selector-agent add-channel channel)` in whatever agent
>> > changed the `SelectionKey.inrestOps()`.
>> >
>> > I thought this would be bullet-proof since the call to `send-off` is
>> > performed before the selector waking up, and thus, before the selector
>> > agent send itself the `dispatch` action.  However, this yields
>> > inconsistent behavior.  Sometimes, the `dispatch` action occurs first
>> > and sometimes it doesn't.  My understanding is that `send` and `send-
>> > off` are themselves asynchronous in that they return before the agent
>> > action being sent is actually queued in the agent's action backlog.
>> >
>> > Is this correct?
>> >
>> > This is normally not an issue; the action dispatch from different
>> > agents/threads to the same agent is usually unpredictable and a non-
>> > issue.  In this case, the real culprit is that I need to block on
>> > `Selector.select()`.  One obvious workaround is to put a timeout on
>> > the sleep operation, so that I don't need to manually unblock the
>> > selector.  This puts me in the classic polling lose/lose situation,
>> > where I need to decide on the polling frequency: too few polls and
>> > suffer latency, too many polls and slow down the whole machinery.
>> >
>> > Does anyone have any better ideas, or can `send`/`send-off` be made to
>> > actually queue the actions synchronously such that they

Re: Open Source Projects for Beg/ Intermediate

2011-04-15 Thread Ptr6464
I'd like to second that. Since I started with Clojure it got me, but I
need some practice, so if anyone needs enthusiastic workforce please
let me know also.
To Carin: Good luck in learning Clojure, should be pretty demanding
but it will be great if we learn it.

On Apr 15, 2:47 am, Carin Meier  wrote:
> I have fallen for Clojure.  I would love to be able to practice and
> hone my skills while contributing something to an open source
> project.  Do you have any suggestions for projects that might have
> some low-hanging fruit for a newish person like me.  Any floors that
> need sweeping?
>
> Carin Meier
> @carinmeier

-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Open Source Projects for Beg/ Intermediate

2011-04-15 Thread Alex Robbins
I'm learning Clojure also, and have been working through some of the
project euler problems. (Got started on it from the labrepl
introduction.) It has been a lot of fun and I think I'm learning a
fair amount about how the language works.

http://projecteuler.net/index.php?section=problems

I've got solutions to the first 25 in my github repo. (I'm sure the
code would make more experienced clojurians cry, but I'm excited about
it :)
https://github.com/alexrobbins/Project-Euler-Solutions-Clojure

Alex

On Fri, Apr 15, 2011 at 2:52 PM, Ptr6464  wrote:
> I'd like to second that. Since I started with Clojure it got me, but I
> need some practice, so if anyone needs enthusiastic workforce please
> let me know also.
> To Carin: Good luck in learning Clojure, should be pretty demanding
> but it will be great if we learn it.
>
> On Apr 15, 2:47 am, Carin Meier  wrote:
>> I have fallen for Clojure.  I would love to be able to practice and
>> hone my skills while contributing something to an open source
>> project.  Do you have any suggestions for projects that might have
>> some low-hanging fruit for a newish person like me.  Any floors that
>> need sweeping?
>>
>> Carin Meier
>> @carinmeier
>
> --
> 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
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en

-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Open Source Projects for Beg/ Intermediate

2011-04-15 Thread Alan
dbyrne is writing a sort of interactive "learn clojure by problem-
solving" website at https://github.com/dbyrne/4clojure/. When he
mentioned it to me I tweaked a few things, but it could use another
hand or two. Especially, we're both dreadful web designers and so the
pages look terrible. If someone with experience in that area is
looking for a way to practice clojure while still having familiar
things to work on when something new is overwhelming, this might be
perfect. And I'm sure he'd love the help!

On Apr 14, 6:47 pm, Carin Meier  wrote:
> I have fallen for Clojure.  I would love to be able to practice and
> hone my skills while contributing something to an open source
> project.  Do you have any suggestions for projects that might have
> some low-hanging fruit for a newish person like me.  Any floors that
> need sweeping?
>
> Carin Meier
> @carinmeier

-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Adding key values in a list of maps

2011-04-15 Thread Jeffrey Schwab
On Thursday, April 14, 2011 8:51:47 PM UTC-4, Andreas Kostler wrote:
>
> (reduce + (map :b p))


; Or, save one character:
(apply + (map :b p)) 

-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: def and ;dynamic

2011-04-15 Thread Alan
I heard that this idea of automatically marking *foo* as dynamic had
been dropped for the final 1.3 build. Did I misunderstand?

Also, if Jules really liked those * characters in names, would it be
an option to explicitly declare them ^{:dynamic false}?

On Apr 15, 6:01 am, David McNeil  wrote:
> > Thank you for your solution, but can you explain why it works ?
>
> As best I recall... in Clojure 1.3 vars are no longer dynamic by
> default. In the short-term, to ease the pain of this change, Clojure
> 1.3 will automatically make vars with earmuffs (e.g. *foo*) into
> dynamic variables. But it warns you so you can correct it and
> explicitly identify them as dynamic if you need them to be.
>
> -David

-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Cyber Dungeon Quest Alpha 1

2011-04-15 Thread Julian
I looked at this and thought,  "It reminds me of Wyvern".

The lead developer behind Wyvern, Steve Yegge, was a fairly visionary
and expressive programmer who has written a lot about LISP and JVM
related subjects.

I was reminded of Steve Yegge's post on when he thought he'd rewrite
Wyvern to reduce the number of lines of code, and decided the best way
to do it would be to use LISP, but ended up settling on Mozilla Rhino
(javascript/ecmascript).

http://steve-yegge.blogspot.com/2007/12/codes-worst-enemy.html

It feels like lots of Steve's visionary posts are making an appearance
in the amazing Clojure community.

JG

On Apr 14, 10:03 pm, Wei Hsu  wrote:
> Very cool! I really enjoyed playing it.
>
> On Apr 14, 12:20 pm, Alan  wrote:
>
>
>
>
>
>
>
> > Similar error for me, on Ubuntu. Exception and "wrapped exception"
> > follow. Looks like you may need permissions set better? 403 is
> > Forbidden.
>
> > com.sun.deploy.net.FailedDownloadException: Unable to load 
> > resource:http://sappler.ls4.allbytes.de/resatori/webstart/cdq.jnlp
> >         at
> > com.sun.deploy.net.DownloadEngine.actionDownload(DownloadEngine.java:
> > 1372)
> >         at
> > com.sun.deploy.net.DownloadEngine.getCacheEntry(DownloadEngine.java:
> > 1525)
> >         at
> > com.sun.deploy.net.DownloadEngine.getCacheEntry(DownloadEngine.java:
> > 1503)
> >         at
> > com.sun.deploy.net.DownloadEngine.getResourceCacheEntry(DownloadEngine.java 
> > :
> > 1609)
> >         at
> > com.sun.deploy.net.DownloadEngine.getResourceCacheEntry(DownloadEngine.java 
> > :
> > 1534)
> >         at 
> > com.sun.deploy.net.DownloadEngine.getResource(DownloadEngine.java:
> > 217)
> >         at 
> > com.sun.deploy.net.DownloadEngine.getResource(DownloadEngine.java:
> > 201)
> >         at com.sun.javaws.Launcher.updateFinalLaunchDesc(Launcher.java:469)
> >         at com.sun.javaws.Launcher.prepareToLaunch(Launcher.java:248)
> >         at com.sun.javaws.Launcher.prepareToLaunch(Launcher.java:199)
> >         at com.sun.javaws.Launcher.launch(Launcher.java:116)
> >         at com.sun.javaws.Main.launchApp(Main.java:416)
> >         at com.sun.javaws.Main.continueInSecureThread(Main.java:248)
> >         at com.sun.javaws.Main$1.run(Main.java:110)
> >         at java.lang.Thread.run(Thread.java:662)
>
> > java.io.IOException: Server returned HTTP response code: 403 for 
> > URL:http://sappler.ls4.allbytes.de/resatori/webstart/cdq.jnlp
> >         at sun.reflect.GeneratedConstructorAccessor1.newInstance(Unknown
> > Source)
> >         at
> > sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstru 
> > ctorAccessorImpl.java:
> > 27)
> >         at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
> >         at sun.net.www.protocol.http.HttpURLConnection
> > $6.run(HttpURLConnection.java:1491)
> >         at java.security.AccessController.doPrivileged(Native Method)
> >         at
> > sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnec...
> > 1485)
> >         at
> > sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection
> > 1139)
> >         at
> > com.sun.deploy.net.BasicHttpRequest.doRequest(BasicHttpRequest.java:
> > 229)
> >         at
> > com.sun.deploy.net.BasicHttpRequest.doRequest(BasicHttpRequest.java:
> > 113)
> >         at
> > com.sun.deploy.net.BasicHttpRequest.doGetRequest(BasicHttpRequest.java:
> > 78)
> >         at
> > com.sun.deploy.net.DownloadEngine.actionDownload(DownloadEngine.java:
> > 1182)
> >         at
> > com.sun.deploy.net.DownloadEngine.getCacheEntry(DownloadEngine.java:
> > 1525)
> >         at
> > com.sun.deploy.net.DownloadEngine.getCacheEntry(DownloadEngine.java:
> > 1503)
> >         at
> > com.sun.deploy.net.DownloadEngine.getResourceCacheEntry(DownloadEngine.java 
> > :
> > 1609)
> >         at
> > com.sun.deploy.net.DownloadEngine.getResourceCacheEntry(DownloadEngine.java 
> > :
> > 1534)
> >         at 
> > com.sun.deploy.net.DownloadEngine.getResource(DownloadEngine.java:
> > 217)
> >         at 
> > com.sun.deploy.net.DownloadEngine.getResource(DownloadEngine.java:
> > 201)
> >         at com.sun.javaws.Launcher.updateFinalLaunchDesc(Launcher.java:469)
> >         at com.sun.javaws.Launcher.prepareToLaunch(Launcher.java:248)
> >         at com.sun.javaws.Launcher.prepareToLaunch(Launcher.java:199)
> >         at com.sun.javaws.Launcher.launch(Launcher.java:116)
> >         at com.sun.javaws.Main.launchApp(Main.java:416)
> >         at com.sun.javaws.Main.continueInSecureThread(Main.java:248)
> >         at com.sun.javaws.Main$1.run(Main.java:110)
> >         at java.lang.Thread.run(Thread.java:662)
> > Caused by: java.io.IOException: Server returned HTTP response code:
> > 403 for URL:http://sappler.ls4.allbytes.de/resatori/webstart/cdq.jnlp
> >         at
> > sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection
> > 1436)
> >         at 
> > java.net.HttpURLConnection.getResponseCode(HttpURLConnection.j

Re: ANN: Logos v0.6 - Pattern matching, Tabling, Disequality Constraints, and now on Clojars

2011-04-15 Thread David Nolen
On Mon, Apr 11, 2011 at 2:01 PM, Vagif Verdi  wrote:

> Can it be used as an inference (rule) engine ?


You can now -

(defrel man p)

(fact man 'Bob)
(fact man 'John)
(fact man 'Ricky)

(defrel woman p)
(fact woman 'Mary)
(fact woman 'Martha)
(fact woman 'Lucy)

(defrel likes p1 p2)
(fact likes 'Bob 'Mary)
(fact likes 'John 'Martha)
(fact likes 'Ricky 'Lucy)

(run* [q]
  (exist [x y]
 (likes x y)
 (== q [x y]))) ; ([Bob Mary] [John Martha] [Ricky Lucy])

Cheers!

David

-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Open Source Projects for Beg/ Intermediate

2011-04-15 Thread Carin Meier
Thanks.  Very cool project.

On Apr 15, 5:49 pm, Alan  wrote:
> dbyrne is writing a sort of interactive "learn clojure by problem-
> solving" website athttps://github.com/dbyrne/4clojure/. When he
> mentioned it to me I tweaked a few things, but it could use another
> hand or two. Especially, we're both dreadful web designers and so the
> pages look terrible. If someone with experience in that area is
> looking for a way to practice clojure while still having familiar
> things to work on when something new is overwhelming, this might be
> perfect. And I'm sure he'd love the help!
>
> On Apr 14, 6:47 pm, Carin Meier  wrote:
>
>
>
>
>
>
>
> > I have fallen for Clojure.  I would love to be able to practice and
> > hone my skills while contributing something to an open source
> > project.  Do you have any suggestions for projects that might have
> > some low-hanging fruit for a newish person like me.  Any floors that
> > need sweeping?
>
> > Carin Meier
> > @carinmeier

-- 
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
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en