Re: ANN: core.match 0.2.0-alpha5

2011-10-10 Thread David Nolen
I'm just following what seemed to be a convention - https://github.com/clojure/core.unify/blob/master/src/main/clojure/clojure/core/unify.clj On Sun, Oct 9, 2011 at 7:17 PM, Alan Malloy a...@malloys.org wrote: On Oct 9, 12:31 pm, David Nolen dnolen.li...@gmail.com wrote: I've removed some

Re: ANN: core.match 0.2.0-alpha5

2011-10-10 Thread David Nolen
On Sun, Oct 9, 2011 at 11:19 PM, Ambrose Bonnaire-Sergeant abonnaireserge...@gmail.com wrote: On Mon, Oct 10, 2011 at 3:31 AM, David Nolen dnolen.li...@gmail.comwrote: - return nil instead of throwing if no match found to mirror the behavior of cond I don't like this. I'm definitely

Re: ANN: core.match 0.2.0-alpha5

2011-10-10 Thread David Nolen
On Mon, Oct 10, 2011 at 3:46 AM, Ambrose Bonnaire-Sergeant abonnaireserge...@gmail.com wrote: While we're on the topic of conventions, I think the most important convention match is breaking is using the destructuring syntax to mean something less generic by default (only vectors). (match

Re: ANN: core.match 0.2.0-alpha5

2011-10-10 Thread David Nolen
On Mon, Oct 10, 2011 at 10:28 AM, Rob Lally rob.la...@gmail.com wrote: If it only makes the non-vector seq case slower, I'd certainly make that an available option - people are going to have to manually convert other sequences into vectors anyway which creates a coding overhead and also makes

Re: ANN: core.match 0.2.0-alpha5

2011-10-10 Thread David Nolen
On Mon, Oct 10, 2011 at 10:56 AM, Ambrose Bonnaire-Sergeant abonnaireserge...@gmail.com wrote: How about: `match` - defaults to :seq, returns nil `match-debug` - defaults to :seq, w/ error checking, w/ comprehensiveness check `matchv` - defaults to :vector Ambrose I think we can just

Re: ANN: core.match 0.2.0-alpha5

2011-10-10 Thread David Nolen
On Mon, Oct 10, 2011 at 12:08 PM, Daniel Pittman dan...@rimspace.netwrote: On Mon, Oct 10, 2011 at 06:57, David Nolen dnolen.li...@gmail.com wrote: On Sun, Oct 9, 2011 at 11:19 PM, Ambrose Bonnaire-Sergeant abonnaireserge...@gmail.com wrote: On Mon, Oct 10, 2011 at 3:31 AM, David Nolen

Re: ANN: core.match 0.2.0-alpha5

2011-10-10 Thread David Nolen
On Mon, Oct 10, 2011 at 2:43 PM, Steve Miner stevemi...@gmail.com wrote: I've just been playing around a bit with match so please forgive me if I've missed some prior discussions regarding issues that are considered settled. One of my first attempts was to match a vector of two of the same

Re: ANN: core.match 0.2.0-alpha5

2011-10-10 Thread David Nolen
On Mon, Oct 10, 2011 at 3:42 PM, Steve Miner stevemi...@gmail.com wrote: match-let looks good. I see that you are Clojure contributor - I'm more than happy to include this. Yes, I'm a registered contributor. It's all yours. I'll take a look at the code and see if I can fix things for

Re: Reactions to google dart?

2011-10-10 Thread David Nolen
As a language - not much exciting stuff. ClojureScript by targeting lowest common denominator JavaScript is portable in a way that Dart is not. I'm skeptical that Dart will see much uptake from various vendors - but only time will tell. David On Mon, Oct 10, 2011 at 7:47 AM, ivo

Re: ANN: core.match 0.2.0-alpha5

2011-10-10 Thread David Nolen
On Mon, Oct 10, 2011 at 6:07 PM, Stephen Wrobleski st...@localtoast.orgwrote: I think a match-debug is barking up the wrong tree. If throwing an exception is the right thing to do to track down an unaccounted case, why make a different macro just for a slightly different default behavior that

Re: read-string behavior in ClojureScript

2011-10-11 Thread David Nolen
Looks like a bug, ticket created - http://dev.clojure.org/jira/browse/CLJS-85 On Tue, Oct 11, 2011 at 2:16 AM, Praki praki.prak...@gmail.com wrote: In Clojure (read-string :a:b:c) returns :a:b:c (a keyword with two embedded colons) whereas ClojureScript returns :a. In ClojureScript reading of

Re: Bug in str fun affecting keyword fn and other downstream functions?

2011-10-11 Thread David Nolen
Apologies in trying to fix CLJS-84, I broke some things. This is backed out now and in its own branch. David On Tue, Oct 11, 2011 at 9:16 AM, Dave Sann daves...@gmail.com wrote: Hi all, I have been trying to get the browser repl to work tonight. I can't get this to work and have tracked the

