Re: Persistent Data Structures for Objective-C/LLVM

2013-03-31 Thread Matthias Benkard
I implemented persistent, array-mapped Patricia trees in C a while ago: https://matthias.benkard.de/journal/118 It should be relatively straight-forward to build some Objective-C classes on top of that. (There's a reason the memory management routines are named bpt_{retain, release, deallo

Re: printing and reading functions

2013-03-03 Thread Matthias Benkard
Hi, Something like this? (let [f assoc] (first (filter (fn [v] (identical? @v f)) (map second (mapcat ns-publics (all-ns)) Or even this? (let [f assoc] (first (mapcat #(filter (fn [[ns [sym v]]] (identical? @v f)) %) (map (

Re: Protocol methods, name shadowing and dot notation

2012-09-03 Thread Matthias Benkard
You have reused a name already bound in the `protocols` namespace. You cannot bind two things to the same var. On the other hand, precisely because namespaces are not complected with protocol dispatch, you can easily free the `get` identifier for your purposes by doing exactly what you would do

Re: Protocol methods, name shadowing and dot notation

2012-09-03 Thread Matthias Benkard
Hi, In principle, dispatch is orthogonal to namespacing. It is true that traditional OO systems complect these two things, but there is no inherent need to do so. Separating dispatch (i.e., methods) from namespacing is simpler and more flexible. This is especially useful when you have multip

Re: Clojure for Cocoa

2012-01-28 Thread Matthias Benkard
Hi, On Jan 27, 4:20 am, Cedric Greevey wrote: > One thing that must help there is that the functional nature of > Clojure makes it pretty rare for Clojure code to produce a true > reference circularity. That's probably true. Reference counting is a good fit for tree- shaped data. Cycles formed

Re: Clojure for Cocoa

2012-01-26 Thread Matthias Benkard
Hi! Am 25.01.12 15:43, schrieb D.Theisen: > How did you handle the reference counting vs. Garbage Collection > chasm? I punted on it. GNUstep already had GC support at the time, and it was upcoming on Mac OS X. I didn't foresee the restrictions imposed by iOS. :) I did consider integrating Boe

Re: Clojure for Cocoa

2012-01-23 Thread Matthias Benkard
Hi, David Nolen schrieb: > * F-Script > * JSCocoa > * Clozure CL > * MacRuby Also, * Toilet Lisp. Git repo: https://matthias.benkard.de/code/toilet.git Toilet Lisp is an incomplete implementation of Common Lisp hosted on the Objective-C runtime. It includes both an interpreter and an LLVM- ba

Re: Clojure/EPL and the GPL

2009-08-28 Thread Matthias Benkard
On 28 Aug., 13:42, Tassilo Horn wrote: > I have a licensing question.  Am I allowed to include clojure.jar in a > GPL project? IANAL, but if I understand the GPL correctly, it prohibits you from distributing a GPL-covered programme that is based on Clojure, because it would need to be linked to

Qt Jambi and the REPL, Episode II: Hacking SLIME for Fun and Profit

2009-03-09 Thread Matthias Benkard
After reading a bit of stuff here and there about Swing and Qt Jambi, I've recently started tinkering with the latter. Unfortunately, I pretty quickly grew frustrated with the need to call out to QCoreApplication/invokeAndWait every single time I wanted to change a part of the GUI from the REPL o

Re: Getting a flat sequence from a map (and vice versa)

2008-11-15 Thread Matthias Benkard
On 15 Nov., 05:17, samppi <[EMAIL PROTECTED]> wrote: > Fold isn't build into Clojure Isn't fold just clojure/reduce? Matthias --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, s

Re: Newbie question: Can a collection contain itself?

2008-11-15 Thread Matthias Benkard
On 15 Nov., 00:31, samppi <[EMAIL PROTECTED]> wrote: > Yeah, I surmised as much. The thing is, I'm writing a YAML library in > Clojure, and YAML allows circular recursion like that: > >   --- >   &x >   - 3 >   - 2 >   - 1 >   - *x > > ...So I'm wondering what I should do if a document like that w

Re: prog1

2008-11-08 Thread Matthias Benkard
On 8 Nov., 20:24, Phlex <[EMAIL PROTECTED]> wrote: > There must be some reason for CL to have it as a macro > (call-argument-limit perhaps ?) I don't know, but I suspect it might be matter of aesthetics. In CL, PROGN can't be a function for various reasons (off the top of my head: multiple-value

Re: Concerned about Clojure's license choice.

2008-11-05 Thread Matthias Benkard
On Nov 5, 3:33 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Are you sure? You're not modifying the clojure source, so you're not > creating a derivative work. I would think you can create a GPL > licensed library in that case. I can, but noone else will be allowed to redistribute it or wo

Re: Concerned about Clojure's license choice.

2008-11-04 Thread Matthias Benkard
On Nov 4, 5:51 pm, Alec Berryman <[EMAIL PROTECTED]> wrote: > I looked into writing an application in Clojure that 1) uses > libraries licensed under the GPL with the classpath exception and 2) is > licensed under the GPL itself.  I concluded that 1 is OK, and that 2 > works, as long as you have a

Re: Concerned about Clojure's license choice.

2008-11-04 Thread Matthias Benkard
On Nov 4, 6:12 pm, Rich Hickey <[EMAIL PROTECTED]> wrote: > > The CPL doesn't allow me to choose the GPL. > > You've got this completely backwards - the GPL doesn't allow you to   > combine with certain things, whereas the CPL is fine with it. I know that, but the fact is, the GPL has been widely

Re: Concerned about Clojure's license choice.

2008-11-04 Thread Matthias Benkard
On Nov 4, 1:35 pm, Rich Hickey <[EMAIL PROTECTED]> wrote: > So far, you are only the third person to complain about lack of GPL > compatibility. For the sake of balance, I _am_ actually concerned about the CPL because it effectively denies developers the freedom to be politically unneutral. Let'

Re: Swing GUI Builder and Clojure

2008-11-04 Thread Matthias Benkard
On Nov 4, 6:11 pm, Matthias Benkard <[EMAIL PROTECTED]> wrote: > Its free license is incompatible with Clojure's, though, so you'd need > to buy a commercial license, right? > > Matthias Oh, I'm wrong! That's nice. :) http://doc.trolltech.com/4.4

Re: Swing GUI Builder and Clojure

2008-11-04 Thread Matthias Benkard
On Nov 4, 4:26 pm, Chouser <[EMAIL PROTECTED]> wrote: > One possible approach is with Qt Jambi.  They have a nice GUI builder > called "designer" that generates an xml file that can be loaded at > runtime. Its free license is incompatible with Clojure's, though, so you'd need to buy a commercial

Re: Concerned about Clojure's license choice.

2008-11-03 Thread Matthias Benkard
On Nov 3, 7:59 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I'm not advocating the GPL...only a GPL compatible license. Regarding > the benefits to a dual license or reclicense, are you sure there > *aren't* benefits? If it is easy to move to GPL compatibility, then > is it worth worryin

Re: Concerned about Clojure's license choice.

2008-11-02 Thread Matthias Benkard
> I would hate to see clojure adopting the GPL. Certainly, something compatible with the GPL wouldn't have to be the GPL itself. (This doesn't mean I'd like to see Clojure's license changed. Just wanted to clarify things.) Matthias --~--~-~--~~~---~--~~ You rece

Re: problems with slime and emacs

2008-10-31 Thread Matthias Benkard
Hi, > I'm sure it's something trivial that I'm missing. I'm not so sure. > (require 'swank-clojure-autoload) > (swank-clojure-config >  (setq swank-clojure-jar-path "/Users/clk/Documents/Development/ > Languages/lisp/clojure_20080916/clojure.jar") >  (setq swank-clojure-extra-classpaths (list "

Re: Data types in Clojure

2008-10-22 Thread Matthias Benkard
Hi, > But assume I wanto to provide two implementations for such an > interface, in two separate namespaces. Personally, I'd define multimethods as the “interface“, in a single namespace, and implement them for any set of data structures that I wanted to support. At least, this is the CLOS way,

Re: Event Listeners in Functional Programming

2008-10-12 Thread Matthias Benkard
Hi, there are some papers about “functional reactive programming” out there, which you might find interesting. FranTk [0] and, developed more recently, Grapefruit [1], are functional reactive GUI toolkit for Haskell, for example. On the other hand, Gtk2Hs [2], probably the most popular GUI fram