Re: [ANN] okasaki-clojure

2011-12-23 Thread JuanManuel Gimeno Illa
> > Very, very cool. Is this just sugar for map pattern matching? > I use only vector matching. When I define a datatype, for instance: (defdatatype ::Type Constant (Expr x y)) I create symbols Constant, with value ::Constant and Expr with value (fn [x y] [::Expr x y]). That way I can use the

Re: core.logic

2011-12-23 Thread Ambrose Bonnaire-Sergeant
Or is this more what you're after? https://gist.github.com/1516727 Ambrose On Sat, Dec 24, 2011 at 3:39 PM, Sunil S Nandihalli < sunil.nandiha...@gmail.com> wrote: > Hi, > I would like to create a predicate which would accept two keys k1,k2 and > two maps m1 m2 .. and unify the following > m1[k

Re: core.logic

2011-12-23 Thread Ambrose Bonnaire-Sergeant
I'm not sure if I fully understand the requirements, but here's my interpretation. https://gist.github.com/1516721 Hopefully you can clarify the intent if I'm off. Ambrose On Sat, Dec 24, 2011 at 3:39 PM, Sunil S Nandihalli < sunil.nandiha...@gmail.com> wrote: > Hi, > I would like to create a

core.logic

2011-12-23 Thread Sunil S Nandihalli
Hi, I would like to create a predicate which would accept two keys k1,k2 and two maps m1 m2 .. and unify the following m1[k1] = k2 and m2[k2] = k1 .. I have spent some time on it.. but been unable to figure out how to do this. I would like this to be as efficient as possible. I would appreciate an

Re: (:require [clojure.contrib.sql :as sql]))

2011-12-23 Thread Sean Corfield
The monolithic contrib (1.2.0) has been deprecated. Updated versions of many of the modules are available individually: http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go However, if you have the JAR on your classpath, that namespace should be available. It would help people help

(:require [clojure.contrib.sql :as sql]))

2011-12-23 Thread jayvandal
Where is this file to be found?? (:require [clojure.contrib.sql :as sql])) I see it listed in the jar but?? I have the clojure.contrib-11.2.0.jar located in my classpath c:\opt\jars, as well as the clojure.jar Am I the only one who has trouble with these files?? -- You received this message

Literate Programming

2011-12-23 Thread daly
Good Sir and Fellow Traveler, On Fri, 2011-12-23 at 03:33 -0800, Adam Getchell wrote: > Having received the benefit of your kind reply, I must confess to a > puzzlement which has vexed me ever since I read your missive. It is > this: how should I have read it so as to receive some knowledge or >

Re: [ANN] okasaki-clojure

2011-12-23 Thread David Nolen
On Fri, Dec 23, 2011 at 3:45 AM, JuanManuel Gimeno Illa wrote: > Hi all, > >- first I watched Daniel Spiewak's talk Extreme Cleverness: Functional >Data Structures in > Scala, >I got the idea of implementing some

Re: Clojurescript and google closure library versions?

2011-12-23 Thread Dave Sann
thx, I have done the same. If anyone uses pinot, I also created an updated goog.jar with the third party-libs. (so that dom/query works) you can fetch it here: https://github.com/davesann/clojurescript-goog-jar (I documented how here : https://groups.google.com/d/msg/clj-noir/x5x9vcI-T4E/hDFev

Should read-string support \x.. escaped characters?

2011-12-23 Thread Dave Sann
When sending data as strings from clojurescript to clojure there will be issues if the source data contains certain unicode characters. (I think in range 128-255 - extended latin characters mostly). This is because the goog string conversion used by pr-str encodes these characters as \x.. not \

Re: LurePet - Digital Art Project Written in Clojure - Beauty Contest For Virtual Life (shamelessly advertising)

2011-12-23 Thread Sergey Didenko
Yes, its http://lurepet.com > Do you have a link to the running project? -- 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

Re: LurePet - Digital Art Project Written in Clojure - Beauty Contest For Virtual Life (shamelessly advertising)

2011-12-23 Thread Joseph Jones
Do you have a link to the running project? On Dec 23, 2011, at 3:23 PM, Sergey Didenko wrote: > Hi, finally I can show you some quite complex project that I made in Clojure. > > The Idea: > > Every lurepet (big picture) that you see on the site has some "genes" > and is drawn according to them.

LurePet - Digital Art Project Written in Clojure - Beauty Contest For Virtual Life (shamelessly advertising)

2011-12-23 Thread Sergey Didenko
Hi, finally I can show you some quite complex project that I made in Clojure. The Idea: Every lurepet (big picture) that you see on the site has some "genes" and is drawn according to them. After the best lurepets are selected they can be bred to make children looking like their parents. This is

Re: SAT with core.logic