Re: metadata on function objects

2011-10-11 Thread David Nolen
Relevant IRC thread - http://clojure-log.n01se.net/date/2011-03-01.html#12:41 On Tue, Oct 11, 2011 at 8:53 PM, Brian Marick mar...@exampler.com wrote: On Oct 11, 2011, at 7:48 PM, Stuart Sierra wrote: I suppose you could iterate over all known Vars and construct a map from fns to the Vars

Re: ClojureScript memoize throws error

2011-10-12 Thread David Nolen
Thanks for the report, CLJS-62 reopened, http://dev.clojure.org/jira/browse/CLJS-62 David On Wed, Oct 12, 2011 at 2:10 PM, Praki praki.prak...@gmail.com wrote: I am running into a problem with memoized functions in ClojureScript. Functions which take a single argument work okay but functions

Re: NodeJS REPL

2011-10-12 Thread David Nolen
Nice! I think :target :nodejs is just about guaranteeing that some Node.js definitions like 'require' are in place and providing a more sensible print fn. David On Wed, Oct 12, 2011 at 11:48 AM, kurtharriger kurtharri...@gmail.comwrote: I took a stab at writing a repl for nodejs. The node

Re: ClojureScript memoize throws error

2011-10-13 Thread David Nolen
Fixed in master. On Wed, Oct 12, 2011 at 2:22 PM, David Nolen dnolen.li...@gmail.com wrote: Thanks for the report, CLJS-62 reopened, http://dev.clojure.org/jira/browse/CLJS-62 David On Wed, Oct 12, 2011 at 2:10 PM, Praki praki.prak...@gmail.com wrote: I am running into a problem

Re: read-string behavior in ClojureScript

2011-10-13 Thread David Nolen
Also fixed in master. On Tue, Oct 11, 2011 at 9:17 AM, David Nolen dnolen.li...@gmail.com wrote: Looks like a bug, ticket created - http://dev.clojure.org/jira/browse/CLJS-85 On Tue, Oct 11, 2011 at 2:16 AM, Praki praki.prak...@gmail.com wrote: In Clojure (read-string :a:b:c) returns

Excellent blog post on core.logic

2011-10-13 Thread David Nolen
Ryan Senior has put together an excellent post on appendo - a relation from core.logic. Highly recommended. http://objectcommando.com/blog/2011/10/13/appendo-the-great/ David -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send

Re: ClojureScript: integration with jQuery

