Bug with Clojure 1.2 REPL (aka master branch) ?

2010-01-12 Thread David Nolen
Hullo, I'm trying to run the REPL from the command line. I note that when I include jars in the classpath, including clojure libraries works fine (via use for example). However when adding libraries of Clojure source directories to the classpath I get a very strange error: user=> (use 'lancet) ja

Re: Bug with Clojure 1.2 REPL (aka master branch) ?

2010-01-12 Thread David Nolen
ink if > you're using > 1.2 master of clojure you need 1.1 master of contrib. Is that right? > > On Jan 12, 6:41 pm, David Nolen wrote: > > Hullo, > > > > I'm trying to run the REPL from the command line. I note that when I > include > > jars in the cla

Re: Couverjure: an attempt at a direct bridge between Clojure and Cocoa

2010-01-18 Thread David Nolen
Very cool. On Mon, Jan 18, 2010 at 8:51 AM, Mark Allerton wrote: > Hi all, > > I've been hacking on a bridge between Clojure and Cocoa, and have been > prompted to break cover by recent discussion of the subject of Objective-C > interfacing here on this list. > > The code is strictly "demo" or "p

Re: Debugging in Clojure

2010-01-21 Thread David Nolen
I find that injecting print statements is painful if you're not using something like paredit (Emacs). With paredit it's quite simple. On Thu, Jan 21, 2010 at 8:27 PM, ajay gopalakrishnan wrote: > Is this the preferred way of debugging in Clojure? > > > On Thu, Jan 21, 2010 at 5:25 PM, Richard New

Re: What's the best way to do this?