2011-12-23 Thread Peteris
Oops, I was not aware eval could evaluate macros, thanks for pointing that out. Indeed, I can just wrap: (defn sate! [vars expr] (eval `(sat ~vars ~expr))) Thanks for the link too, looks interesting. On Dec 24, 12:48 am, David Nolen wrote: > As your solver is based on rewriting I think you wi

Re: SAT with core.logic

2011-12-23 Thread David Nolen
As your solver is based on rewriting I think you will need to use eval to get the behavior you want. Another approach might be http://www.soi.city.ac.uk/~jacob/solver/. However that would require a couple of interesting changes to core.logic (which I'd be more than happy to include if someone impl

Re: SAT with core.logic

2011-12-23 Thread Peteris
I don't understand, the value of foo should be independent of the values of its arguments, right? To motivate the application better, I want to be able to do symbolic computing on the boolean expression prior to passing it into sat, so I don't know ahead of time the number of symbols in the expres

Re: SAT with core.logic

2011-12-23 Thread David Nolen
Do something like this not work for you? (defn foo [p q] (sat [p q] (and p q))) David On Fri, Dec 23, 2011 at 5:00 PM, Peteris wrote: > That's exactly what I wanted to do. Say, be able to write > > (sat '[p q] '(and p q)) > > and I tried working out a function that does this. I've seen examp

Re: SAT with core.logic

2011-12-23 Thread Peteris
That's exactly what I wanted to do. Say, be able to write (sat '[p q] '(and p q)) and I tried working out a function that does this. I've seen examples of functions on logic variables, but in this case how could we create fresh logic variables out of these symbols? That seems like something we wo

Re: SAT with core.logic

2011-12-23 Thread David Nolen
On Fri, Dec 23, 2011 at 4:10 PM, Peteris wrote: > Hi, > > I wrote a simple SAT solver macro on top of core.logic today (code at > http://peteriserins.com/2011/12/23/sat-in-clojure-core-logic.html). Is > it possible to write a similar SAT solver that would accept expression > arguments at runtime

Re: New home for ClojureCLR

2011-12-23 Thread Timothy Pratley
Nice! Good move :) Great to see the .NET support continuing and strengthening. On Tue, Dec 20, 2011 at 1:49 PM, dmiller wrote: > ClojureCLR has a new home! > > Code repo:  https://github.com/clojure/clojure-clr > JIRA: http://dev.clojure.org/jira/browse/CLJCLR > > Old binary distributions for v

SAT with core.logic

2011-12-23 Thread Peteris
Hi, I wrote a simple SAT solver macro on top of core.logic today (code at http://peteriserins.com/2011/12/23/sat-in-clojure-core-logic.html). Is it possible to write a similar SAT solver that would accept expression arguments at runtime (say, a SAT function, but not necessarily). Regards -- Peter

Re: Question ActionListener conditional

2011-12-23 Thread Aaron Cohen
On Fri, Dec 23, 2011 at 3:08 PM, Antonio Recio wrote: > When I click 2 times the button isoButton I get an error. > (.addActionListener isoButton >                     (proxy [ActionListener] [] >                       (actionPerformed [] Sorry, forgot the parameter here, add an "e". (actionPerfo

Re: Question ActionListener conditional

2011-12-23 Thread Antonio Recio
When I click 2 times the button isoButton I get an error. (.addActionListener isoButton (proxy [ActionListener] [] (actionPerformed [] (if (.isSelected isoButton) (println "Button is selected")

Re: Question ActionListener conditional

2011-12-23 Thread Aaron Cohen
On Fri, Dec 23, 2011 at 1:29 PM, Antonio Recio wrote: > I am trying to add and to remove an object "isoActor" when I click the > button "isoButton", but I get an error: > Exception in thread "main" java.lang.IllegalArgumentException: Don't know > how to create ISeq from: clojure.lang.Symbol > > Th

Question ActionListener conditional

2011-12-23 Thread Antonio Recio
I am trying to add and to remove an object "isoActor" when I click the button "isoButton", but I get an error: Exception in thread "main" java.lang.IllegalArgumentException: Don't know how to create ISeq from: clojure.lang.Symbol The code: (. isoButton addActionListener (proxy [ActionListen

Re: Matching core.match's syntactic keywords

2011-12-23 Thread David Nolen
Ah Steve got to it first. Thanks! On Friday, December 23, 2011, Steve Miner wrote: > > On Dec 22, 2011, at 10:54 PM, Herwig Hochleitner wrote: > > I want to match vectors of the form [(some expr) :as :label], but #(match [%] [[expr :as (label :when keyword)]] {:expr expr :label label}) throws a

Re: Matching core.match's syntactic keywords

2011-12-23 Thread David Nolen
Been a bit busy will look into this and respond later today. On Thursday, December 22, 2011, Herwig Hochleitner wrote: > Hi, > I want to match vectors of the form [(some expr) :as :label], but #(match [%] [[expr :as (label :when keyword)]] {:expr expr :label label}) throws a compiler exception:

Re: Matching core.match's syntactic keywords

2011-12-23 Thread Steve Miner
On Dec 22, 2011, at 10:54 PM, Herwig Hochleitner wrote: > I want to match vectors of the form [(some expr) :as :label], but #(match > [%] [[expr :as (label :when keyword)]] {:expr expr :label label}) throws a > compiler exception: Unable to resolve symbol expr > If you want to match a liter

Re: Literate programming

2011-12-23 Thread Adam Getchell
On Thu, Dec 22, 2011 at 11:54 AM, daly wrote: > On Tue, 2011-12-20 at 00:26 -0800, Adam Getchell wrote: > > BTW I looked at marginalia+leiningen, which seems to work for my > > purposes except I'm unclear where to put the .tex files. > > I'm not sure what this sentence means. The .tex files ARE t

Re: Literate programming

2011-12-23 Thread daly
>I'll do everything I can to help. I have tons of thoughts (as you >might guess); but I haven't demonstrated myself to be a great coder, >yet. I feel like I'm a coder who needs something like literate >programming to be great, so it's kind of a chicken-and-egg problem. >I'm already partway there

Re: Literate programming

2011-12-23 Thread daly
On Thu, 2011-12-22 at 20:19 -0800, nchurch wrote: > I'll do everything I can to help. I have tons of thoughts (as you > might guess); but I haven't demonstrated myself to be a great coder, > yet. I feel like I'm a coder who needs something like literate > programming to be great, so it's kind of

Re: Matching core.match's syntactic keywords

2011-12-23 Thread Tassilo Horn
Herwig Hochleitner writes: Hi Herwig, > I want to match vectors of the form [(some expr) :as :label], but #(match > [%] [[expr :as (label :when keyword)]] {:expr expr :label label}) throws a > compiler exception: Unable to resolve symbol expr Isn't the order value/key in map pattern? {expr