2011-10-13 Thread David Nolen
ClojureScript can access globals via js/foo. You can easily interact with your existing codebase using this simple feature. For example: (ns foo.bar) (def j js/jQuery) (.text (j div#foo) jQuery works!) Were you looking for something more sophisticated then this? David On Wed, Oct 12, 2011 at

Re: ClojureScript: API documentation

2011-10-14 Thread David Nolen
Frank, Apologies, ClojureScript at the moment is designed with a bit of a bias towards people to who already know Clojure. This is unfortunate since there are many people who could use ClojureScript *today* who don't need or want to invest in Clojure on the JVM. Because of the bias some obvious

Re: [ClojureScript]: Breaking change coming WRT object property access syntax

2011-10-14 Thread David Nolen
Sorry I didn't copy my perspective over here from clojure-dev as someone who's been working as a JavaScript dev for the past 6 years - The proposed change is not optimal and I think it clashes with the realities of JavaScript interop. (.property foo) Currently gives us a notion of place,

Re: cljsc-vector to js-array conversion issue (?)

2011-10-15 Thread David Nolen
Vectors are not JavaScript arrays. No need to use the js/Array constructor: (array 1 2 3) Should work fine. Given how often JS frameworks want to be fed nested objects like this, a patch for http://dev.clojure.org/jira/browse/CLJS-37would be nice. David On Sat, Oct 15, 2011 at 8:33 PM, Frank

Re: cljsc-vector to js-array conversion issue (?)

2011-10-15 Thread David Nolen
is appreciated. The proposed solutions sounds great. -FS. On Oct 15, 2011, at 5:47 PM, David Nolen wrote: Vectors are not JavaScript arrays. No need to use the js/Array constructor: (array 1 2 3) Should work fine. Given how often JS frameworks want to be fed nested objects like

Re: Get the name of keyword/symbol in clojurescript

2011-10-17 Thread David Nolen
Are you using ClojureScript HEAD? If you are and you are still seeing this under what conditions (advanced mode, browser REPL, etc.) ? David On Mon, Oct 17, 2011 at 6:41 PM, Jonathan Fischer Friberg odysso...@gmail.com wrote: Hi, As I understand it, clojurescript uses some unicode

Re: Get the name of keyword/symbol in clojurescript

2011-10-18 Thread David Nolen
18, 2011 at 1:16 AM, David Nolen dnolen.li...@gmail.comwrote: Are you using ClojureScript HEAD? If you are and you are still seeing this under what conditions (advanced mode, browser REPL, etc.) ? David On Mon, Oct 17, 2011 at 6:41 PM, Jonathan Fischer Friberg odysso...@gmail.com wrote

Re: Get the name of keyword/symbol in clojurescript

2011-10-18 Thread David Nolen
:9) at clojure.lang.Compiler.eval(Compiler.java:6424) ... 31 more On Tue, Oct 18, 2011 at 4:25 PM, David Nolen dnolen.li...@gmail.comwrote: Does the same problem occur when trying this at the REPL (say via script/repljs) ? David On Tue, Oct 18, 2011 at 7:22 AM, Jonathan Fischer

Re: Get the name of keyword/symbol in clojurescript

2011-10-18 Thread David Nolen
, and the result is as expected. In the browser I still get the extra characters however. On Tue, Oct 18, 2011 at 5:04 PM, David Nolen dnolen.li...@gmail.comwrote: Have you rerun the bootstrap script since the Rhino upgrade? On Tue, Oct 18, 2011 at 10:33 AM, Jonathan Fischer Friberg

Re: Get the name of keyword/symbol in clojurescript

2011-10-18 Thread David Nolen
, Oct 18, 2011 at 5:22 PM, David Nolen dnolen.li...@gmail.comwrote: Try removing the following: file.js out and recompiling. I also recommend compiling one of the ClojureScript samples that you haven't checked out yet to see if the issue is reproducible. David On Tue, Oct 18, 2011 at 11

Re: Clojure 1.3 treatment of integers and longs

2011-10-18 Thread David Nolen
233 messages long thread from June 2010, http://groups.google.com/group/clojure/browse_thread/thread/c8c850595c91cc11/171cacba292a0583 David On Tue, Oct 18, 2011 at 5:00 PM, nathanmarz nathan.m...@gmail.com wrote: Hey all, I recently started upgrading Storm to Clojure 1.3, and I ran into

Re: Clojure 1.3 treatment of integers and longs

2011-10-20 Thread David Nolen
Such a change would be make Clojure's numeric design inconsistent. You keep saying that Clojure is changing the types - that's probably not the right way to look at it. It's a semantic change, Clojure now only has 64bit primitives - the same way that JavaScript only has doubles. Prior to the 1.3

Re: Clojure 1.3 treatment of integers and longs

2011-10-20 Thread David Nolen
On Thu, Oct 20, 2011 at 3:45 PM, nathanmarz nathan.m...@gmail.com wrote: But Clojure is already inconsistent. ints and Integers in interop are treated differently. The only way to make Clojure consistent is to either: Clojure is consistent. Whether or not that makes *interop* easier or

Re: accessing clojurescript browser REPL remotely

2011-10-21 Thread David Nolen
Hmm I get no errors. But it doesn't work. I agree that would be a *real* killer app for ClojureScript. Debugging JS on mobile browsers is a big pain. I will try looking into it if no one else gets to it first, ticket created http://dev.clojure.org/jira/browse/CLJS-92 David On Thu, Oct 20, 2011

Re: Rich Hickey: Simple Made Easy from Strange Loop 2011

2011-10-21 Thread David Nolen
Collections often include false as a value. You will have to handle it by using some other value like ::not-found. David On Fri, Oct 21, 2011 at 12:50 PM, Mark Engelberg mark.engelb...@gmail.comwrote: I've always felt that Clojure's treatment of nil was somehow inconsistent with the elegance

Re: Rich Hickey: Simple Made Easy from Strange Loop 2011

2011-10-21 Thread David Nolen
Just because we have dynamic types does not give us the freedom to not consider them. (when s ...) Does not communicate anything about collections - only nil, false or something else. (when (seq s) ...) (when (empty? s) ...) Clearly express a consideration about the types at play.

Re: Rich Hickey: Simple Made Easy from Strange Loop 2011

2011-10-21 Thread David Nolen
On Fri, Oct 21, 2011 at 4:02 PM, Mark Engelberg mark.engelb...@gmail.comwrote: On Fri, Oct 21, 2011 at 12:41 PM, David Nolen dnolen.li...@gmail.com wrote: Just because we have dynamic types does not give us the freedom to not consider them. Oh, I definitely considered the types when I

Re: accessing clojurescript browser REPL remotely

2011-10-21 Thread David Nolen
On Oct 21, 8:53 am, David Nolen dnolen.li...@gmail.com wrote: Hmm I get no errors. But it doesn't work. I agree that would be a *real* killer app for ClojureScript. Debugging JS on mobile browsers is a big pain. I will try looking into it if no one else gets to it first, ticket createdhttp

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

core.match 0.2.0-alpha6, breaking change for or patterns

2011-10-27 Thread David Nolen
The biggest change is the removal of the infix or pattern syntax. Feedback appreciated. Fixes * MATCH-34: no more infix or pattern syntax * MATCH-10: support maps with keys of heterogenous types * MATCH-30: throw if same binding name used in row * MATCH-33: fix readme typo Enhancements

Re: core.match 0.2.0-alpha6, breaking change for or patterns

2011-10-28 Thread David Nolen
The documentation has been updated to account for the changes: https://github.com/clojure/core.match On Fri, Oct 28, 2011 at 5:40 AM, Michael Jaaka michael.ja...@googlemail.com wrote: Can you give examples of usage for each position? -- You received this message because you are subscribed

Re: ClojureScript interop

2011-10-28 Thread David Nolen
There's a ticket, http://dev.clojure.org/jira/browse/CLJS-37 However things get fixed faster if you submit a patch ;) If you're excited about ClojureScript, then consider submitting a CA and helping out. David On Fri, Oct 28, 2011 at 6:58 PM, David Powell d...@djpowell.net wrote: I'm

Re: ClojureScript interop

2011-10-28 Thread David Nolen
I added the compiler macros to make this work in a branch: https://github.com/clojure/clojurescript/compare/37-support-for-js-literals Feedback appreciated. David On Fri, Oct 28, 2011 at 7:04 PM, David Nolen dnolen.li...@gmail.com wrote: There's a ticket, http://dev.clojure.org/jira/browse

A Taste of cKanren (via a coding challenge)

2011-10-30 Thread David Nolen
Larent Petit pointed out this fun challenge: http://beust.com/weblog/2011/10/30/a-new-coding-challenge/ To get a sense of how cool cKanren and constraint logic programming is I recommend reading my post about solving it using cKanren http://dosync.posterous.com/a-taste-of-ckanren. This is what

Re: A Taste of cKanren (via a coding challenge)

2011-10-30 Thread David Nolen
Heh, as someone pointed out this doesn't actually solve the puzzle since I'm not considering putting stones on either side of the scale. Still I think the idea of what cKanren can do is communicated :) On Sun, Oct 30, 2011 at 8:34 PM, Brent Millare brent.mill...@gmail.comwrote: Looks really

