Logos - core.logic

2011-04-28 Thread David Nolen
Logos has been accepted into Clojure contrib: https://github.com/clojure/core.logic. There's a considerable amount of work still to do but I'm excited to see how the Clojure community might take advantage of a logic programming library. Two things I'd like to see: 1) Make it faster (it's pretty

Re: Logos - core.logic

2011-04-28 Thread David Nolen
On Thu, Apr 28, 2011 at 3:05 PM, Nick Zbinden nick...@gmail.com wrote: Hallo David, Very cool that this is moving to contrib. I saw that you gave a presentation at NYC Clojure User Groupe. Was that tapped? If not I think it would be very cool if you could do a screencast with simular

Re: Closures in macros

2011-05-02 Thread David Nolen
On Mon, May 2, 2011 at 4:49 PM, André Thieme splendidl...@googlemail.comwrote: Maybe there are good reasons why closures should not be real first class objects, as it is the case in other programming languages that support them. If that is the case I would really like to hear it. I am not

Re: Closures in macros

2011-05-02 Thread David Nolen
On Mon, May 2, 2011 at 4:49 PM, André Thieme splendidl...@googlemail.comwrote: I am not interested in the answers of religious fanatics who defend any behaviour that the current implementation has, even if it obviously limits the expressiveness. Regards, André The relevant clojure-dev

Re: Any wisdom in the math speed of different clojure libraries?

