Re: clojure starter package for aichallenge ?

2011-10-25 Thread Ulises
I failed to mention that both the files are in a directory named mybot I could be wrong but I think they have to be in the root of the zip file, i.e. no directories. I just zip up ants.clj and MyBot.clj into a file and it works. HTH, U -- You received this message because you are

Pattern matching for map content

2011-10-25 Thread Michael Jaaka
Hi! Pattern matching is fine for sequence or vector destruction. Is is possible to destruct map and make pattern machting? For example I would like to make constraint for to some query service. It would be done as map for example: { :name Tom :surname Jakarta :birthDate (Date.) } or {

Re: where do you put clojure.java.jdbc?????

2011-10-25 Thread jingguo
jayvandal: If you don't use Leiningen, make sure that the pathname for clojure.java.jdbc jar file exists in classpath. On Oct 25, 1:39 pm, Sean Corfield seancorfi...@gmail.com wrote: On Mon, Oct 24, 2011 at 8:36 PM, jayvandal s...@ida.net wrote: I am running Vista. I installed Clojure as

Re: Confusing interplay between macros and metadata

2011-10-25 Thread Marshall T. Vandegrift
Alan Malloy a...@malloys.org writes: It seems to me that it would be nice to have macros automatically include, on their result forms, the metadata from their input form. Of course, macros may wish to add metadata as well, so the two maps should probably be merged. However, there are

Re: Pattern matching for map content

2011-10-25 Thread Ben Smith-Mannschott
On Tue, Oct 25, 2011 at 11:20, Michael Jaaka michael.ja...@googlemail.com wrote: Hi! Pattern matching is fine for sequence or vector destruction. Is is possible to destruct map and make pattern machting? For example I would like to make constraint for to some query service. It would be done

Re: Is Clojure Simple?

2011-10-25 Thread Michael Jaaka
Something is simple as long as your mental model is simple to track. Something which doesn't cause you headache. If you can't build mental model in your head, then its definitely not simple. Every time you think I have mental model which works like this, but before this I must remember about

Re: Is Clojure Simple?

2011-10-25 Thread Laurent PETIT
2011/10/25 Michael Jaaka michael.ja...@googlemail.com: Something is simple as long as your mental model is simple to track. Something which doesn't cause you headache. Disagree. The whole point of Rich's talk is to have people not conflate simple and easy, or it seems to me that this is what

Is there a String protocol?

2011-10-25 Thread Sean Devlin
I was wondering if there was a common protocol to get a string representation of an object yet. Also, are there common protocols for ints, doubles, chars, etc? Having just spent a lot of time writing Python, having an int function that worked on both Strings and Ints was great. I'd love to be

Re: bit-or arity appears limited to 2 items

2011-10-25 Thread rugby_road
Thanks! That was it! Blake On Oct 23, 10:24 pm, Sean Corfield seancorfi...@gmail.com wrote: On Fri, Oct 21, 2011 at 4:12 PM, rugby_road cabjh...@embarqmail.com wrote: The bit-or arity seems to be limited to 2, rather than more, which seems to disagree with the documentation.  I get Wrong

Re: Pattern matching for map content

2011-10-25 Thread Alex Ott
it's better to use https://github.com/clojure/core.match On Tue, Oct 25, 2011 at 11:32 AM, Ben Smith-Mannschott bsmith.o...@gmail.com wrote: On Tue, Oct 25, 2011 at 11:20, Michael Jaaka michael.ja...@googlemail.com wrote: Hi! Pattern matching is fine for sequence or vector destruction. Is is

Re: Pattern matching for map content

2011-10-25 Thread Ben Smith-Mannschott
On Tue, Oct 25, 2011 at 15:33, Alex Ott alex...@gmail.com wrote: it's better to use https://github.com/clojure/core.match Thanks, I'd forgotten about core.match. // ben On Tue, Oct 25, 2011 at 11:32 AM, Ben Smith-Mannschott bsmith.o...@gmail.com wrote: On Tue, Oct 25, 2011 at 11:20, Michael

Re: Clojure 1.3 wonky behavior

2011-10-25 Thread Micah Martin
Right Rich, Thanks. But that was a simplified reduction of real usage. Typically the declare is found in a nested structure: (describe something (context fooey (with bar 42) ; declare comes from this macro (it works (should= 42

Re: Is Clojure Simple?

2011-10-25 Thread Christopher Burke
Interesting discussion of this talk, including comments from Rich (or at least someone claiming to be Rich): http://www.reddit.com/r/programming/comments/lirke/simple_made_easy_by_rich_hickey_video/ On Oct 25, 7:00 am, Laurent PETIT laurent.pe...@gmail.com wrote: 2011/10/25 Michael Jaaka

Losing your head with side effects

2011-10-25 Thread Mike
I need to read WAV files, and don't have time to recode the reader in Clojure. It's Java, and it's got side effects. I can read a number of frames from the WAV file with this code: (defn read-frames [wav-file num-frames] (let [num-samples (* num-frames (.getNumChannels wav-file))

Re: Pattern matching for map content

2011-10-25 Thread Michael Jaaka
Thx, this is exactly what I need. -- 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

Re: Losing your head with side effects

2011-10-25 Thread Mike
It appears I'm not understanding how something works in the REPL (or maybe deeper). For instance: (def big (range 1000)) ; memory is small now (count big) = 1000 ; memory is huge now (System/gc) ; memory is still huge now (def big nil) (System/gc) ; memory is small again So somehow when

Re: R.I.P. John McCarthy

2011-10-25 Thread Sam Aaron
For those in fresh need of having their minds blown, this is always a good detonator: http://www.paulgraham.com/rootsoflisp.html Sam --- http://sam.aaron.name On 25 Oct 2011, at 04:58, finbeu wrote: John McCarthy, the father of Lisp, died last night at the age of 84. -- You received

Code problem: setting an atom from a deref'd atom that's inside a let.

2011-10-25 Thread Tim Robinson
This code probably will not make a whole lotta sense since I reduced it down to show only the problem at hand, but I'm hoping someone can explain why this doesn't work the way I expected it would: = (def data (atom {:k1 v1 :k2 v2 :k3 v3})) #'user/data = (def flag (atom nil)) #'user/flag = (defn

Re: Losing your head with side effects

2011-10-25 Thread Linus Ericsson
Range is lazy. First you define a range, which is just a promise that the variable will be rendering a seq with 10M when asked for the elements. When you count the sequence you realize it and it takes up much space. When you let go if it it's of course GCed. The problem is that you hold on to

Clojure Conj extracurricular activities spreadsheet

2011-10-25 Thread Fogus
All, We talked about the possibility of getting some ideas about extracurricular activities during the Conj days (and possibly training days). I've created a spreadsheet at the link below to collect ideas. It is not my intention to be the organizer of these activities. Instead, if you have an

Re: Code problem: setting an atom from a deref'd atom that's inside a let.

2011-10-25 Thread Marshall T. Vandegrift
Tim Robinson tim.blacks...@gmail.com writes: = (defn oops! [] (let [x1 (atom (hash-map)) v1 (filter #(let [xv1 (@data %)] (if (= xv1 v1) (swap! x1 assoc :k1 other))) (keys @data))

Re: Clojure Conj extracurricular activities spreadsheet

2011-10-25 Thread Fogus
Please note that nothing is too humble! If you have a cool piece of code or technique that you'd like to show off for 10 minutes then by all means put it on the spreadsheet. -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send

Re: Code problem: setting an atom from a deref'd atom that's inside a let.

2011-10-25 Thread Chris Perkins
On Tuesday, October 25, 2011 12:00:04 PM UTC-4, Tim Robinson wrote: This code probably will not make a whole lotta sense since I reduced it down to show only the problem at hand, but I'm hoping someone can explain why this doesn't work the way I expected it would: = (def data (atom {:k1

Re: Clojure Conj extracurricular activities spreadsheet

2011-10-25 Thread David Nolen
ClojureScript Birds of a Feather (I'm not going to lead this one though, but it seems like an obvious add) miniKanren / core.logic Birds of a Feather (I'm open to leading this one) David On Tue, Oct 25, 2011 at 12:16 PM, Fogus mefo...@gmail.com wrote: Please note that nothing is too humble!

Re: Code problem: setting an atom from a deref'd atom that's inside a let.

2011-10-25 Thread Tim Robinson
Yes, that does. Thanks to both of you. Tim On Oct 25, 10:16 am, Chris Perkins chrisperkin...@gmail.com wrote: On Tuesday, October 25, 2011 12:00:04 PM UTC-4, Tim Robinson wrote: This code probably will not make a whole lotta sense since I reduced it down to show only the problem at hand,

Re: Clojure Conj extracurricular activities spreadsheet

2011-10-25 Thread David Nolen
BTW, is this meant to be editable by anyone else? Or are you going to collect the ideas off this thread and enter them? David On Tue, Oct 25, 2011 at 12:11 PM, Fogus mefo...@gmail.com wrote: All, We talked about the possibility of getting some ideas about extracurricular activities during

Re: Clojure Conj extracurricular activities spreadsheet

2011-10-25 Thread Fogus
BTW, is this meant to be editable by anyone else? Or are you going to collect the ideas off this thread and enter them? It should be editable by anyone with a Google account. Please let me know if that's not the case. -- You received this message because you are subscribed to the Google

Re: Code problem: setting an atom from a deref'd atom that's inside a let.

2011-10-25 Thread Tim Robinson
Good question. Also, I wonder if there are any existing realize type functions? i.e. (realize (filter ...)) or how would I realize without printing? Tim On Oct 25, 10:12 am, Marshall T. Vandegrift llas...@gmail.com wrote: Tim Robinson tim.blacks...@gmail.com writes: = (defn oops! []    

Re: Code problem: setting an atom from a deref'd atom that's inside a let.

2011-10-25 Thread Tim Robinson
Never mind... I just used 'count'. And sorry to spam the group. On Oct 25, 10:44 am, Tim Robinson tim.blacks...@gmail.com wrote: Good question. Also, I wonder if there are any existing realize type functions? i.e. (realize (filter ...)) or how would I realize without printing? Tim On

Re: Code problem: setting an atom from a deref'd atom that's inside a let.

2011-10-25 Thread Jack Moffitt
Also, I wonder if there are any existing realize type functions? i.e. (realize (filter ...)) This is what doseq, dorun, and doall are for. jack. -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to

Re: Clojure Conj extracurricular activities spreadsheet

2011-10-25 Thread Chas Emerick
I'm going to add a column for people to add themselves (either by name or handle) as planning to attend. Even an inaccurate count would help the organizer ensure a proper space is found for the session/workshop/talk/whatever. - Chas On Oct 25, 2011, at 12:11 PM, Fogus wrote: All, We

Re: Is there a String protocol?

2011-10-25 Thread Alan Malloy
java.lang.Object.toString On Oct 25, 5:45 am, Sean Devlin francoisdev...@gmail.com wrote: I was wondering if there was a common protocol to get a string representation of an object yet.  Also, are there common protocols for ints, doubles, chars, etc?  Having just spent a lot of time writing

Re: Clojure Conj extracurricular activities spreadsheet

2011-10-25 Thread Roger Austin
One idea would be to organize something for people wanting to set up local clojure meetups. I don't think this needs to be a BOF, but I don't know the best way to promote the idea. Anyone coming with family and/or spouse-dates? If so, let us locals know so we can suggest some local

Re: Clojure Conj extracurricular activities spreadsheet

2011-10-25 Thread nchurch
This is not coding-related, but do we have any musicians in the group? I'm going to have a violin with me and would love to jam or sight-read. Maybe the Overtone guys would be interested in this? If there's any interest I'll set up a doodle poll to see what instruments people might play or

Re: Clojure Conj extracurricular activities spreadsheet

2011-10-25 Thread Chas Emerick
You could just add the session, and ask that attendees indicate their instrument in the attending column? - Chas On Oct 25, 2011, at 3:17 PM, nchurch wrote: This is not coding-related, but do we have any musicians in the group? I'm going to have a violin with me and would love to jam or

Re: Clojure 1.3 wonky behavior

2011-10-25 Thread Laurent PETIT
2011/10/25 Micah Martin micahmar...@gmail.com: Right Rich, Thanks.  But that was a simplified reduction of real usage.   Typically the declare is found in a nested structure: (describe something        (context fooey                (with bar 42)  ; declare comes from this macro              

Re: Is Clojure Simple?

2011-10-25 Thread Olek
Yes, Easy to track. Nevertheless this definition passes Rich's list. -- 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

java.lang.ClassFormatError: Invalid method Code length

2011-10-25 Thread Sergey Didenko
I get the subject error when trying to deserialize a big map (70kb) using load-file. Is this by design? There was an advice in the old thread to use smaller methods. But while small methods are good, breaking continuous data into smaller pieces looks like a hack. Should I use some other

Re: java.lang.ClassFormatError: Invalid method Code length

2011-10-25 Thread Ben Smith-Mannschott
On Tue, Oct 25, 2011 at 22:28, Sergey Didenko sergey.dide...@gmail.com wrote: I get the subject error when trying to deserialize a big map (70kb) using load-file. Is this by design? There was an advice in the old thread to use smaller methods. But while small methods are good, breaking

Re: java.lang.ClassFormatError: Invalid method Code length

2011-10-25 Thread Sergey Didenko
Indeed. Thanks for the answer! If it's really just data (not containing function or macro calls you are expecting to be evaluated), just use (read ...). That will parse the file, returning a Clojure data structure without evaluating it. // ben -- You received this message because you are

Re: Is there a String protocol?

2011-10-25 Thread Ben Smith-Mannschott
On Tue, Oct 25, 2011 at 14:45, Sean Devlin francoisdev...@gmail.com wrote: I was wondering if there was a common protocol to get a string representation of an object yet.  Also, are there common protocols for ints, doubles, chars, etc?  Having just spent a lot of time writing Python, having an

Tutorial/examples of pprint dispatch functions

2011-10-25 Thread Alasdair MacLeod
Hello, Are there any tutorials or examples of setting up pprint dispatch functions? I know the docs suggest looking at the source, but I find it a bit cryptic. In particular I would like to see if it's possible to dispatch on meta-data, record types or more arbitrary values in a map etc.

Clojure Software Developer at Amazon.com in Seattle, WA

2011-10-25 Thread Annie Groeninger
The Consumer Electronics Customer Experience Team is looking for a senior level passionate software engineer to build a complete e- commerce solution for shopping for electronics. A successful candidate will be an experienced and talented engineer who is excited to work with a team of smart

Re: Tutorial/examples of pprint dispatch functions

2011-10-25 Thread Kevin Downey
https://gist.github.com/1314616 On Tue, Oct 25, 2011 at 6:33 AM, Alasdair MacLeod alasdair.clj@gmail.com wrote: Hello, Are there any tutorials or examples of setting up pprint dispatch functions?  I know the docs suggest looking at the source, but I find it a bit cryptic.  In particular

creating a finite sequence of uncertain length

2011-10-25 Thread rugby_road
I have a function without arguments which returns a big,complex object repeatedly until it returns nil. That is to say that the function will produce a sequence of objects, but I don't know how many. I want to call the generator as a lazy sequence but how do I make such a thing? Currently I am

Re: creating a finite sequence of uncertain length

2011-10-25 Thread Alan Malloy
(take-while (complement nil?) (repeatedly myfunc)) On Oct 25, 4:07 pm, rugby_road cabjh...@embarqmail.com wrote: I have a function without arguments which returns a big,complex object repeatedly until it returns nil.  That is to say that the function will produce a sequence of objects, but I

Blog post declare type implements protocol feature

2011-10-25 Thread Brent Millare
I recently read the article http://www.colourcoding.net/blog/archive/2011/10/25/clojure-is-a-get-stuff-done-language.aspx?utm_source=feedburnerutm_medium=feedutm_campaign=Feed%3A+ColourCoding+%28Colour+Coding%29 and it mentions in the Better than a better java section, that Compojure defines a

Idiomatic record construction in 1.3

2011-10-25 Thread Alex Miller
So I'm catching up with the 1.3 defrecord additions (best docs here afaik: http://dev.clojure.org/display/design/defrecord+improvements - will http://clojure.org/datatypes be updated?) In 1.2, records were constructed only with the positional Java constructor: (defrecord Person [first last])

Simplicity, and implications on usage of SQL

2011-10-25 Thread Brent Millare
In the thread about Rich Hickey's talk on simplicity, people bring up the point that Rich suggests to *finally*, learn SQL. The idea is to use declarations to describe your solution, decoupling implementation details. However, its arguable that SQL itself is hard. For example, programmers can

Re: Simplicity, and implications on usage of SQL

2011-10-25 Thread Leonardo Borges
I'm new to clojure but I find the approach [1]Arel takes to SQL very useful. It uses relational algebra to make complex SQL statements composed by smaller structures that represent simple SQL statements. On my current project, we use it as a way to provide the staff will a flexible query builder.

Re: Idiomatic record construction in 1.3

2011-10-25 Thread Colin Jones
+1 A further argument in favor of your choices is that p3 and m2 both work great with higher-order fns, which I didn't immediately find a way to do with any of the others: user= (map (partial apply -Person) [[bob loblaw] [stan sitwell]]) (#user.Person{:first bob, :last loblaw}

Re: Clojure Conj extracurricular activities spreadsheet

2011-10-25 Thread Michael Fogus
We built quite a large list before the internet graffiti started taking over, so if you have an addition then please post it here and it'll be added. -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to

Re: Clojure Conj extracurricular activities spreadsheet

2011-10-25 Thread Chas Emerick
I'd suggest adding a header row (in large, bold type, perhaps) that indicates the desired process. - Chas On Oct 25, 2011, at 10:25 PM, Michael Fogus wrote: We built quite a large list before the internet graffiti started taking over, so if you have an addition then please post it here and

Re: Clojure Conj extracurricular activities spreadsheet

2011-10-25 Thread jt
Like to attend the Go and Literate Programing sessions. On Oct 25, 10:25 pm, Michael Fogus mefo...@gmail.com wrote: We built quite a large list before the internet graffiti started taking over, so if you have an addition then please post it here and it'll be added. -- You received this

Re: Clojure Conj extracurricular activities spreadsheet

2011-10-25 Thread Luc Prefontaine
Please add me to Clojure and the web, Luc P. On Tue, 25 Oct 2011 22:25:41 -0400 Michael Fogus mefo...@gmail.com wrote: We built quite a large list before the internet graffiti started taking over, so if you have an addition then please post it here and it'll be added. -- Luc P.

Re: Clojure Conj extracurricular activities spreadsheet

2011-10-25 Thread Alex Baranosky
Very nice collection of Clojure goodness. The Conj is shaping up to be great! On Oct 25, 2011 11:26 PM, Luc Prefontaine lprefonta...@softaddicts.ca wrote: Please add me to Clojure and the web, Luc P. On Tue, 25 Oct 2011 22:25:41 -0400 Michael Fogus mefo...@gmail.com wrote: We built

Re: Clojure Conj extracurricular activities spreadsheet

2011-10-25 Thread Sean Corfield
On Tue, Oct 25, 2011 at 8:26 PM, Luc Prefontaine lprefonta...@softaddicts.ca wrote: Please add me to Clojure and the web, Me too please. I already added myself to Clojure Tooling before the document got locked down :) -- Sean A Corfield -- (904) 302-SEAN An Architect's View --

Re: Clojure Conj extracurricular activities spreadsheet

2011-10-25 Thread Robert Levy
me too! :) On Tue, Oct 25, 2011 at 11:38 PM, Sean Corfield seancorfi...@gmail.comwrote: On Tue, Oct 25, 2011 at 8:26 PM, Luc Prefontaine lprefonta...@softaddicts.ca wrote: Please add me to Clojure and the web, Me too please. I already added myself to Clojure Tooling before the document

Re: Clojure Conj extracurricular activities spreadsheet

2011-10-25 Thread Baishampayan Ghose
Fogus, Please add me to ClojureScript, MiniKanren, Go and the Heroku drinkup. Regards, BG --- Sent from phone, please excuse brevity. On Oct 26, 2011 10:03 AM, Robert Levy r.p.l...@gmail.com wrote: me too! :) On Tue, Oct 25, 2011 at 11:38 PM, Sean Corfield seancorfi...@gmail.comwrote: On