Re: A Taste of cKanren (via a coding challenge)

2011-10-31 Thread David Nolen
Here's a correct version that solves the puzzle in ~12ms, https://gist.github.com/1329580. A bit longer but it fun to combine constraints w/ search. Will try to find some time to write a more detailed explanation. On Sun, Oct 30, 2011 at 9:00 PM, David Nolen dnolen.li...@gmail.com wrote: Heh

Re: A Taste of cKanren (via a coding challenge)

2011-10-31 Thread David Nolen
A blog post explaining the solution step by step http://dosync.posterous.com/another-taste-of-ckanren. On Mon, Oct 31, 2011 at 9:36 PM, David Nolen dnolen.li...@gmail.com wrote: Here's a correct version that solves the puzzle in ~12ms, https://gist.github.com/1329580. A bit longer but it fun

Re: Empty list type

2011-11-01 Thread David Nolen
(isa? (type '(:foo :bar)) clojure.lang.IPersistentList) = true (isa? (type ()) clojure.lang.IPersistentList) = true (isa? (type (list)) clojure.lang.IPersistentList) = true 2011/11/1 Sebastián Galkin paras...@gmail.com Can somebody explain the rationale behind this?: (isa? (type '(:foo :bar))

Re: Loop performance issue with variable

2011-11-01 Thread David Nolen
n is stored in a var and thus boxed. You can cast it to primitive long with (long n). On Tuesday, November 1, 2011, redraiment redraim...@gmail.com wrote: Hi all, My environment is, Kubuntu 11.10, Clojure v1.3 and sun-java6-jdk. I issued the following forms in REPL: user= (def n 1)

ANN: core.logic 0.6.5 release

2011-11-01 Thread David Nolen
Just cut a new release that hopefully makes playing with core.logic a lot less tedious. From 0.6.4 to 0.6.5 Enhancements --- * Consolidate all the useful name spaces into clojure.core.logic * We now only overload ==, no more need to exclude reify or inc You can use core.logic in your own

Re: ANN: core.logic 0.6.5 release

2011-11-02 Thread David Nolen
They are still there just renamed so as not to conflict with clojure.core: -reify, -inc On Wednesday, November 2, 2011, Ambrose Bonnaire-Sergeant abonnaireserge...@gmail.com wrote: What happened to reify and inc? Ambrose On Wed, Nov 2, 2011 at 12:10 PM, David Nolen dnolen.li...@gmail.com

Re: Clojure Conj extracurricular activities spreadsheet

2011-11-03 Thread David Nolen
Any thoughts about when / where these events can take place? Is it possible to get access to a projector? Or do we have to fend for ourselves? David On Tuesday, October 25, 2011, Fogus mefo...@gmail.com wrote: All, We talked about the possibility of getting some ideas about extracurricular

Re: ClojureScript function callbacks (aka. how to get this without (js* this))

2011-11-03 Thread David Nolen
Accessing this is supported via this-as https://github.com/clojure/clojurescript/commit/09ff093dc86b455e3090ce3612c5e01f3b5bada6 On Thu, Nov 3, 2011 at 1:51 AM, olivergeorge olivergeo...@gmail.com wrote: Hello, This must be obvious (pun unintended) but I'm struggling to work out how to

Re: Simple Made Easy - Any Examples?

2011-11-04 Thread David Nolen
Look at the sources for ClojureScript, Ring, Clache. David On Sun, Oct 30, 2011 at 9:23 PM, aboy021 arthur.bo...@gmail.com wrote: I very much enjoyed Rich's talk on Simple Made Easy (http:// www.infoq.com/presentations/Simple-Made-Easy). It seemed to address a great many of the frustrations

Re: Clojure Conj extracurricular activities spreadsheet

2011-11-04 Thread David Nolen
Wow that would be awesome! On Fri, Nov 4, 2011 at 12:13 PM, Gary Trakhman gary.trakh...@gmail.comwrote: I can offer my personal projector if it's needed. -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to

Re: Solving this with logic programing

2011-11-05 Thread David Nolen
For wildcards you can use symbol-macrolet from tools.macro (macro/symbol-macrolet [_ (lvar)] (all (== [_ _ [_ _ 'milk _ _] _ _] hs) )) On Sat, Nov 5, 2011 at 1:24 PM, Ambrose Bonnaire-Sergeant abonnaireserge...@gmail.com wrote: I gave the wildcard requirement a bit of thought,

Re: Solving this with logic programing

2011-11-05 Thread David Nolen
I would probably write the code like this: (defrel permission role op state) (defn add-permision [roles ops states] (doseq [r roles o ops s states] (fact permission r o s))) (add-permision #{:admin :operator} #{:reject :accept} #{:applied}) (defn permissiono [role op state] (run* [q]

Re: Solving this with logic programing

2011-11-05 Thread David Nolen
tutorial for core.logic? By fine I mean something like learn haskell for great good. On 5 Lis, 20:26, Michael Jaaka michael.ja...@googlemail.com wrote: Now is ok, easy to grasp. How the lein dep declaration and clj import looks? Thank you both. On 5 Lis, 20:11, David Nolen dnolen.li

Re: ClojureScript and CouchDB?

2011-11-06 Thread David Nolen
If you want to have a lot of database options you could target Node.js. David On Sunday, November 6, 2011, Antonio Recio amdx6...@gmail.com wrote: I would like to use ClojureScript to interact with databases. Which is the database engine that you recommend me to use with ClojureScript? Is

Re: Speculative Execution

2011-11-06 Thread David Nolen
Yup. core.logic uses persistent hash maps to store logic variable bindings. David On Sun, Nov 6, 2011 at 10:32 PM, daly d...@axiom-developer.org wrote: One of the benefits of immutable data structures is the ability to do speculative execution. You can compute an answer and if you don't like

Re: Clojure Conj extracurricular activities spreadsheet

2011-11-07 Thread David Nolen
Excellent! David On Mon, Nov 7, 2011 at 10:53 AM, Christopher Redinger redin...@gmail.comwrote: On Thursday, November 3, 2011 3:46:40 PM UTC-4, David Nolen wrote: Any thoughts about when / where these events can take place? Is it possible to get access to a projector? Or do we have to fend

Re: Clojure Conj extracurricular activities spreadsheet

2011-11-07 Thread David Nolen
Anybody mind if the miniKanren / cKanren presentation happens at 6pm Thursday in the main ballroom? David On Mon, Nov 7, 2011 at 10:53 AM, Christopher Redinger redin...@gmail.comwrote: On Thursday, November 3, 2011 3:46:40 PM UTC-4, David Nolen wrote: Any thoughts about when / where

Re: core.logic questions

2011-11-09 Thread David Nolen
Functions that are going to be used in core logic must return goals. (defn parents-of [m f c] (parent m c) (parent f c) (!= m f)) In this case you only return the (!= m f) subgoal instead of the goal that represents the conjunction of all three subgoals. (defn parents-of [m f c]

Re: A Taste of cKanren (via a coding challenge)

2011-11-11 Thread David Nolen
Can you reorder your statements without changing the meaning of your program? For example you cannot move the placement of the return expression. David On Fri, Nov 11, 2011 at 8:09 PM, Jules julesjac...@gmail.com wrote: Here is a new program. Perhaps you would consider this declarative: def

Re: A Taste of cKanren (via a coding challenge)

2011-11-11 Thread David Nolen
(define (matches n) (run #f (q) (fresh (a b c d s1 s2) (== q `(,a ,b ,c ,d)) (domfd a b c d s1 s2 (range 1 n)) (all-differentfd `(,a ,b ,c ,d)) (== a 1) (=fd a b) (=fd b c) (=fd c d) (plusfd a b s1) (plusfd s1 c s2) (plusfd s2 d n) (checko

Re: A Taste of cKanren (via a coding challenge)

2011-11-11 Thread David Nolen
Excellent point Ambrose ;) And here it is: (define (subchecko w sl r o n) (conde ((== sl ()) (fresh (a d) (domfd a (range 1 100)) (conde ((conso a d r) (plusfd a 1 w) (conso w r o)) ((== r '()) (conso w r o) ((fresh (a b c

Re: A Taste of cKanren (via a coding challenge)

2011-11-11 Thread David Nolen
Also note that even given all this generality over the Python code - the earlier Python implementation takes ~300ms and this implementation takes 900ms on my machine. Quite a bit slower than ~12ms. Inferring 40 takes even less time of course - ~8ms. But really the execution time is just icing on

Re: A Taste of cKanren (via a coding challenge)

2011-11-12 Thread David Nolen
:16, David Nolen dnolen.li...@gmail.com wrote: Also note that even given all this generality over the Python code - the earlier Python implementation takes ~300ms and this implementation takes 900ms on my machine. Quite a bit slower than ~12ms. Inferring 40 takes even less time of course

Re: A Taste of cKanren (via a coding challenge)

2011-11-12 Thread David Nolen
, David Nolen dnolen.li...@gmail.com wrote: Also note that even given all this generality over the Python code - the earlier Python implementation takes ~300ms and this implementation takes 900ms on my machine. Quite a bit slower than ~12ms. Inferring 40 takes even less time of course - ~8ms

Re: A Taste of cKanren (via a coding challenge)

2011-11-13 Thread David Nolen
On Sun, Nov 13, 2011 at 10:46 AM, Jules julesjac...@gmail.com wrote: Here is a slight modification of the previous program that can be executed in two directions: N = [40] A = range(1,40) B = range(1,40) C = range(1,40) D = range(1,40) def valid(a,b,c,d,n): weights =

Re: Latest Bagwell paper for a new implementation of Clojure vectors ?

2011-11-13 Thread David Nolen
This would be awesome. From his talk it sounds like it shouldn't replace PersistentVector at all, in fact you should be able to share structure with PersistentVector right? David On Sun, Nov 13, 2011 at 10:02 AM, Krukow karl.kru...@gmail.com wrote: By the way, I don''t see it as a replacement

Re: Latest Bagwell paper for a new implementation of Clojure vectors ?

2011-11-13 Thread David Nolen
You should definitely look at gvec.clj. It's a PersistentVector implementation in Clojure but for the various primitive types. David On Sun, Nov 13, 2011 at 12:38 PM, Karl Krukow karl.kru...@gmail.com wrote: On 13/11/2011, at 18.14, David Nolen wrote: This would be awesome. From his talk

Re: Clojure-in-CommonLisp?

2011-11-15 Thread David Nolen
On Tue, Nov 15, 2011 at 4:53 AM, Konrad Hinsen googlegro...@khinsen.fastmail.net wrote: On 15 Nov, 2011, at 6:51 , Cyrus Harmon wrote: I've been wanting this for some time. Obviously the java interop stuff poses challenges, but the clojure data types, protocols, immutable objects, clojure

Re: Forcing computation

2011-11-15 Thread David Nolen
(def x (doall (map fn coll))) On Tue, Nov 15, 2011 at 11:52 AM, labwor...@gmail.com wrote: I understand that lazy sequences are very useful but sometimes, I want to compute everything, go away, and have it there when I come back. How do I do that with a map? (def x (map fn coll)) -- You

Re: ClojureScript macro import

2011-11-15 Thread David Nolen
:use-macros is now supported. On Tue, Nov 15, 2011 at 5:18 PM, kovas boguta kovas.bog...@gmail.comwrote: Bump. Is this still the case? That its not possible to have user-created macros targeting clojurescript without namespace prefixes? On Tue, Aug 9, 2011 at 2:31 PM, Kevin Lynagh

Re: ClojureScript: Correct way to call an instance method with parameters?

2011-11-17 Thread David Nolen
setDate mutates the date and does not return a value. David On Thu, Nov 17, 2011 at 3:26 PM, Base basselh...@gmail.com wrote: HI I am attempting to manipulate a goog.date.Date object and am a little confused on how to call a method on this object in ClojureScript If I have a date object,

Re: ClojureScript: Correct way to call an instance method with parameters?

2011-11-17 Thread David Nolen
On Thu, Nov 17, 2011 at 3:39 PM, Base basselh...@gmail.com wrote: It mentions: The one important difference is in calling no-argument methods. In Java (. x toString), where toString is a method, would unambiguously mean call the toString method of x. JavaScript is more flexible, separating

Re: ClojureScript: Should 'advanced optimizations' lead to faster execution? (or just faster loading)

2011-11-17 Thread David Nolen
I haven't seen performance gains from advanced optimization. David On Thu, Nov 17, 2011 at 5:18 PM, Paul Richards paul.richa...@gmail.comwrote: Hi, I'm interested in the differences between the default ClojureScript compile, and the {:optimizations :advanced} mode. Aside from loading times

Re: Static contract checking for Clojure?

2011-11-20 Thread David Nolen
On Sun, Nov 20, 2011 at 11:53 AM, Robert Levy r.p.l...@gmail.com wrote: See: http://gallium.inria.fr/~naxu/research/dana-phd.pdf What do you think about this idea? I have just started reading the above pdf... I don't see much of interest when googling for 'static contract Racket' but that

Re: ClojureScript deftype and extend-type differ

2011-11-20 Thread David Nolen
Please open a ticket for this in JIRA, thanks - http://dev.clojure.org/jira/browse/CLJS David On Sun, Nov 20, 2011 at 12:33 PM, Jeff Valk jv-li...@tx.rr.com wrote: Hello all, I ran into an extend-type issue with the ClojureScript compiler output. If there's a better place to report such

Re: ClojureScript deftype and extend-type differ

2011-11-20 Thread David Nolen
Thanks! Patches welcome as well :) David On Sun, Nov 20, 2011 at 2:07 PM, Jeff Valk jv-li...@tx.rr.com wrote: Issue opened: http://dev.clojure.org/jira/browse/CLJS-104. Cheers, Jeff -- You received this message because you are subscribed to the Google Groups Clojure group. To post to

Re: Can't build clojure cloned from github - 2 tests failed - when running from cygwin

2011-11-21 Thread David Nolen
Have you looked at this, http://dev.clojure.org/display/doc/Getting+Started+with+Emacs ? David 2011/11/21 Michael Jaaka michael.ja...@googlemail.com Hmmm... When trying to do http://riddell.us/ClojureSwankLeiningenWithEmacsOnLinux.html especially Add the following: (defproject

ClojureScript new branches - feedback please

2011-11-21 Thread David Nolen
Note that none of the following branches are promises of features. I'm merely bringing them up to get feedback from ClojureScript users: prop-lookup New property syntax so that method calls and property lookup are no longer ambiguous 33-type-fn Nicer printing of types defined via deftype and

Re: [core.logic] Incorporating a database as a source of facts

2011-11-23 Thread David Nolen
Sounds interesting. I can't offer much guidance on how to build such a system but I'm certainly interested in improvements to core.logic's interface to make implementing such things simpler. What exactly do you expect core.logic to do in this case? David On Wed, Nov 23, 2011 at 5:52 PM, Mark

Re: [core.logic] Incorporating a database as a source of facts

2011-11-23 Thread David Nolen
Seems possible but I can't say much more than that. core.logic operates on tuples, so you could extract the resultset form the DB and pass them along to core.logic to constrain further without much difficulty. David On Wed, Nov 23, 2011 at 6:24 PM, Mark markaddle...@gmail.com wrote: It occurs

Re: ClojureScript Repl -- Swank-like workflow with Emacs?

2011-11-24 Thread David Nolen
/path/to/repl/script/browser-repl NOT /path/to/repl/script/repljs I just tried browser-repl and it works just fine for me. What do you mean by hangs? Do you see the REPL prompt? David On Thu, Nov 24, 2011 at 10:13 AM, Wilkes Joiner wilkesjoi...@gmail.comwrote: I'm seeing the same

Re: ClojureScript Repl -- Swank-like workflow with Emacs?

2011-11-24 Thread David Nolen
On Thu, Nov 24, 2011 at 11:49 AM, Baishampayan Ghose b.gh...@gmail.comwrote: On Thu, Nov 24, 2011 at 10:15 PM, Wilkes Joiner wilkesjoi...@gmail.com wrote: The server appears to start up fine as the inferior-lisp process, but when I enter an expression it is never evaluated. Looking in the

Re: ClojureScript Repl -- Swank-like workflow with Emacs?

2011-11-24 Thread David Nolen
You said the REPL hangs, do you don't see a prompt? David On Thu, Nov 24, 2011 at 12:12 PM, Wilkes Joiner wilkesjoi...@gmail.comwrote: No dice on the browser refresh. I'm wondering if it something with my emacs config. I'm going to strip it down to the simplest set up I can manage and see

Re: ClojureScript Repl -- Swank-like workflow with Emacs?

2011-11-24 Thread David Nolen
And you don't see a JS error in the browser JS console? On Thu, Nov 24, 2011 at 12:39 PM, Wilkes Joiner wilkesjoi...@gmail.comwrote: I see a prompt. It just never evaluates an expression. -- Wilkes Joiner On Thursday, November 24, 2011 at 11:38 AM, David Nolen wrote: You said the REPL

Re: ClojureScript Repl -- Swank-like workflow with Emacs?

2011-11-24 Thread David Nolen
Joiner On Thursday, November 24, 2011 at 11:38 AM, David Nolen wrote: You said the REPL hangs, do you don't see a prompt? David On Thu, Nov 24, 2011 at 12:12 PM, Wilkes Joiner wilkesjoi...@gmail.comwrote: No dice on the browser refresh. I'm wondering if it something with my emacs config

Re: ClojureScript Repl -- Swank-like workflow with Emacs?

2011-11-24 Thread David Nolen
Did you remember to include utf-8 meta tag in your html page? On Thu, Nov 24, 2011 at 3:00 PM, Wilkes Joiner wilkesjoi...@gmail.comwrote: I got it working, sort of. If I launch inferior-lisp from the $CLOJURESCRIPT_HOME/samples/repl/src/repl/test.cljs, then I can pull up my apps page that

Re: [core.logic] Incorporating a database as a source of facts

2011-11-27 Thread David Nolen
As Mark said you can avoid the graph issue with tabling. core.logic has tabling. If you look at the tabling section here - https://github.com/clojure/core.logic, you should see something related to your problem. While defrel/facts are neat - they are really intended for people who don't already

Re: [core.logic] Incorporating a database as a source of facts

2011-11-27 Thread David Nolen
on this front and will certainly help move things along if someone is willing to do the design work. David On Thu, Nov 24, 2011 at 11:15 AM, David Nolen dnolen.li...@gmail.comwrote: As Mark said you can avoid the graph issue with tabling. core.logic has tabling. If you look at the tabling section here

Re: Symbol matching in core.match

2011-11-30 Thread David Nolen
(quote foo) should be interpreted as a literal match. I thought this was addressed by a previous user submitted patch but it doesn't look like that's true. We currently use seqs as a marker of custom syntax, we dispatch either on the first or second element of the seq. For example this is how we

Re: Symbol matching in core.match

2011-11-30 Thread David Nolen
On Wed, Nov 30, 2011 at 4:29 PM, Steve Miner stevemi...@gmail.com wrote: On Nov 30, 2011, at 3:04 PM, David Nolen wrote: (quote foo) should be interpreted as a literal match. I thought this was addressed by a previous user submitted patch but it doesn't look like that's true. I wrote

Re: [core.logic] Incorporating a database as a source of facts

2011-11-30 Thread David Nolen
On Wed, Nov 30, 2011 at 4:38 PM, Sam Ritchie sritchi...@gmail.com wrote: Have you guys taken a look at Cascalog? ( https://github.com/nathanmarz/cascalog) It's a datalog implementation in Clojure that compiles down to MapReduce jobs. Cascalog's host, Cascading, allows you to pull information

Re: Symbol matching in core.match

2011-11-30 Thread David Nolen
On Wed, Nov 30, 2011 at 5:06 PM, Alex Miller a...@puredanger.com wrote: ;; plus is a symbol to match, _x, _y are variables (let [e '(plus 2 3)] (match [e] [([plus _x _y] :seq)] (+ _x _y))) To me, that gives them a placeholder feel and plays well with the use of _. This would break

Re: Symbol matching in core.match

2011-11-30 Thread David Nolen
Looks good patch applied. On Wed, Nov 30, 2011 at 7:24 PM, Alex Miller a...@puredanger.com wrote: Ha, I wrote the identical patch locally and it seemed good to me. So it gets my ok! On Nov 30, 5:00 pm, Steve Miner stevemi...@gmail.com wrote: I filed the bug and attached a patch. The

Re: stack overflow vs scheme

2011-12-01 Thread David Nolen
If you run out stack in Scheme the code is not properly tail recursive. Who care when it blows? On Thu, Dec 1, 2011 at 12:09 PM, john.holland jbholl...@gmail.com wrote: I was studying clojure for a while, and took a break to work on SICP in scheme. I found that they do numerous things that are

Re: stack overflow vs scheme

2011-12-01 Thread David Nolen
I didn't mean the response to sound overly curt. You can set the stack size on JVM. But the point is, that quick sort is simply wrong if you do not want to grow the stack, whether in Scheme or in Clojure. On Thu, Dec 1, 2011 at 5:07 PM, David Nolen dnolen.li...@gmail.com wrote: If you run out

Re: another noob recursion question

2011-12-01 Thread David Nolen
On Thu, Dec 1, 2011 at 7:03 AM, John Holland jbholl...@gmail.com wrote: I've been looking into Clojure and now Scheme for a while. Currently it's been SICP. I notice that SICP has examples of recursion such as a binary tree builder that is something like the following: (define (tree top

<    3   4   5   6   7   8   9   10   11   12   >