2011-05-03 Thread David Nolen
Why not? user (time (dotimes [_ 10] (Math/ceil 0.1))) Elapsed time: 626.867 msecs David On Tue, May 3, 2011 at 3:38 AM, bOR_ boris.sch...@gmail.com wrote: user (time (dotimes [i 10] (contribmath-ceil (rand Elapsed time: 4500.530303 msecs nil user (time (dotimes [i

Re: Any wisdom in the math speed of different clojure libraries?

2011-05-03 Thread David Nolen
On Tue, May 3, 2011 at 9:50 AM, bOR_ boris.sch...@gmail.com wrote: Because I did not remember Math/ceil :-). Point is, is there any consensus on what math library to use? Is (Math/... in general the fastest? For basic math, I'm not sure what could be faster than Java primitive operators and

Re: Any wisdom in the math speed of different clojure libraries?

2011-05-03 Thread David Nolen
On Tue, May 3, 2011 at 2:51 PM, Ken Wesson kwess...@gmail.com wrote: It's optimizing your loop away, or else you're using ridiculously powerful hardware. user= (time (dotimes [_ 100] (Math/ceil (rand Elapsed time: 142.86748 msecs nil Maybe, maybe not: (do (set! *unchecked-math*

Re: Logos - core.logic

2011-05-04 Thread David Nolen
On Wed, May 4, 2011 at 10:37 AM, Frantisek Sodomka fsodo...@gmail.comwrote: Hello David, thanks for your work. It is very interesting addition. One thing that came to my mind, is a language Mercury: http://en.wikipedia.org/wiki/Mercury_(programming_language)

Re: Logos - core.logic

2011-05-04 Thread David Nolen
On Wed, May 4, 2011 at 11:11 AM, David Nolen dnolen.li...@gmail.com wrote: On Wed, May 4, 2011 at 10:37 AM, Frantisek Sodomka fsodo...@gmail.comwrote: Mercury is an amazing project. In fact the original miniKanren (on which core.logic is based) designers were well aware of it and even based

Re: Closures in macros

2011-05-04 Thread David Nolen
On Wed, May 4, 2011 at 6:31 PM, André Thieme splendidl...@googlemail.comwrote: You need to wrap it into eval-when or separate functions and macros from their use into different files and make sure the right load order is used. Then this will work in CL. Which are probably some of the reasons

Re: ANN: Jark 0.3 (using the nrepl protocol)

2011-05-07 Thread David Nolen
On Sat, May 7, 2011 at 12:50 PM, isaac praveen icylis...@gmail.com wrote: Sure. We need very powerful clojure development and deployment tools. My request for subscription to clojure-dev got declined :( Send in a CA! :) David -- You received this message because you are subscribed to the

How Clojure protocols are implemented internally?

2011-05-08 Thread David Nolen
On Sat, May 7, 2011 at 5:28 PM, Dmitry Kakurin dmitry.kaku...@gmail.com wrote: Let me rephrase my question to avoid unfortunate confusion with standard count function: Suppose I have extended my own IMyCountable protocol with a single mycount method to String class. What happens when I call

Re: How Clojure protocols are implemented internally?

2011-05-08 Thread David Nolen
On Sun, May 8, 2011 at 4:43 PM, Dmitry Kakurin dmitry.kaku...@gmail.comwrote: Very well, something along these lines would be my guess too. But that would mean that in case 2 protocols are no faster than multimethods. Not true. And I've got an impression that protocols are described to be

Re: can this program be sped up?

2011-05-10 Thread David Nolen
On Tue, May 10, 2011 at 2:21 PM, Carl Cotner carl.cot...@gmail.com wrote: Hi, Is it possible to make Clojure run the following toy program faster (without changing the algorithm)? (defn primeQ [n] (primes 2 (/ n 2) n)) (defn divQ [d n] (= (mod n d) 0)) (defn primes [d2 t2 n2] (loop [d

Re: Type hinting inconsistencies in 1.3.0

2011-05-11 Thread David Nolen
On Wed, May 11, 2011 at 11:09 AM, Chas Emerick cemer...@snowtide.comwrote: (defn foo ^String ([] bar) ^double ([a] 5.6) ([a b] :not-hinted-at-all)) Given the current implementation I really don't see how this could work. Keeping the old fn type-hint in a separate place from the new

Re: Type hinting inconsistencies in 1.3.0

2011-05-11 Thread David Nolen
On Wed, May 11, 2011 at 3:10 PM, Armando Blancas armando_blan...@yahoo.comwrote: I can see the inconsistency but for multiple arity/body functions that's not a bad place to put it. My suggestion would be to extend (declare) à la maclisp and keep the actual fn clean of hints (at least the

Re: Type hinting inconsistencies in 1.3.0

2011-05-11 Thread David Nolen
On Wed, May 11, 2011 at 7:43 PM, Chas Emerick cemer...@snowtide.com wrote: (defn ^String foo []) (defn foo ^long []) The real problem is that first case was never actually specifying a return type - it is a type hint on the var that happened to store an fn. The fn itself can only return

Re: Type hinting inconsistencies in 1.3.0

2011-05-11 Thread David Nolen
On Wed, May 11, 2011 at 11:58 PM, Ken Wesson kwess...@gmail.com wrote: On Wed, May 11, 2011 at 9:04 PM, David Nolen dnolen.li...@gmail.com wrote: On Wed, May 11, 2011 at 7:43 PM, Chas Emerick cemer...@snowtide.com wrote: (defn ^String foo []) (defn foo ^long []) The real problem

Collaboration Proposal: Beyond CLOS Generic Methods, Predicate Dispatch, and Pattern Matching

2011-05-12 Thread David Nolen
Hello fellow Clojurians, As some of you may know I've been doing a bit of research into efficient predicate dispatch, generic methods, and state-of-the-art implementations of pattern-matching in OCaml. After a bit of reading and prototyping, I'm quite confident that it's possible to build

Re: Collaboration Proposal: Beyond CLOS Generic Methods, Predicate Dispatch, and Pattern Matching

2011-05-12 Thread David Nolen
having some basic grounding in the ideas covered in the mentioned papers. David On Thu, May 12, 2011 at 6:03 PM, David Nolen dnolen.li...@gmail.com wrote: Hello fellow Clojurians, As some of you may know I've been doing a bit of research into efficient predicate dispatch, generic methods

Re: Collaboration Proposal: Beyond CLOS Generic Methods, Predicate Dispatch, and Pattern Matching

2011-05-12 Thread David Nolen
On Thu, May 12, 2011 at 7:30 PM, Jonathan Fischer Friberg odysso...@gmail.com wrote: I'd like to help, if I can. Jonathan I'm sure you can :) Give those papers a looksee and let me know what you think. David -- You received this message because you are subscribed to the Google Groups

Re: Collaboration Proposal: Beyond CLOS Generic Methods, Predicate Dispatch, and Pattern Matching

2011-05-12 Thread David Nolen
On Thu, May 12, 2011 at 10:26 PM, Brent Millare brent.mill...@gmail.comwrote: Hey, Can you give a simple explanation how your methods would be faster than multimethods. Does this mean your implementation uses protocols underneath? How does multimethods work? How many branches? -Brent

Re: Collaboration Proposal: Beyond CLOS Generic Methods, Predicate Dispatch, and Pattern Matching

2011-05-13 Thread David Nolen
On Fri, May 13, 2011 at 4:18 AM, Antony Blakey antony.bla...@gmail.comwrote: On 13/05/2011, at 2:21 PM, David Nolen wrote: - instance? or custom predicate matches done w/ if I did quite a bit of this in the context of a Smalltalk implementation. One of the key features is fast type

Re: Collaboration Proposal: Beyond CLOS Generic Methods, Predicate Dispatch, and Pattern Matching

2011-05-13 Thread David Nolen
On Fri, May 13, 2011 at 2:04 AM, Heinz N. Gies he...@licenser.net wrote: Hearing Pattern Matching, do you mean Erlang like Pattern matching? Regards, Heinz Erlang, OCaml, SML, Haskell, Scala all have the kind of pattern matching I'm talking about. One important point is that they all

Re: extend-type at runtime?

2011-05-13 Thread David Nolen
On Fri, May 13, 2011 at 12:04 PM, Base basselh...@gmail.com wrote: It is possible to extend types at runtime to add new behavior dynamically? Yes, an example here, http://dosync.posterous.com/51626638 David -- You received this message because you are subscribed to the Google Groups

Re: Collaboration Proposal: Beyond CLOS Generic Methods, Predicate Dispatch, and Pattern Matching

2011-05-13 Thread David Nolen
On Fri, May 13, 2011 at 3:36 PM, Brent Millare brent.mill...@gmail.comwrote: However, you state here that you will build something more powerful than predicate dispatch. From the references you cited, I don't understand how you propose to accomplish this. The first paper says predicate

Re: Unchecked floating point division

2011-05-18 Thread David Nolen
On Tue, May 17, 2011 at 7:56 AM, Ken Wesson kwess...@gmail.com wrote: How does one perform an unchecked floating point division? (/ 1.0 0.0) throws an exception -- what goes in place of _ to make (_ 1.0 0.0) produce Double/POSITIVE_INFINITY? (And run faster than something that does checking

Re: extending types

2011-05-18 Thread David Nolen
On Tue, May 17, 2011 at 5:52 PM, jlk lachlan.kana...@gmail.com wrote: (proxy2 [String] AProtocol? (theseBehaveAsStringsWithThisAdded [] ...) leaving regular Strings unaffected? The problem is that Java is inherently and early-bound design. It's difficult to do efficient composition a la

Re: Clojure stack

2011-05-19 Thread David Nolen
On Thu, May 19, 2011 at 6:00 PM, László Török ltoro...@gmail.com wrote: Scala gets parallel collections (i.e. leverage multi-core CPUs) http://www.infoq.com/news/2011/05/scala-29;jsessionid=BCF6B009442F5F0D9C18A06D3790C3DA just to give this thread a new spark...:) Clojure used to have

Re: Clojure stack

2011-05-20 Thread David Nolen
On Fri, May 20, 2011 at 9:43 AM, Lee Spector lspec...@hampshire.edu wrote: I agree that there's a sweet spot for newcomers here, where one uses a simple REPL (possibly invoked with lein) and an editor that's not tightly coupled, which should make it easier to provide a unified and idiot-proof

Re: clojure.lang.PersistentVector cannot be cast to java.lang.String

2011-05-20 Thread David Nolen
On Fri, May 20, 2011 at 9:22 AM, Vincent Liard vincent.li...@free.frwrote: (defn retailer-stock-update [] (wrap-multipart-params (fn [req] (let [xls (get (:params req) stock-xls)] (with-in-str [str (:bytes xls)] (read-xls-stream str)) You usage of with-in-str is

Re: Clojure stack

2011-05-20 Thread David Nolen
On Fri, May 20, 2011 at 10:01 AM, Lee Spector lspec...@hampshire.eduwrote: On May 20, 2011, at 9:48 AM, David Nolen wrote: The JEdit mode for Clojure has auto-indenting and bracket matching and it works just fine for me. If you weren't able to get that to work did you try contacting

Re: Clojure 1.3 Alpha 7

2011-05-20 Thread David Nolen
On Fri, May 20, 2011 at 1:55 PM, Fogus mefo...@gmail.com wrote: In the alpha7 release the defrecord macro was changed to generate a couple of auxiliary functions (for a record R) named map-R and -R. The first takes a map and returns a function of its contents. The second takes the same

Re: Clojure stack

2011-05-20 Thread David Nolen
On Fri, May 20, 2011 at 3:04 PM, Lee Spector lspec...@hampshire.edu wrote: To clarify, David, when you say it just worked you mean that when you select Edit Indent Indent lines then the line containing the insertion point is moved (left or right, as appropriate) to conform to standard Lisp

Re: why can't string functions be part of standard clojure lib?

2011-05-21 Thread David Nolen
On Sat, May 21, 2011 at 11:46 AM, larry larrye2...@gmail.com wrote: Let's say you're a new user and you want to split a string on a delimiter in clojure. Okay, I google string split in clojure. I find this at http://clojure.github.com/clojure/clojure.string-api.html (ns

Re: why can't string functions be part of standard clojure lib?

2011-05-21 Thread David Nolen
On Sat, May 21, 2011 at 11:56 AM, David Nolen dnolen.li...@gmail.comwrote: On Sat, May 21, 2011 at 11:46 AM, larry larrye2...@gmail.com wrote: Let's say you're a new user and you want to split a string on a delimiter in clojure. Okay, I google string split in clojure. I find

Re: Functional Blackjack in Clojure

2011-05-23 Thread David Nolen
On Mon, May 23, 2011 at 5:02 PM, Sam Ritchie sritchi...@gmail.com wrote: Hey all, As an exercise in Clojure, I recently went about implementing a functional version of BlackJack, and wanted to post it here for everyone's perusal. The goal here was to write idiomatic code with good testing

Re: Clojure 1.3 Alpha 7

2011-05-24 Thread David Nolen
On Tue, May 24, 2011 at 7:54 PM, Ken Wesson kwess...@gmail.com wrote: IMO, records should support anything maps support -- in particular, they should support near-arbitrary numbers of entries. If performance is not a concern I don't see the point of not justing plain maps + multimethods. None

core.logic now compatible with Clojure 1.2.X

2011-05-24 Thread David Nolen
I know not everyone is adventurous enough to use the 1.3.0 alphas just to try out core.logic. I've made the required changes to make it 1.2.0 compatible. Have fun, David -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email

Re: core.logic now compatible with Clojure 1.2.X

2011-05-25 Thread David Nolen
On Wed, May 25, 2011 at 1:36 AM, Sunil Nandihalli sunil.nandiha...@gmail.com wrote: Thats really nice to hear.. but is the version on clojars compatible with 1.2 yet? Thanks Sunil. I actually spoke a tiny bit too soon. There's one bug related to the numerics change between 1.2 and 1.3.

Re: core.logic now compatible with Clojure 1.2.X

2011-05-25 Thread David Nolen
On Wed, May 25, 2011 at 1:36 AM, Sunil Nandihalli sunil.nandiha...@gmail.com wrote: Thats really nice to hear.. but is the version on clojars compatible with 1.2 yet? Thanks Sunil. I fixed the 1.2 vs 1.3 numerics issue with the help of the Clojure/core team. The version on Github as well

Re: Recur and primitives?!?

2011-05-27 Thread David Nolen
On Thu, May 26, 2011 at 7:54 PM, Andreas Kostler andreas.koestler.le...@gmail.com wrote: Hi guys, I'm kinda lost as to what's going on here...With clojure-1.2.0 (defn bin-search [v k c] (loop [l 0 h (dec (count v))] (if ( l h) false (let [m (quot (+ l h) 2)

Simple Type Inferencer For The Simply Typed Lambda Calculus

2011-05-28 Thread David Nolen
Apologies if you've already seen this, but I thought perhaps some people here might find this interesting. I ported a simple type inferencer for the simply typed lambda calculus from Prolog to Clojure. It's interesting because it shows how to port Prolog's impure facilities (==, !, var) to

Re: aset and shorts, aset vs aset-int

2011-05-29 Thread David Nolen
On Sun, May 29, 2011 at 9:17 AM, bOR_ boris.sch...@gmail.com wrote: Is there something obvious I am missing when aset in clojure 1.3-alpha8 won't work for shorts. aset-shorts does work, but way slower than I'd expect. There is also an order of magnitude difference in speed between aset ^ints

Re: aset and shorts, aset vs aset-int

2011-05-29 Thread David Nolen
On Sun, May 29, 2011 at 4:35 PM, bOR_ boris.sch...@gmail.com wrote: Thanks for the help, appreciated! It helped me figuring out where exactly things go haywire. This works: user (let [^ints as (make-array Integer/TYPE 10)] (aset as 0 (+ (aget as 1) (aget as 2 0 and this breaks

Re: Translating minikanren to core.logic

2011-05-31 Thread David Nolen
On Tue, May 31, 2011 at 1:02 PM, Ambrose Bonnaire-Sergeant abonnaireserge...@gmail.com wrote: user= (run 2 [q] (exist [x y z] (conde ((== (x y z x) q)) ((== (z y x z) q) You have to take note of the formatting

Re: Translating minikanren to core.logic

2011-05-31 Thread David Nolen
On Tue, May 31, 2011 at 1:10 PM, Ambrose Bonnaire-Sergeant abonnaireserge...@gmail.com wrote: From the paper: We use conde to get several values--syntactically, conde looks like cond but without = or else. What does it mean by get several values? Thanks, Ambrose Using conde means

Re: summing shorts vs summing ints

2011-06-04 Thread David Nolen
On Sat, Jun 4, 2011 at 6:32 AM, bOR_ boris.sch...@gmail.com wrote: (defn plusS ^shorts [^shorts array ^shorts arr2] adds two Short arrays (amap array idx ret (short (+ (aget array idx) (aget arr2 idx) (defn plusI ^ints [^ints array ^ints arr2] adds two Int arrays.

Re: transients are not designed to be bashed in-place

2011-06-10 Thread David Nolen
On Fri, Jun 10, 2011 at 11:16 AM, alsor alsor@gmail.com wrote: ... but what if this is exactly what I need? I'm working with Lucene and I have my custom Collector. This collector accept fn as a constructor argument and then for each matched document it gathers needed information from the

Prolog-style Definite Clause Grammar Support in core.logic

2011-06-13 Thread David Nolen
Just added DCG support to core.logic: https://gist.github.com/1024087. This opens up porting a lot of the existing Prolog literature on parsing. It's not totally polished but what's there is a lot of fun to play around with and I'd love to hear any feedback. Note that core.logic already has

Re: Svar: transients are not designed to be bashed in-place

2011-06-14 Thread David Nolen
On Tue, Jun 14, 2011 at 1:56 AM, alsor alsor@gmail.com wrote: Just out of curiosity, are these some implementation's peculiarities or it's intentional design? Intentional design. David -- You received this message because you are subscribed to the Google Groups Clojure group. To post

Re: Allow Data Structure to Be Called as Function

2011-06-18 Thread David Nolen
On Sat, Jun 18, 2011 at 4:44 AM, Sam Aaron samaa...@gmail.com wrote: Is it possible to use this approach to create a callable record which can take a variable number of arguments? I can't get the following to work: (defrecord Foo [a] clojure.lang.IFn (invoke [this args] (println (str a

Re: Detailed Macro Quoting Question

2011-06-18 Thread David Nolen
On Fri, Jun 17, 2011 at 11:51 PM, Jian Liu liuj...@gmail.com wrote: Hi Clojure Gurus :) I've a somewhat contrived use-case for macros that I've been struggling with. Let's say there's an interface called EWrapper that I'm trying to implement with methods tickPrice and tickSize, a concrete

Re: eval and load-string behavior

2011-06-20 Thread David Nolen
On Mon, Jun 20, 2011 at 7:45 PM, Jonathan Fischer Friberg odysso...@gmail.com wrote: I got a very nasty bug from this behavior today user= (def a (fn [] outside a)) #'user/a user= (let [a (fn [] inside a)] (load-string (a))) outside a user= (let [a (fn [] inside a)] (eval '(a))) outside

Re: eval and load-string behavior

2011-06-21 Thread David Nolen
-string (let [a (fn [] inside fn)] (a))) But I still think it's odd behavior. I've always thought of eval as equal to putting that code there. (eval '(a)) is equal to (a) Which I think would be much more intuitive. Jonathan On Tue, Jun 21, 2011 at 2:49 AM, David Nolen dnolen.li...@gmail.com

Re: ClojureScript, Chrome Extension and BrowserREPL

2012-07-17 Thread David Nolen
On Tue, Jul 17, 2012 at 11:22 AM, Hubert Iwaniuk neo...@kungfoo.pl wrote: Hello Everyone, Did anyone managed to get BrowserREPL running within Chrome Extension? I'm having hard time getting it up. Basically what happens for me is CrossPageChannel communication initialization failure both

Re: ClojureScript, Chrome Extension and BrowserREPL

2012-07-17 Thread David Nolen
On Tue, Jul 17, 2012 at 3:00 PM, Hubert Iwaniuk neo...@kungfoo.pl wrote: Hi David, Do you know rationale for using CrossPageChannel? If that could be removed it would simplify BrowserREPL a lot, and would already unlock Chrome Extension. Cheers, Hubert. Because it works on nearly all

Re: Can you make Amotoen faster?

2012-07-19 Thread David Nolen
On Wed, Jul 18, 2012 at 10:12 PM, Richard Lyman richard.ly...@gmail.com wrote: All, There's not much code, and (sadly) not much documentation, but what's there needs some performance love. https://github.com/richard-lyman/amotoen Notes: - jvisualvm doesn't like me this week so help there

Re: Little becnhmark (need insight)

2012-07-23 Thread David Nolen
On Mon, Jul 23, 2012 at 2:58 PM, Alexander Semenov bohtva...@gmail.com wrote: (do (time (doall (to-list tree))) :done) Elapsed time: 19716.222 msecs Why is this so? Both results are kind of disappointing for me cause Scala gives me ~270ms time using functional code and 5x faster using the

Re: Little becnhmark (need insight)

2012-07-23 Thread David Nolen
On Mon, Jul 23, 2012 at 4:30 PM, Alexander Semenov bohtva...@gmail.com wrote: Yes, but these are implementation details - API is still functional and side-effects free. So your benchmark is just timing implementation details. I'm sure you can get get identical numbers to Scala / Haskell if you

Re: Little becnhmark (need insight)

2012-07-23 Thread David Nolen
On Mon, Jul 23, 2012 at 4:52 PM, Alexander Semenov bohtva...@gmail.com wrote: To some degree. Neither Clojure nor Haskell won't beat direct mutable code in Scala which results in 65ms on a machine 2x slower than my current. Direct mutable code can be written with little difficulty in Clojure.

Re: Little becnhmark (need insight)

2012-07-23 Thread David Nolen
(deftype Tree [n l r] clojure.lang.Indexed (nth [this idx] (nth this idx nil)) (nth [_ idx not-found] (case idx 0 n 1 l 2 r not-found))) (defn generate-tree [[h t :as coll]] (when (seq coll) (let [lr (generate-tree t)] (Tree. h lr lr (defn to-list

Re: Little becnhmark (need insight)

2012-07-23 Thread David Nolen
have not changed. On Mon, Jul 23, 2012 at 5:07 PM, David Nolen dnolen.li...@gmail.com wrote: (deftype Tree [n l r] clojure.lang.Indexed (nth [this idx] (nth this idx nil)) (nth [_ idx not-found] (case idx 0 n 1 l 2 r not-found))) (defn generate-tree

Re: core.match invert match

2012-07-23 Thread David Nolen
On Mon, Jul 23, 2012 at 6:42 PM, Simone Mosciatti mweb@gmail.com wrote: Hi everybody, I was looking if it is possible to invert the match macro, an example worth more than 1000 words. (def x (match [a b] [true true] 0.5 [false true] 0.6 [true false] 0.4 [false false] 0.8))

Re: core.match invert match

2012-07-24 Thread David Nolen
On Tue, Jul 24, 2012 at 6:03 AM, Simone Mosciatti mweb@gmail.com wrote: Thanks, it was what i thought... Any other suggestion is still welcome :-) I don't really understand your example. Can you clarify? -- You received this message because you are subscribed to the Google Groups Clojure

core.logic w/ cKanren extensions preview

2012-07-24 Thread David Nolen
Tom Hickey recorded my NYC Clojure presentation on cKanren extensions to core.logic - http://vimeo.com/46163091 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

Re: Pathfinding via core.logic

2012-07-24 Thread David Nolen
On Tue, Jul 24, 2012 at 2:21 PM, Timothy Baldridge tbaldri...@gmail.com wrote: All of these returned a 3 element set, but I'd like this to work with arbitrary length paths. Any suggestions where to start reading up on this? Is reading the reasoned schemer required for understanding how to use

Re: reactive programming for UIs and other use cases

2012-07-26 Thread David Nolen
On Wed, Jul 25, 2012 at 5:23 AM, eric e...@mailup.net wrote: Now, reactive programming isn't necessarily central to the development of Clojure core or contrib so readers here might be interested, too. Posting in Clojure Dev is handled rather restrictively so if you can't post there, why not

Re: reactive programming for UIs and other use cases

2012-07-26 Thread David Nolen
On Thu, Jul 26, 2012 at 11:51 AM, Yann Schwartz abolibibe...@gmail.com wrote: I'm in no way a clojurescript specialist, but how hard would it be to wire RxJs (the javascript version of the impressive Reactive Extensions framework) to clojurescript? Using it probably wouldn't be much work. It's

Re: Translating from Prolog to core.logic

2012-07-28 Thread David Nolen
On Sat, Jul 28, 2012 at 8:53 PM, JvJ kfjwhee...@gmail.com wrote: I'm having trouble translating some Prolog code to core.logic. In particular, I'd like to do something like this: 2 ?- assert(a(b)). true. 3 ?- assert(a(a(b))). true. 4 ?- a(X). X = b ; X = a(b). 5 ?- a(a(X)). X = b.

Re: Testing ClojureScript

2012-07-30 Thread David Nolen
Looks like Node.js is being aliased as SpiderMonkey. That won't work. I suggest installing V8 from source. I'll update the ClojureScript Github wiki with instructions for testing latest JavaScriptCore and SpiderMonkey. David On Monday, July 30, 2012, Timothy Baldridge wrote: I'm trying to run

A succinct reasonably fast sudoku solver in core.logic

2012-07-31 Thread David Nolen
Ever since I read Norvig's cool Python solution, http://norvig.com/sudoku.html, I've been wanting to see if this could be done in core.logic without sacrificing generality. Now that we have cKanren extensions in master I gave it a shot (thanks to Martin Trojer) and I'm happy with the results.

Re: A succinct reasonably fast sudoku solver in core.logic

2012-07-31 Thread David Nolen
A much shorter version using an everyo goal I just landed in master: http://gist.github.com/3217582 David On Tue, Jul 31, 2012 at 11:36 AM, gaz jones gareth.e.jo...@gmail.comwrote: Wow, that's pretty nice. On Tue, Jul 31, 2012 at 8:07 AM, David Nolen dnolen.li...@gmail.com wrote: Ever

core.logic 0.8-alpha1 is out

2012-08-02 Thread David Nolen
The list of changes is simply too long :) Please give it a shot. I'd like to make sure that it doesn't create problems for existing core.logic usage. Documentation on the new functionality forthcoming! David -- You received this message because you are subscribed to the Google Groups Clojure

Re: Any chance for Ratio and BigInt support in ClojureScript?

2012-08-05 Thread David Nolen
On Sun, Aug 5, 2012 at 12:45 AM, Olaf Delgado-Friedrichs olaf.delg...@googlemail.com wrote: Hi, I am currently learning Clojure/ClojureScript and enjoying it a lot. Since I have a bit of code I am planning to port that requires precise rational arithmetic, I am particular delighted by the

Re: why would this fail in core.logic?

2012-08-06 Thread David Nolen
You have to be careful when using Clojure or Java operations in core.logic programs. I would recommend avoiding it until you're comfortable with writing pure core.logic programs. On Monday, August 6, 2012, Jim - FooBar(); wrote: caution! logic noob question following...why does the following

Re: why would this fail in core.logic?

2012-08-07 Thread David Nolen
On Tue, Aug 7, 2012 at 6:46 AM, Jim - FooBar(); jimpil1...@gmail.comwrote: (defn bishop-moves [x y] (let [xmax 8 ymax 8] (run* [q] (fresh [a b] ( a xmax) ( b ymax) (= (- x a) (- y b)) (== q [a b]) (= (- x a) (- y b)) Is not

Re: why would this fail in core.logic?

2012-08-07 Thread David Nolen
On Tue, Aug 7, 2012 at 10:09 AM, Jim - FooBar(); jimpil1...@gmail.com wrote: I've got the moving rules for all chess-pieces working... :-) David, would you like me to put them somewhere as examples to core.logic? I remember you saying that you'd love some translations from prolog to

Re: School Seating Charts

2012-08-07 Thread David Nolen
On Tue, Aug 7, 2012 at 12:24 AM, Evan Mezeske emeze...@gmail.com wrote: Anyway, I've rambled on far too much already. I just thought people might want to hear about a Clojure success story. Technical success, that is... Whether it's a commercial success remains to be seen. :) -Evan An

Re: ClojureScript protocols

2012-08-07 Thread David Nolen
On Tue, Aug 7, 2012 at 3:03 PM, Alexander Solovyov alexan...@solovyov.net wrote: On Mon, Aug 6, 2012 at 10:44 AM, Alexander Solovyov alexan...@solovyov.net wrote: I have a simple protocol Map here: https://github.com/piranha/cj-locations/blob/master/src/map.cljs And an implementation of it

Re: ClojureScript protocols

2012-08-08 Thread David Nolen
On Wed, Aug 8, 2012 at 3:52 AM, Alexander Solovyov alexan...@solovyov.net wrote: On Wed, Aug 8, 2012 at 4:47 AM, David Nolen dnolen.li...@gmail.com wrote: Ok, I figured out (well, not I, but m0smith from #clojure): protocols should be imported using :require :as, rather than :use :only

Re: Any chance for Ratio and BigInt support in ClojureScript?

2012-08-11 Thread David Nolen
On Sun, Aug 5, 2012 at 10:43 PM, Olaf Delgado-Friedrichs olaf.delg...@googlemail.com wrote: Thanks for the link! I didn't know that the Closure library contained an arbitrary precision type, but should have expected it. When you speak of performance, do you mean the extra cost of checking

Re: core.logic: (run* [q] (membero :x #{:x})) - ()

2012-08-11 Thread David Nolen
On Sat, Aug 11, 2012 at 2:14 PM, Moritz Ulrich mor...@tarn-vedra.de wrote: Hi, fellow logic programmers! Shouldn't `membero' work with sets? I notice that (run* [q] (membero :x #{:x})) returns no results while (run* [q] (membero :x (seq #{:x}))) returns the (in my opinion)

Re: clojure.logic project.clj file

2012-08-13 Thread David Nolen
On Mon, Aug 13, 2012 at 4:38 PM, Brent Millare brent.mill...@gmail.com wrote: I think the :source-path line in project.clj should be :source-paths [src/main/clojure]. Is :source-path still looked up in leiningen2? Is there something specific you are trying to do? David -- You received this

Re: clojure.logic project.clj file

2012-08-14 Thread David Nolen
On Tue, Aug 14, 2012 at 10:09 PM, Brent Millare brent.mill...@gmail.com wrote: Well just using leiningen2 and then lein repl, and then user= (require 'clojure.core.logic) FileNotFoundException Could not locate clojure/core/logic__init.class or clojure/core/logic.clj on classpath:

Re: clojure.logic project.clj file

2012-08-14 Thread David Nolen
On Tue, Aug 14, 2012 at 10:31 PM, Brent Millare brent.mill...@gmail.com wrote: Well just looking at the source, :source-path is never looked up, only :source-paths. All project.clj files that are prepped for leiningen2 use :source-paths to my knowledge. Should core.logic support specific

Re: not-nilo in core.logic?

2012-08-15 Thread David Nolen
On Wed, Aug 15, 2012 at 9:02 AM, Jim - FooBar(); jimpil1...@gmail.com wrote: Hi everyone, I was thinking about how to invert the 'nilo' relation found in core.logic: (defn nilo A relation where a is nil [a] (== nil a)) there is a != operator but it is in the arithmetic namespace

Re: clojure.logic project.clj file

2012-08-15 Thread David Nolen
On Wed, Aug 15, 2012 at 9:32 AM, Marshall T. Vandegrift llas...@gmail.com wrote: David Nolen dnolen.li...@gmail.com writes: Should core.logic support specific versions of Lein? Ideally Lein 2 would support Lein 1.X files. My understanding is that the reason the new version is lein 2.0

Re: not-nilo in core.logic?

2012-08-15 Thread David Nolen
On Wed, Aug 15, 2012 at 9:53 AM, Jim - FooBar(); jimpil1...@gmail.com wrote: OK thanks a lot both of youit turns out the != works just fine! at the moment I've almost completed the entire moving rules for chess and checkers (including kills) but only on an empty board...the only thing

Re: Any chance for Ratio and BigInt support in ClojureScript?

2012-08-15 Thread David Nolen
PM UTC-5, David Nolen wrote: On Sun, Aug 5, 2012 at 10:43 PM, Olaf Delgado-Friedrichs olaf.d...@googlemail.com wrote: Thanks for the link! I didn't know that the Closure library contained an arbitrary precision type, but should have expected it. When you speak of performance, do you mean

Re: Any chance for Ratio and BigInt support in ClojureScript?

2012-08-15 Thread David Nolen
On Tuesday, August 14, 2012, dspiteself wrote: I have extensive google closure experience, but little low level clojurescript experience. Could we use the clojure library's Integer or long type. It will likely not be as fast but when you need it you need it.

Re: [ANN] Ekeko: querying Java projects using core.logic

2012-08-15 Thread David Nolen
On Tue, Aug 14, 2012 at 8:35 PM, Coen De Roover cdero...@vub.ac.be wrote: Dear all, I'm pleased to announce the first release of Ekeko, an Eclipse plugin for querying Java projects using core.logic: https://github.com/cderoove/damp.ekeko Screencast: http://youtu.be/5wvVFQa1hVU Ekeko is

Re: [ANN] Ekeko: querying Java projects using core.logic

2012-08-15 Thread David Nolen
On Tue, Aug 14, 2012 at 8:35 PM, Coen De Roover cdero...@vub.ac.be wrote: Dear all, I'm pleased to announce the first release of Ekeko, an Eclipse plugin for querying Java projects using core.logic: https://github.com/cderoove/damp.ekeko Screencast: http://youtu.be/5wvVFQa1hVU Ekeko is

Re: clojure.logic project.clj file

2012-08-15 Thread David Nolen
On Wed, Aug 15, 2012 at 6:00 PM, Sean Corfield seancorfi...@gmail.com wrote: I know David said he only uses it for interactive development but I think it will cause confusion for others. Perhaps the best solution would be to move it aside, delete it from Git, move it back and add it to

Re: Any chance for Ratio and BigInt support in ClojureScript?

2012-08-15 Thread David Nolen
On Wed, Aug 15, 2012 at 6:10 PM, Tyler Tallman dspites...@gmail.com wrote: By wasting my time I mean if it is clear goog.math.integer is a bad idea it would be great if someone who knows would help a brother out and tell me. :-) I we are slowly moving a large google closure codebase into

Re: Exception message in read-string - Clojure vs ClojureScript

2012-08-16 Thread David Nolen
On Thu, Aug 16, 2012 at 1:24 AM, Shantanu Kumar kumar.shant...@gmail.com wrote: Hi, I encountered this when trying to run `read-string` on Clojure (clojure.core) and ClojureScript (cljs.reader). I noticed when I run (read-string ), I get the exception message EOF while reading on Clojure but

Re: ClojureScript: comparing dates

2012-08-16 Thread David Nolen
On Thu, Aug 16, 2012 at 3:06 PM, D.Bushenko d.bushe...@gmail.com wrote: Hi, I'm trying to compare dates with ClojureScript like this: (ns common (:require [goog.date.Date])) . . . (goog.date.Date/compare (js/Date.) (js/Date.)) Is your Google Closure up to date? You should confirm that

Re: Countdown numbers game in clojure.core.logic

2012-08-18 Thread David Nolen
On Sat, Aug 18, 2012 at 10:36 AM, David Powell djpow...@djpowell.net wrote: I just had a go of solving the Numbers Game from the UK gameshow Countdown [1] in clojure.core.logic. https://gist.github.com/3374505 It works, but it is a bit slow. Anybody got any ideas on better approaches?

Re: Logic Programming

2012-08-19 Thread David Nolen
On Fri, Aug 17, 2012 at 11:45 PM, Benjamin Chi bch...@gmail.com wrote: Hi Jim. Where is that located? Thanks. http://github.com/jduey/mini-kanren -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to

Re: Dart

2012-08-23 Thread David Nolen
On Wed, Aug 22, 2012 at 1:09 PM, Jacob Goodson submissionfight...@gmx.com wrote: Anyone thinking of targeting dart with clojure? I haven't heard of anything. Would be an interesting target but perhaps a bit much if you're actually trying to reach JS clients. David -- You received this message

<    5   6   7   8   9   10   11   12   13   14   >