2010-01-21 Thread David Nolen
I agree, one possible improvement would be short circuiting on the first false pred. (defn combine-preds [pred & others] (fn [v] (loop [result true pred pred others others] (if (not result) result (if (nil? pred) result (recur (pred v) (first others)

Re: What's the best way to do this?

2010-01-21 Thread David Nolen
Oops you're right :) And better written as well :D On Fri, Jan 22, 2010 at 1:26 AM, Richard Newman wrote: > I agree, one possible improvement would be short circuiting on the first >> false pred. >> > > every? does short-circuit. > > user=> (every? #(% 5) > (list >

Re: Promise/Deliver use cases

2010-01-22 Thread David Nolen
They are actually useful even outside the context of concurrency. For example perhaps you have a recursive data structure that represents a series of unit tests and unit test suites. You would like to do two things: 1. Render out the nested structure of the tests that will be executed for the user

Re: Promise/Deliver use cases

2010-01-22 Thread David Nolen
reduce + (range 1000))) ;; 53ms (time (let [r (take 1000 (repeatedly promise))] (future-out (println "value:" (reduce + (map deref r (dotimes [x 1000] (deliver (nth r x) x If we're just pushing stuff out to UI, 53ms is certainly acceptable no? > > &g

Re: Announcement: Vijual Graph Layout Library for Clojure Version 0.1

2010-01-22 Thread David Nolen
So cool! :D On Fri, Jan 22, 2010 at 5:06 PM, Conrad wrote: > http://lisperati.com/vijual/ > > Hope some of you find this library useful. Let me know if you have > feature requests or want to help me improve this library. > > Conrad Barski > lisper...@gmail.com > > -- > You received this message

Re: Promise/Deliver use cases

2010-01-23 Thread David Nolen
On Sat, Jan 23, 2010 at 7:43 PM, Richard Newman wrote: > Use futures and promises for parallelism or dataflow-style work. Use delay > for non-parallel, synchronous delayed execution. You're right. Here's a recursive example of what I was trying to do with promise/deliver: http://gist.github.co

Re: newbie question about ns and :require

2010-01-24 Thread David Nolen
On Sun, Jan 24, 2010 at 10:28 AM, Manfred Lotz wrote: > user=> (ns my (:require clojure.contrib.classpath)) > nil > my=> > > which to me looks fine. > > But why does this fail? > > my=> (classpath) > java.lang.Exception: Unable to resolve symbol: classpath in this > context (NO_SOURCE_FILE:2) > r

Re: Clojure IRC help

2010-01-24 Thread David Nolen
Perhaps this might help: http://freenode.net/faq.shtml#userregistration On Sun, Jan 24, 2010 at 1:30 PM, joshua-choi wrote: > Sorry for asking this here, but it's about the Clojure IRC room, which > is kind of related to Clojure, being this group's sister help > resource. > > I know nothing abou

Re: Naming Functions...

2010-02-03 Thread David Nolen
On Wed, Feb 3, 2010 at 10:47 PM, Wardrop wrote: > I've always struggled when it comes to defining good names for > functions and methods. Now that I'm learning Clojure, function naming > becomes even more imperative, as you don't have classes and objects to > help give meaning to a method. I'm fi

Re: Multimethods vs. cond?

2010-02-11 Thread David Nolen
On Thu, Feb 11, 2010 at 10:27 AM, Laurent PETIT wrote: > 2010/2/11 Bryce : > > I'm wondering what the rationale is for using multimethods vs. cond, > > and where it's best to use either? Multimethods seem to be very > > seldom used, usually to dispatch on type, but I can see advantages to > > usi

Re: Idea for operations on mixed data structures of maps and sequences

2010-02-13 Thread David Nolen
On Sat, Feb 13, 2010 at 2:46 PM, Brent Millare wrote: > I'm interested in your thoughts, criticisms and improvements. I feel > like this seemed like a place for monads given all the packaging, > function passing, partial functions, and threading but trying to > understand monads makes my head turn

Re: newbie question: Please help me stop creating constructors

2010-02-17 Thread David Nolen
(defn months_in_business "The total number of months we will be in the business of renting out our home" [:keys [Months_To_Find_Tenant Months_In_Lease Lease_Cycles Months_To_Sell]] (-> (+ Months_To_Find_Tenant Months_In_Lease) (* Lease_Cycles) (+ Months_To_Sell))) -> I have n

Re: ANN: byte-spec-0.1

2010-02-18 Thread David Nolen
Nice, overtone also looks really interesting :) On Thu, Feb 18, 2010 at 11:59 AM, Jeff Rose wrote: > Just a quick announcement for a small library recently extracted from > Project Overtone. It lets you specify binary formats and then > serialize to and from

Re: compojure stop server?

2010-02-19 Thread David Nolen
Unfortunately most of the examples don't illustrate how to set this is for brevity's sake. In my own code I do the following: (defonce *app* (atom nil)) (defn start-app [] (if (not (nil? @*app*)) (stop @*app*)) (reset! *app* (run-server {:port 8080} "/*" (servl

Re: How to efficiently import large array of doubles from file?

2010-02-22 Thread David Nolen
On Mon, Feb 22, 2010 at 5:30 AM, Johann Kraus wrote: > However, when loading with read-lines from > clojure.contrib.duck-streams and (map #(Double/parseDouble %) (.split > line ",")) clojure requires several GB of RAM. Any suggestions for how > to get this down to 400MB? And what would be the over

Re: add-classpath replacement

2010-02-22 Thread David Nolen
On Mon, Feb 22, 2010 at 11:20 AM, Lukas Lehner wrote: > I don't want to restart jvm anytime I need a new jar. > Any workaround or replacement? > This is one of the real downsides of the JVM. But it does beg the question, why do you need to add jars constantly to your REPL? add-classpath was neve

Re: Why the implicit do in forms like let?

2010-02-22 Thread David Nolen
On Mon, Feb 22, 2010 at 3:51 PM, Peter T wrote: > Hi all, > > Wouldn't it make sense to limit let to a single body/expression > argument, and otherwise require the explicit use of do? > > I realize that'd be rather verbose, but it'd seem to also help make > the presence of side effects more app

Re: Why the implicit do in forms like let?

2010-02-22 Thread David Nolen
On Mon, Feb 22, 2010 at 4:54 PM, Raoul Duke wrote: > On Mon, Feb 22, 2010 at 12:51 PM, Peter T wrote: > > Am just curious what the rationale is behind the implicit do. > > ja, personally i find the implicit do's in Clojure or begin's in > Schemes to be kinda bad, sort of along the lines of what

Re: Dubious performance characteristics of hash-maps

2010-02-23 Thread David Nolen
Here's another version that's almost as fast as Rich's and it even includes the time for computing values. (defn mk-random-map-fast [n] (let [m (transient {}) r (new ec.util.MersenneTwisterFast) ni (. r (nextInt))] (loop [i 0 result m ni ni] (if (= i n) (persist

Re: ANN: Fleet — templating system

2010-02-23 Thread David Nolen
On Fri, Feb 19, 2010 at 5:12 PM, Ilia Ablamonov wrote: > Hello, > > I would like to announce an implementation of ERB/JSP/etc -like > approach for templating with (I really believe) clear and idiomatic > syntax and design decisions. > > Detailed description and code: > http://github.com/Flamefork

Re: My first use of cells: hashing

2010-02-27 Thread David Nolen
On Sat, Feb 27, 2010 at 6:49 PM, Steven E. Harris wrote: > pthatcher writes: > > > I coded it up, and I liked the result and thought others might be > > interested. > > There are several facilities used in your example that I'd like to look > into further. I found the `extend-class' function in

Re: newbie code (genetic programming) and questions (dev environments)

2010-02-28 Thread David Nolen
On Sun, Feb 28, 2010 at 2:38 PM, Lee Spector wrote: > On the development environment front: Is anyone contemplating creating a > Mac OS X "Clojure in a Box"? I would be an enthusiastic user. If it could > have roughly the feature set of the old Macintosh Common Lisp IDE then I > would be ecstatic

Re: recursive call boxing primitives?

2010-03-02 Thread David Nolen
How are you measuring the difference between these two programs? What settings are you passing to the JVM when running the Clojure version? David On Mon, Mar 1, 2010 at 5:33 PM, John Lawrence Aspden wrote: > Hi, the other day I was at a conference in London and learned Scala. > > As my first pr

Re: Leiningen, Clojure and libraries: what am I missing?

2010-03-04 Thread David Nolen
On Thu, Mar 4, 2010 at 10:59 AM, Konrad Hinsen wrote: > Right, but its imperfections have bothered me often enough. For once, if > you have different applications that require different versions of the same > library, you are in for a major headache. Python setuptools and its eggs are > a partial

Re: Leiningen, Clojure and libraries: what am I missing?

2010-03-04 Thread David Nolen
On Thu, Mar 4, 2010 at 8:33 AM, Jan Rychter wrote: > Also, I now have at least six clojure jars in ~/.m2 (huh?!), along with > a collection of other assorted stuff. I don't want to use any of these > clojure jars, I have a checked out git repo with clojure and this is the > only code I want to ru

Re: Leiningen, Clojure and libraries: what am I missing?

2010-03-04 Thread David Nolen
On Thu, Mar 4, 2010 at 10:19 AM, Stuart Sierra wrote: > As many of you know, I've always been tepid on lein. I'd rather go > with Maven whole-hog, because that offers the most robust model for > incorporating Java libraries. > If Lein evolves to to handle dependencies of dependencies and intelli

Re: Some basic guidance to designing functional vs. state parts of app

2010-03-05 Thread David Nolen
On Fri, Mar 5, 2010 at 4:08 PM, eyeris wrote: > I don't follow your logic. Modifications of refs within a transaction > retry too. > He's saying that atoms don't participate in the STM. If an atom depends on the value of some refs, your program might be put into an inconsistent state if the tran

Re: Achieving high performance, mutable primitives?

2010-03-13 Thread David Nolen
On Sat, Mar 13, 2010 at 1:59 PM, CuppoJava wrote: > Hi, > I just ran these two microbenchmarks, where I attempted to measure the > overhead in Clojure's loop-recur form as compared to just mutating an > array. > > ;;loop-recur (5300 msecs) > (time > (dotimes [n 5000] >(loop [accum (int 0) i (

A Tour of Enlive

2010-03-14 Thread David Nolen
I just finished up a fairly involved tour of Enlive. I think that Enlive is a truly fantastic library that just needs a little more documentation ;) I cover scraping Hacker News and the New York Times as well three templating examples that use Compojure. I also show how "template inheritance", cons

Re: A Tour of Enlive

2010-03-14 Thread David Nolen
On Sun, Mar 14, 2010 at 3:45 PM, Ludovic Kuty wrote: > This is great. Thanks. > > Some typos: > > lien instead of lein in "Install Leiningen" section: "I truly envy the > new Clojurians who do not know the dark times before lien repl and > lein swank :)" > laod instead of load in tutorial.scrape3=

Re: A Tour of Enlive

2010-03-15 Thread David Nolen
On Mon, Mar 15, 2010 at 3:56 AM, wilig wrote: > Thanks David, > > As a new clojurian, this is extremely helpful! I have a question. In > this function: > > (html/deftemplate index "tutorial/template1.html" > [ctxt] > [:p#message] #(if-let [msg (or (:message ctxt) >

Re: A Tour of Enlive

2010-03-15 Thread David Nolen
On Mon, Mar 15, 2010 at 1:30 AM, Brandon Mason wrote: > Awesome David! Just skimmed over this to get a sense of what Enlive > is. > > I'm currently building a demo of a RESTful API using Compojure. My > goal is to define resources using Clojure data structures and have > them converted to XML/HT

Re: A Tour of Enlive

2010-03-15 Thread David Nolen
On Mon, Mar 15, 2010 at 1:10 PM, Chouser wrote: > Did you mean to change "see" to "set"? > Oops fixed. > Also, I'd recommend a slight change to how you load the > namespaces. Specifically, I'd recommend doing the load first: > >(load "scrape1") > > And then using in-ns to change the R

Re: Web Programming with clojure

2010-03-16 Thread David Nolen
On Mon, Mar 15, 2010 at 3:11 PM, Tim Johnson wrote: > My niche currently is web programming and web interfaces. I have not > used java and I have a certain comfort level with lisp dialects. > I use emacs 22.3.1 on slackware 13.0 32-bit. > > Therefore clojure is of interest to me. > I would welcom

Re: [Newbie] leiningen and random jars

2010-03-16 Thread David Nolen
On Tue, Mar 16, 2010 at 12:22 PM, stevel wrote: > I'd really like to use leiningen to assemble my classpath for me, but > need to reference a jdbc jar. > What is the approved method of doing this? > You should put your jar into the lib directory of your project folder. You can customize this but

Re: Name suggestions

2010-03-17 Thread David Nolen
yodel On Wed, Mar 17, 2010 at 3:08 AM, mac wrote: > After just a little more test and polish I plan on calling clj-native > 1.0. But clj-native is a *really* boring name so I want to change it > before 1.0 and I don't have very good imagination when it comes to > these things. > So I need your h

Re: Simple functional programming lexicon?

2010-03-17 Thread David Nolen
On Wed, Mar 17, 2010 at 8:28 AM, Ben Armstrong wrote: > What I would like to have is some sort of lexicon to at least help explain > the terminology in a way that doesn't require three years of academic > exposure to functional programming to read. Is there such a reference? Or > should I just

Re: Simple functional programming lexicon?

2010-03-17 Thread David Nolen
On Wed, Mar 17, 2010 at 4:09 PM, Konrad Hinsen wrote: > On 17 Mar 2010, at 20:54, David Nolen wrote: > > But seriously, in my personal opinion Monads are relatively useless in the >> context of Clojure. >> > > I'd say that in any impure functional language, monad

Re: Translation from Common Lisp 1

2010-03-18 Thread David Nolen
On Thu, Mar 18, 2010 at 4:25 PM, alux wrote: > Hello! > > I much enjoyed reading the tutorial http://www.lisperati.com/casting.html > , mentioned by eyeris today. The most mind-extending thing (to me, > having Java background) is the, admittedly non-idiomatic, use of > symbols as data. > > But I

Re: clojure naming convention for accessors vs. local variables

2010-03-20 Thread David Nolen
On Sat, Mar 20, 2010 at 11:03 AM, strattonbrazil wrote: > Well, even in this case how do lisp programmers typically name their > structs vs their variables? In java I could make an "Employee" class > and then an "employee" object and it was easy to distinguish between > the two. If it's not kosh

Re: For loop question

2010-03-20 Thread David Nolen
On Sat, Mar 20, 2010 at 8:05 AM, WoodHacker wrote: > When I run the following: > >(for [y (range 4)] (for [x (range 4)] (println x y))) > > I get what I expect - 0 0, 1 0, 2 0, 3 0 etc., but at the end of > each y loop I also get 4 nils. > > ((0 0 > 1 0 > 2 0 > 3 0 > nil nil nil nil) (0 1 >

Re: Why I have chosen not to employ clojure

2010-03-21 Thread David Nolen
On Sun, Mar 21, 2010 at 9:12 PM, Antony Blakey wrote: > > On 22/03/2010, at 9:28 AM, e wrote: > > > And don't get me started on trying to get emacs or vi all hooked up on my > mac. I've never succeeded. > > I'm about to use Clojure commercially, but it's been a frustrating exercise > getting setu

Re: java vector canvas

2010-03-22 Thread David Nolen
On Mon, Mar 22, 2010 at 7:59 AM, Martin DeMello wrote: > A bit off topic, but I'm hoping someone here will know - is there a > vector canvas available for the jvm? I mean something like tk's > canvas, where you can draw vector objects that retain their own > identity, and can independently respond

Re: Nubie Question

2010-03-23 Thread David Nolen
On Tue, Mar 23, 2010 at 9:35 AM, WoodHacker wrote: > I understand how conj works.But how do you add a value to a > persistent vector?You have to add the new item to the vector with > (conj vector item), but how do you assign the return value to the > persistent vector. So far I have it

Re: Nubie Question

2010-03-24 Thread David Nolen
On Wed, Mar 24, 2010 at 5:43 PM, WoodHacker wrote: > Actually, swap! doesn't seem to work in my case.I should state > what I'm > trying to do.I'm writing a graphics editing program where I want > the user > to be able to choose and save color values. I start out with a > vector > contai

Re: Choosing a Clojure build tool

2010-03-26 Thread David Nolen
On Fri, Mar 26, 2010 at 7:33 AM, Chas Emerick wrote: > Now, it *would* be nice, when it's really called for, to be able to create > a maven plugin using clojure. The API is just a pile of interfaces, so it's > fundamentally the same as implementing any other Java API. As for having to > package

Re: towards definitive "getting started" assistance

2010-03-30 Thread David Nolen
Just a thought. Would it be more effective to create a GitHub page for this? Assembla is cool for ticketing but it's kinda ugly and unfriendly. For example I think something like this: http://mmcgrana.github.com/2010/03/clojure-web-development-ring.html is much friendlier and the kind of base-lev

Re: Getting started with open source Clojure projects

2010-03-31 Thread David Nolen
On Tue, Mar 30, 2010 at 10:26 PM, Daniel wrote: > Thanks for all the quick replies. I should've mentioned that I'm > already using leiningen, so the problem isn't so much getting the > dependencies and building the application as it is figuring out a way > to get inside the code and play with it

Re: Trying to set emacs for some clojure coding

2010-03-31 Thread David Nolen
Some accurate instructions here: http://www.assembla.com/wiki/show/clojure/Getting_Started_with_Emacs ? David -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new membe

How to return a number from a deftype method?

2010-04-02 Thread David Nolen
http://gist.github.com/353121 I'm unsure how to return a number. When I try to call the length-squared method of my vec2 instance I get a very strange exception. Any help or insight much appreciated. David -- You received this message because you are subscribed to the Google Groups "Clojure" gr

Re: How to return a number from a deftype method?

2010-04-02 Thread David Nolen
On Fri, Apr 2, 2010 at 10:48 AM, Konrad Hinsen wrote: > On 02.04.2010, at 15:48, David Nolen wrote: > > > http://gist.github.com/353121 > > > > I'm unsure how to return a number. When I try to call the length-squared > method of my vec2 instance I get a ver

Re: A syntax question: positional & keyword

2010-04-07 Thread David Nolen
The runtime cost of destructuring is not worth getting worked up about. It's easy to check this yourself with (time ...) David On Wednesday, April 7, 2010, Sophie wrote: > On Apr 6, 7:03 pm, ataggart wrote: >> See: >> >> http://richhickey.github.com/clojure-contrib/def-api.html#clojure.con... >

Re: A syntax question: positional & keyword

2010-04-08 Thread David Nolen
ones quite tedious. David On Thursday, April 8, 2010, Sophie wrote: > On Apr 7, 7:56 am, David Nolen wrote: >> The runtime cost of destructuring is not worth getting worked up >> about. It's easy to check this yourself with (time ...) > > Results below: > > user=&g

Simple macro hack for converting to fast primitive math

2010-04-13 Thread David Nolen
Recently I've been working on bits of code that require me to type in fairly long sequences of math operations. I found it tedious to convert these to type hinted binary operations so I've created the following truly simplistic macro: http://gist.github.com/364328 It lets you write things like th

Re: noob: call multimethod in a map?

2010-04-16 Thread David Nolen
On Fri, Apr 16, 2010 at 3:46 PM, Brian Wolf wrote: > Hi, Is it possible to call a multimethod in a map? In this simplified > example, I just want to increment every element of the array when the > multimethod is called (my real application is operating on sets of > hash tables ie database ) > >

Re: Has deftype changed?

2010-04-18 Thread David Nolen
On Sun, Apr 18, 2010 at 1:49 PM, Rob Lachlan wrote: > For deeftype, has the syntax for field accessors changed too? > > I can't get it to work: > > user> (deftype someType [b f]) > user.someType > user> (def y (new someType 2 3)) > #'user/y > user> (:b y) > nil > user> (:f y) > nil > > defrecord w

Re: Not so happy with my code

2010-04-18 Thread David Nolen
On Sun, Apr 18, 2010 at 9:20 PM, verec < jeanfrancois.brouil...@googlemail.com> wrote: > I have two problems with the following code. > First, I have this `tos' business (to-string) because: > user=> (first "abc") > \a > user=> (rest "abc") > (\b \c) > Since I wanted to get strings out of strings,

Re: deftype feature or bug?

2010-04-20 Thread David Nolen
On Tue, Apr 20, 2010 at 3:09 PM, Brenton wrote: > Hello group, > > I am working with edge Clojure and, as of today, noticed that > deftype's behavior has changed (which is expected as it is still > alpha). The version in question is: > > clojure-1.2.0-master-20100420.150114-37.jar > > Here is my

Re: Newbie: Finding performance bottlenecks

2010-04-23 Thread David Nolen
In your code you have: (defstruct body :id :type ; :projectile or :unit -> projectiles do not collide with other bodies; :current-position ; ref :current-cells ; ref :current-rotation ;atom :pixel-half-width :pixel-half-height :half-width :half-height :components) ; a map of (:co

Re: Testing equality

2010-04-28 Thread David Nolen
On Wed, Apr 28, 2010 at 9:30 AM, WoodHacker wrote: > Can someone explain to me why this doesn't work: > > (let [ p "Bill/" > sep (System/getProperty "file.separator") > ] > > (if (= (last p) sep) > (println "found separator") > (println "no separator

Re: what is wrong with (use `clojure.contrib.string) ?

2010-04-29 Thread David Nolen
On Fri, Apr 30, 2010 at 1:32 AM, gary ng wrote: > > > On Thu, Apr 29, 2010 at 9:11 PM, Meikel Brandmeyer wrote: > >> >> c.c.string is not designed to be used like that. Use require plus an >> alias: (require '[clojure.contrib.string :as s]). Then repeat is the >> core repeat and s/repeat is the

Re: Primitive arithmetic and mod

2010-05-03 Thread David Nolen
On Mon, May 3, 2010 at 4:21 PM, Brian Watkins wrote: > Any ideas about this? > > On May 2, 1:44 am, Brian Watkins wrote: > > I'm trying to speed up computing terms of a simple recurrence where > > the terms are computed modulo some value each iteration, > > > > (defn NF-mod-limit [p q limit] > >

Re: refs towards ref

2010-05-04 Thread David Nolen
On Tue, May 4, 2010 at 10:44 AM, Nicolas Oury wrote: > Dear all, > > I have a problem where a lot of concurrency could be gained by having > a tree of references. > ie a tree where each nodes contain a ref to a set of similar tree. > > (I know that having mutable trees is asking for troubles, but

Re: ?: promotion of integral types

2010-05-05 Thread David Nolen
On Wed, May 5, 2010 at 10:32 AM, Sean Devlin wrote: > And I was too quick to post. Sorry about that. > > You've got the unchecked addition fn for speed, and those are allowed > the throw overflow errors. The + fn is always supposed to work. The > fact that it auto-promotes the bound version is

Re: ?: promotion of integral types

2010-05-05 Thread David Nolen
On Wed, May 5, 2010 at 11:11 AM, Sean Devlin wrote: > I think there's a fundamental assumption that I disagree with. > > Since we've already opened the can of worms that is auto-promotion, it > should *always* work. Given auto-promotion, + shouldn't be fast (use > unchecked-add), it should be pre

Re: divide-n-conquer collections

2010-05-07 Thread David Nolen
On Wed, May 5, 2010 at 8:08 PM, Fabio Kaminski wrote: > im really a newcomer, and since i couldnt find this information anywhere.. > there we go :) > > how can i split a collection and later join a collection in clojure.. to > apply concurrent transversal patterns in collections, like a divide and

Re: Question about namespaces

2010-05-09 Thread David Nolen
If you just need to break up your code into smaller files another technique is: ; me/lib.clj (ns me.lib) (load "me/foo") (load "me/bar") ; me/foo.clj (in-ns 'me.lib) ; me/bar.clj (in-ns 'me.lib) On Sat, May 8, 2010 at 10:44 PM, Mark Engelberg wrote: > I've seen people say here that it's relati

Re: ANN: try clojure

2010-05-14 Thread David Nolen
Pretty cool. Been waiting for this. My main criticism is that it isn't very pretty :) Is there a github repo for it so people can fork it and play around with CSS? Also how difficult would it be to build a tutorial for it like the ones that http://tryhaskell.org and http://tryruby.org have? Would b

Re: Dynamic use of protocols

2010-05-16 Thread David Nolen
On Saturday, May 15, 2010, Mikhail Kryshen > set of extenders and implementing functions. This state (what > types currently implement the protocol and how) is what I really > want to be able to manipulate. The way it is tied to the protocol > definition and changed by the extend function seems to

Re: swank-clojure and GNU Emacs 23 - package.el install issues

2010-05-17 Thread David Nolen
I'm running into this issue as well. On Mon, May 17, 2010 at 4:18 PM, Terrence Brannon wrote: > Hello, I wanted to try out Clojure. It was my understanding that > swank-clojure was a package GNU Emacs that would download clojure > automatically. But the docs for it no longer say that. > > Anyway,

Re: functional check slower than imperative?

2010-05-18 Thread David Nolen
On Tue, May 18, 2010 at 10:18 AM, braver wrote: > I have a huge graph of the form > > {"john" {1 {"alice" 1, "bob" 3}, 4 {"alice" 2, "stan" 1}, "alice" {1 > {"john" 1, "mandy" 2}, 2 {"john" 3, "stan" 2}}} > > It shows for each user days on which he communicated, and for each > day, with whom and

Re: clojure date library

2010-05-24 Thread David Nolen
On Mon, May 24, 2010 at 1:53 PM, islon wrote: > I missed a date/time API in clojure so I made one myself. > Is it possible to put it in clojure.contrib? > Sugestions, critics and improvements are welcome. > > -> http://www.copypastecode.com/29707/ > > Islon > Have you looked at clj-time? http://

Re: core.match

2013-05-16 Thread David Nolen
On Thu, May 16, 2013 at 11:35 PM, Mark Engelberg wrote: > core.match has been alpha for about two years. > > I've been itching to use it in real projects for a long time, but with the > alpha status, I've been reluctant to trust that it has been vetted for > correctness. > > What aspects are preve

core.logic: Negation As Failure

2013-05-17 Thread David Nolen
I've finally got around to adding a negation as failure operator `nafc` to core.logic. The constraint framework has allowed this to be done while avoided the many pitfalls you might encounter with this operator in Prolog. You can now write things like the following: (run* [q] (membero q '(:a :b

Re: ClojureScript: spurious warning about symbol not being a protocol

2013-05-21 Thread David Nolen
Looks like a bug, please open a ticket in JIRA with the example code. Thanks! David On Tue, May 21, 2013 at 1:16 AM, Praki wrote: > Hi, > > For reasons I cant quite fathom, "lein cljsbuild" generates "Symbol X is > not a protocol" warning. I am using clojure 1.5.1 and cljsbuild 0.3.2. The > fo

Re: Has anyone here played with Wisp?

2013-05-25 Thread David Nolen
It's another interesting Lisp variant to JavaScript compiler but besides a surface like similarity, it doesn't really preserve many of Clojure's semantics (keyword behavior, data structures, immutability, notion of truth, protocols, multimethods, etc). David On Sat, May 25, 2013 at 1:59 AM, Rich

Re: Knowledge derivation in core.logic?

2013-05-25 Thread David Nolen
I think Nada Amin has already done something like this with the nominal feature and at least her version was quite simple. Best to ask this question on the miniKanren/core.logic mailing list - http://groups.google.com/forum/#!forum/minikanren David On Sat, May 25, 2013 at 8:44 PM, Adam Saleh wr

Re: The Reasoned Schemer chpt 4: "Please pass the aspirin"

2013-05-25 Thread David Nolen
+1 On Sat, May 25, 2013 at 8:12 PM, Austin Haas wrote: > > Hi Brian, > > You should post your question to the miniKanren Google group. > > minikan...@googlegroups.com > > -austin > > -- > Austin Haas > Pet Tomato, Inc. > http://pettomato.com > > > On Sat May 25 10:21 , Brian Craft wrote: > > Wo

Re: "I don't feel the absence of a debugger, because I've learnt enough that I don't ever need a debugger."

2013-05-27 Thread David Nolen
Doesn't ritz support nrepl? http://github.com/pallet/ritz On Mon, May 27, 2013 at 5:53 PM, Mark Engelberg wrote: > I would be a lot happier with the state of Clojure debugging if, in > addition to a stacktrace, I could easily explore the local variables in > play when an error was triggered. It

Re: GSOC Algebraic Expressions

2013-05-29 Thread David Nolen
A very cool of use of core.logic, look forward to seeing where it goes :) On Wed, May 29, 2013 at 11:10 AM, Maik Schünemann wrote: > Hello, > I am glad to announce that my proposal got accepted for google summer of > code. > I am doing the algebraic expression project idea which could lay the >

Re: Core Logic Reference Documentation

2013-05-29 Thread David Nolen
A core.logic cheatsheet would be a fantastic resource. I'd also welcome help in generating the basic doc pages. On Wed, May 29, 2013 at 1:08 PM, Benjamin Peter wrote: > Hello, > > I am currently trying to find my way to using clojure core logic, watching > some videos, reading tutorials and tryi

Re: Patching core.match

2013-05-29 Thread David Nolen
Good catch - please file a ticket here http://dev.clojure.org/jira/browse/MATCH. Please attach any work-in-progress patch you may have there and I'll review. Before I can apply any work you've done you need to send in your Contributor Agreement (CA) - http://clojure.org/contributing Thanks, David

Re: Patching core.match

2013-05-29 Thread David Nolen
request and fix/apply it when I've been added to the Clojure > contributors. > > > > On Wed, May 29, 2013 at 12:36 PM, David Nolen wrote: > >> Good catch - please file a ticket here >> http://dev.clojure.org/jira/browse/MATCH. Please attach any >> work-in-pro

Re: Future/Promise and not using threads

2013-05-30 Thread David Nolen
You might find this work in progress interesting then: http://github.com/clojure/core.async On Thu, May 30, 2013 at 3:46 PM, David Pollak wrote: > Paul, > > Thanks... but I want the opposite of delay. > > Basically, I do not want to consume a thread waiting for a Future to be > satisfied. I wan

Re: core.match -- adding extractors?

2013-06-04 Thread David Nolen
I've looked at extractors a little bit, but I would need to investigate further. Does this offer any more power than supporting arbitrary function application in patterns? Also, I'm unlikely to dive into any feature addition related issues until all these pressing bugs in JIRA are squashed. On T

Re: core.match -- adding extractors?

2013-06-04 Thread David Nolen
That said feel free to add an enhancement ticket. On Tue, Jun 4, 2013 at 5:12 PM, David Nolen wrote: > I've looked at extractors a little bit, but I would need to investigate > further. Does this offer any more power than supporting arbitrary function > application in patterns?

Re: clojurescript 0.0-1820 release is percolating

2013-06-07 Thread David Nolen
Fixes: - * variadic aset * CLJS-513: fix out bound behavior for vectors * CLJS-515: emit positional factories for deftype * IReduce for primitive arrays and lists Changes: - * CLJS-499: ObjMap deprecated in favor of PersistentArrayMap Enhancements: - * Added PersistentArrayMapSeq/KeyS

Re: David Nolen's logic programming readling list

2013-06-08 Thread David Nolen
I'll try to repost that list on my new blog, in the mean time: Art of Prolog Concepts Techniques and Models of Computer Programming Prolog Programming for Artificial Intelligence The Reasoned Schemer Are all all good starts. On Sat, Jun 8, 2013 at 9:27 AM, Craig Ching wrote: > I was looking f

Re: Clojure generates unnecessary and slow type-checks

2013-06-14 Thread David Nolen
Maybe this is an unintended side effect of the changes around unboxed support in loop/recur? On Thu, Jun 13, 2013 at 10:50 PM, Jason Wolfe wrote: > Taking a step back, the core problem we're trying to solve is just to sum > an array's values as quickly as in Java. (We really want to write a fan

ANN: core.match 0.2.0-beta2

2013-06-16 Thread David Nolen
At long last I've come around to overhauling core.match. Changes/Fixes/Enhancements are documented here: http://github.com/clojure/core.match/blob/master/CHANGES.md core.match should no longer have AOT issues as far as I know and many long outstanding bugs have been eliminated. The ClojureScript

Re: core.logic CLP(Set)

2013-06-18 Thread David Nolen
CLP(Set) has not been implemented yet. On Tue, Jun 18, 2013 at 2:36 AM, cig wrote: > Is CLP(Set) for core.logic available for use? > It does not seem like core.logic 0.8.3 contains this feature. > How should I access it if it is available? > > -- > -- > You received this message because you are

Re: core logic

2013-06-18 Thread David Nolen
e gone through some > documentation on github by David Nolen. I am now trying to solve this > problem: Anyone willing to do some practice can try and share the > solution. > > *SOLVE THIS PROBLEM.* > > *The Diplomats at Muthaiga Estate* > > The facts essential to solving the probl

Re: ANN: core.match 0.2.0-beta2

2013-06-18 Thread David Nolen
On Mon, Jun 17, 2013 at 1:04 AM, David Nolen wrote: > At long last I've come around to overhauling core.match. > > Changes/Fixes/Enhancements are documented here: > http://github.com/clojure/core.match/blob/master/CHANGES.md > > core.match should no longer have AOT issues as

Re: core.logic CLP(Set)

2013-06-18 Thread David Nolen
No that was to illustrate an idealized solution not working code. On Tue, Jun 18, 2013 at 1:47 PM, cig wrote: > Hi David > > Did you not make use of it for solving this puzzle? > > https://gist.github.com/swannodette/5127150 > > > On Tuesday, 18 June 2013 13:38:48

Re: Why does peek on a seq of vector fail?

2013-06-20 Thread David Nolen
Calling seq on vector returns a sequence which is no longer a vector. The docstring is pretty specific about which types it's supposed to work on. clojure.core/peek ([coll]) For a list or queue, same as first, for a vector, same as, but much more efficient than, last. If the collection is empt

Re: (clojure 1.5.1) Weird performance results when using let versus def for variable

2013-06-21 Thread David Nolen
Using `def` like that is simply incorrect. `def` should always be at the top level unlike say Scheme. I would first remove all internal defs and then rerun your benchmarks. On Fri, Jun 21, 2013 at 8:36 AM, Colin Yates wrote: > Hi all, > > I am doing some (naive and trivial) performance tests b

<    1   2   3   4   5   6   7   8   9   10   >