Re: Why don't extends? and satisfies? require implementation of all protocol methods?

2012-03-08 Thread Garth Sheldon-Coulson
I think Tassilo's ideas about extenders deserve more discussion. But let me continue the discussion with Armando for now. Thank you for offering the Eclipse API example, which is very helpful. I agree that Java's OO paradigm creates the need for abstract classes. However, I would like to look f

Re: Why don't extends? and satisfies? require implementation of all protocol methods?

2012-03-07 Thread Garth Sheldon-Coulson
ies? and extends? from checking whether methods are implemented? -- Could it be that deftype/defrecord's behavior is just a bug? I notice that (doc deftype) provides, "Methods should be supplied for all methods of the desired protocol(s) and interface(s)." All the best, Garth Sheldo

Why don't extends? and satisfies? require implementation of all protocol methods?

2012-03-06 Thread Garth Sheldon-Coulson
ll. Yet: user=> (extenders Bashable) nil Thank you. All the best, Garth Sheldon-Coulson -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are mo

Re: evaluation of a function via mathematica from clojure using the clojuratica bridge...

2010-10-07 Thread Garth Sheldon-Coulson
Sorry, the Needs call isn't quite right. Do this instead: << ClojurianScopes` Garth On Fri, Oct 8, 2010 at 12:23 AM, Garth Sheldon-Coulson wrote: > Hi Sunil, > > Double check that you have the .m files from the Clojuratica distribution > in your Mathematica $Path

Re: evaluation of a function via mathematica from clojure using the clojuratica bridge...

2010-10-07 Thread Garth Sheldon-Coulson
Hi Sunil, Double check that you have the .m files from the Clojuratica distribution in your Mathematica $Path. The error message you received makes me think that the file ClojurianScopes.m is not being properly loaded by Mathematica/Clojuratica. You can check this by firing up Mathematica and cal

Re: Life on the bleeding edge

2010-06-27 Thread Garth Sheldon-Coulson
Ah, thanks. I also see no test failures (archlinux). On Sun, Jun 27, 2010 at 11:31 PM, Michał Marczyk wrote: > On 28 June 2010 05:11, Garth Sheldon-Coulson wrote: > > When I try to compile clojure-contrib with the equiv branch on archlinux, > > maven 2.2.1, jre 1.6.0_20, I get:

Re: Life on the bleeding edge

2010-06-27 Thread Garth Sheldon-Coulson
When I try to compile clojure-contrib with the equiv branch on archlinux, maven 2.2.1, jre 1.6.0_20, I get: Compiling clojure.contrib.condition.Condition to /mnt/hgfs/sirfoobar/Documents/Eclipse/clojure-contrib/target/classes Exception in thread "main" java.lang.NoClassDefFoundError: clojure/lang/

Re: Drawable Sets

2010-06-27 Thread Garth Sheldon-Coulson
> > I think you can solve the holes on delete by permuting the removed element > with the last element and keeping a map from value to their index. > Good idea! Thanks you very much for these suggestions. > You're welcome. The hashtrie is a much better idea for this situation, of course. Couldn

Re: Drawable Sets

2010-06-26 Thread Garth Sheldon-Coulson
, Garth Sheldon-Coulson wrote: > Well, my idea involves rejection sampling. In order to sample an element > from the set in a mass-weighted fashion, you can sample an element in a > uniform fashion and then reject the sample with a certain probability (more > below). If you do rejec

Re: Drawable Sets

2010-06-26 Thread Garth Sheldon-Coulson
pply pcalls (repeat f))) to get an acceptance. I hope this helps. Definitely you should double-check my reasoning =). Garth On Sat, Jun 26, 2010 at 3:24 PM, Nicolas Oury wrote: > Insertion and deletions. But I would like to hear your idea anyway. > Always good to hear ideas :) > > &g

Re: Drawable Sets

2010-06-26 Thread Garth Sheldon-Coulson
Are there going to be a lot of deletions from the set? Or mostly insertions? If it's mostly insertions (or if it's just a static data structure that stays the same once built) then I think I can help. On Sat, Jun 26, 2010 at 9:01 AM, Nicolas Oury wrote: > Dear all, > > for a project, I need a da

Re: Enhanced primitive support - redux

2010-06-25 Thread Garth Sheldon-Coulson
> I should have said "they shouldn't be equal" based on Rich Hickey's > explanation that from now on (= 1 1.0) will return false. I think by > this logic (= 1.0M 1.0) should also be false. I have no idea what the > current branch actually does though -- haven't tried it yet. > > Ah, yeah, fair en

Re: Enhanced primitive support - redux

2010-06-25 Thread Garth Sheldon-Coulson
Zeros 434343.0M)) ;shouldn't = default to this? true Garth On Fri, Jun 25, 2010 at 4:18 PM, Garth Sheldon-Coulson wrote: > This looks excellent. > > I'd like to re-raise a question I had a few days ago: Will this ultimately > come to affect floats, too? > > In partic

Re: Enhanced primitive support - redux

2010-06-25 Thread Garth Sheldon-Coulson
This looks excellent. I'd like to re-raise a question I had a few days ago: Will this ultimately come to affect floats, too? In particular: 1) If there is going to be BigInt contagion, why not BigDecimal contagion? user=> (* 4 5) 20 user=> (* 4 5N) 20N but user=> (* 4.0 5.0) 20.0 user=> (* 4.

Re: Enhanced Primitive Support

2010-06-22 Thread Garth Sheldon-Coulson
I'm just one voice on the side that's been advocating for auto-promotion by default. For what it's worth, I completely see where the other side is coming from, and if Rich sees primitive math by default as important to Clojure's future, then so be it. It sounds like he's given it a lot of though an

Re: Enhanced Primitive Support

2010-06-22 Thread Garth Sheldon-Coulson
> Everyone has to realize the math you are advocating for the default, on > non-tagged architectures like the JVM and CLR, *must* do an allocation on > every +/-/* etc operation. And such ops are littered throughout non-numeric > data structure code, for indexes, offsets, bounds etc. Allocating on

Re: Enhanced Primitive Support

2010-06-22 Thread Garth Sheldon-Coulson
To me, numbers are an abstraction, just as sequences are an abstraction. Because Clojure treats sequences as abstractions, I can say (partition 3 (set '(1 2 3 4 5 6))) without Clojure complaining that sets are not the kind of thing that can be efficiently partitioned. Sets are seqable, so they can

Re: Enhanced Primitive Support

2010-06-20 Thread Garth Sheldon-Coulson
Yes, you're right. I wasn't suggesting that someone without an understanding of static types in general or Java types in particular would be liable to write *unsafe* code. I was saying that he or she might be prone to writing code that produces runtime exceptions, and that these exceptions might no

Re: Enhanced Primitive Support

2010-06-20 Thread Garth Sheldon-Coulson
Like Luke, I have been reading this thread with interest. For what it's worth, I'm in basic agreement with him. I might take it a step further. I don't think anyone should have to think about boxing and primitives when writing standard idiomatic code -- code that uses +, *, loop, and recur. The jo

Re: Enhanced Primitive Support

2010-06-19 Thread Garth Sheldon-Coulson
Do any of the proposals on the table affect floating point math? Currently, it seems mildly inconsistent to me that Clojure's numeric operations are auto-promoting and arbitrary-precision for integers but not for floats unless you specifically request it with the M suffix. This probably matters on

Re: Coordinated, asynchronous modification of state?

2010-04-21 Thread Garth Sheldon-Coulson
on of state? Or is it a pick-two situation? Thanks, Garth On Wed, Apr 21, 2010 at 11:29 AM, Garth Sheldon-Coulson wrote: > Hi All, > > This e-mail is the product of some musing about refs, agents, and atoms. I > would like to offer some thoughts on a possible fourth reference type that >

Coordinated, asynchronous modification of state?

2010-04-21 Thread Garth Sheldon-Coulson
Hi All, This e-mail is the product of some musing about refs, agents, and atoms. I would like to offer some thoughts on a possible fourth reference type that allows coordinated, asynchronous modification of state. I would greatly appreciate comments from the community. Maybe some of these ideas h

Re: take-to-first & partition-when

2010-03-17 Thread Garth Sheldon-Coulson
Hi Greg, Welcome to Clojure! I haven't scrutinized your code, but at a glance it looks like your implementations are very idiomatic. It also seems right to me that these functions can't be implemented directly in terms of take-while and partition-by. Without more thought I can't say if there are

Re: Name suggestions

2010-03-17 Thread Garth Sheldon-Coulson
I suggest prawn. Garth 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. >

Re: Long-running STM updates will never complete... is there a solution?

2010-03-15 Thread Garth Sheldon-Coulson
read-lock-grabbing behavior of ensure should be replied > upon, I can't say, though I'm inclined to no more rely on that than I > am on the barging logic. Rich's input would be valuable here. > > > On Mar 15, 3:24 pm, Garth Sheldon-Coulson wrote: >> I would be h

Re: Long-running STM updates will never complete... is there a solution?

2010-03-15 Thread Garth Sheldon-Coulson
ref.lock.readLock().unlock(); > > if(refinfo != info) //not us, ensure is doomed > { > blockAndBail(refinfo); > } > } > else > ensures.add(ref); > } > > As for different constructs, th

Re: Long-running STM updates will never complete... is there a solution?

2010-03-15 Thread Garth Sheldon-Coulson
Well it definitely seems that ensure has the behavior Michal described, because the ensure code I posted works. I'm glad this behavior is available, because I don't think there is any other way to achieve the combination of synchronization and locking I need. (I couldn't get locking to work on a re

Re: Long-running STM updates will never complete... is there a solution?

2010-03-15 Thread Garth Sheldon-Coulson
Ah, maybe I should have read the thread on ensure before I posted this! =) (dosync (ensure r) (alter r f)) works. On Mon, Mar 15, 2010 at 1:10 PM, Garth Sheldon-Coulson wrote: > Apologies in advance if this question has a simple answer that I'm > overlooking! > > Suppose I h

Long-running STM updates will never complete... is there a solution?

2010-03-15 Thread Garth Sheldon-Coulson
Apologies in advance if this question has a simple answer that I'm overlooking! Suppose I have a ref or atom and I periodically need to call a long-running function on it: (def r (ref 0)) (defn f [_] (Thread/sleep 1000) -10) Suppose also that the ref is being modified from other threads at short

Re: German Clojure Book

2010-03-11 Thread Garth Sheldon-Coulson
I agree that the cover is really beautiful. Let us know when your daughter has pieces on exhibit =). Good luck with the writing! On Thu, Mar 11, 2010 at 8:08 PM, Angel Java Lopez wrote: > Great! > > I thought the cover was a Bratko, as in other Lisp book > > Angel "Java" Lopez > http://www.aj

Re: group tag for clojure newsgroup

2010-03-04 Thread Garth Sheldon-Coulson
Sorry, made a mistake. List-ID header contains clojure.googlegroups.com Mailing-list header contains clojure@googlegroups.com Note the @. On Thu, Mar 4, 2010 at 12:06 PM, Garth Sheldon-Coulson wrote: > Hi Tim, > > I just downloaded Thunderbird to take a look, and I haven't test

Re: group tag for clojure newsgroup

2010-03-04 Thread Garth Sheldon-Coulson
way to filter emails by list-id in thunderbird > I will withdraw the suggestion. > > Tim > > > Garth Sheldon-Coulson wrote: > >> I agree that this would obstruct the subject line needlessly, a >> particularly inconvenient thing for anyone who (like me) often reads &g

Re: group tag for clojure newsgroup

2010-03-04 Thread Garth Sheldon-Coulson
I agree that this would obstruct the subject line needlessly, a particularly inconvenient thing for anyone who (like me) often reads list emails on devices with very small screens. The list is high-volume enough that I suspect the vast majority of readers filter list emails away from their main in

Re: What is a form, exactly? + Are there any guarantees about the return types of quote and syntax-quote?

2010-02-16 Thread Garth Sheldon-Coulson
at 3:40 PM, Meikel Brandmeyer wrote: > Hi, > > On Sun, Feb 14, 2010 at 08:58:56PM -0500, Garth Sheldon-Coulson wrote: > > > (Revised version: What characterizes an expression? Is it correct to say > > that an expression is always something for which seq? returns true and &g

Re: What is a form, exactly? + Are there any guarantees about the return types of quote and syntax-quote?

2010-02-14 Thread Garth Sheldon-Coulson
re they quote a form demarcated by parens. I would still like to know whether there is anything certain about the types returned by quote and syntax-quote when they are called on a paren-demacated form. Thanks. Garth On Sun, Feb 14, 2010 at 8:31 PM, Michał Marczyk wrote: > On 15 February 20

What is a form, exactly? + Are there any guarantees about the return types of quote and syntax-quote?

2010-02-14 Thread Garth Sheldon-Coulson
Hi Everyone, The set of classes for which seq? returns true is rather large. It contains Cons, LazySeq, PersistentList, and many others. Experimentation reveals that any of these types can be used to hold Clojure code for evaluation by eval. Is a form just anything for which seq? returns true, by

Re: Which do you prefer, expressing points in {:x 0, :y 0} or [0 0]?

2010-02-12 Thread Garth Sheldon-Coulson
I have confronted a similar question in the past when deciding how to label the dimensions of vectors and multidimensional arrays. My tentative conclusion is that it's best to use raw vectors. => (def v [40 41 42]) #'user/v If you need human-readable labels, build a separate index with constant

Re: Seattle Clojure meeting

2010-02-12 Thread Garth Sheldon-Coulson
It's great to hear the Seattle event was such a success! Mark, I agree that a Boston-area meet-up would be fun. If someone is interested in spearheading, I would be happy to support in any way I can. On Fri, Feb 12, 2010 at 7:58 AM, Mark Tomko wrote: > Oh, man. I just moved from Seattle to Bost

Re: Clojure Conference Poll

2010-01-24 Thread Garth Sheldon-Coulson
+1 to Boston/NY/DC/Bay Area in that order On Sun, Jan 24, 2010 at 3:44 AM, Chad Harrington wrote: > - Friday / Saturday > - SF Bay Area > Chad Harrington > chad.harring...@gmail.com > > > On Fri, Jan 22, 2010 at 9:36 AM, dysinger wrote: >> >> We will be organizing a conference in the next month

ClojureCLR + Silverlight

2010-01-07 Thread Garth Sheldon-Coulson
Hi All, Does anyone know if ClojureCLR runs or could run on the Silverlight CLR? Can one use ClojureCLR to build Silverlight applications? I am as new as one can be to the .NET/CLR world, but the combination seems promising for an application I am planning to work on. Garth -- You received this

Re: Clojure newbie question regarding compile time type checking.

2009-12-15 Thread Garth Sheldon-Coulson
OTOH, when Rich gave a talk at MIT recently he mentioned he wasn't terribly interested in type systems for Clojure apart from (potentially) a simple binary type system to distinguish I/O-side-effecty things from non-I/O-side-effecty things. He also mentioned something extremely interesting about wa

Re: struct-maps and key removal

2009-12-15 Thread Garth Sheldon-Coulson
I wonder if the fact that this currently doesn't work the way you want it to is a necessary consequence of structural sharing and the desired performance guarantees of dissoc. In other words: I wonder if, on account of how struct maps are implemented (sort of like a vector, right?), the only way t

Re: Fine-grained locals clearing

2009-12-10 Thread Garth Sheldon-Coulson
Rockin'. On Thu, Dec 10, 2009 at 9:10 AM, Rich Hickey wrote: > One of the objectives of Clojure is to reduce incidental complexity. > And one of the biggest sources of incidental complexity in Clojure was > the retention of the head of a lazy sequence due to its being > referenced by some local

Re: new API webpage format

2009-12-07 Thread Garth Sheldon-Coulson
inc Thanks for the hard work. On 12/7/09, ataggart wrote: > While we're throwing requests at Tom, it'd be nice if the special > forms were included in the api. > > On Dec 7, 5:21 pm, Tom Faulhaber wrote: >> Yup, I heard that the first time :-) >> >> It's coming, but not right this sec. >> >> To

Re: Flightcaster makes a couple big open source contributions

2009-12-05 Thread Garth Sheldon-Coulson
This is terrific. Thanks for releasing them! Really looking forward to taking a look. On Thu, Dec 3, 2009 at 3:38 PM, bradford cross wrote: > We're really excited about the way the merge has turned out and the rapid > progress we expect for the next several months! > > > On Thu, Dec 3, 2009 at 12

Re: Clojure Scoping Rules

2009-11-24 Thread Garth Sheldon-Coulson
fn or equivalent. On 11/24/09, Mark Engelberg wrote: > On Mon, Nov 23, 2009 at 11:39 PM, Garth Sheldon-Coulson > wrote: >> Hi Mark, >> >> In Clojuratica I make what I think is "good, clean, compelling use" of >> dynamic vars. I rewrote the code to use dynamic

Re: Clojure Scoping Rules

2009-11-23 Thread Garth Sheldon-Coulson
Hi Mark, In Clojuratica I make what I think is "good, clean, compelling use" of dynamic vars. I rewrote the code to use dynamic vars after I found that doing it the other way became unwieldy and inelegant. To simplify a little, the API consists of just one main function, let's call it math-evalua

The specificity of bound-fn: capturing specific dynamic vars

2009-11-23 Thread Garth Sheldon-Coulson
Meikel and All, On the general topic of the recent posts on the "Clojure Scoping Rules" thread: bound-fn is very nice, but I've found that capturing *all* dynamic vars is often overkill. In fact, I would argue (subject to persuasion otherwise) that capturing all dynamic vars should be the very r

Re: Holding onto your head & step functions -- confusion

2009-11-23 Thread Garth Sheldon-Coulson
n Sun, Nov 22, 2009 at 6:06 PM, Garth Sheldon-Coulson wrote: > Hi All, > > I'll confused about the hold-onto-your-head business when building lazy > seqs using lazy-seq. > > The "lazier" documentation on the web site doesn't really clear things up > for me,

Holding onto your head & step functions -- confusion

2009-11-22 Thread Garth Sheldon-Coulson
Hi All, I'll confused about the hold-onto-your-head business when building lazy seqs using lazy-seq. The "lazier" documentation on the web site doesn't really clear things up for me, though I've read it a few times. Under what circumstances must one use a "step" function, and under what circumst

Re: ANN: Clojuratica v2 -- Seamless Mathematica-within-Clojure!

2009-11-20 Thread Garth Sheldon-Coulson
P.S. I have been told that Clojuratica works with the free Mathematica Player. I haven't tried this myself. On Fri, Nov 20, 2009 at 5:57 PM, Garth Sheldon-Coulson wrote: > Dear Clojurians, > > I am very happy to announce Clojuratica version 2. > > Clojuratica now of

ANN: Clojuratica v2 -- Seamless Mathematica-within-Clojure!

2009-11-20 Thread Garth Sheldon-Coulson
for the time being. I would appreciate suggestions and bug reports. I plan to make the integration work in the opposite direction when I have time. It might be a while! The Clojure-in-Mathematica integration that was available in version 1 has been removed for now. I encourage you to read the tuto

Re: Is it time to move the mailing list off of Google Groups?

2009-10-29 Thread Garth Sheldon-Coulson
+1 On Wed, Oct 28, 2009 at 4:47 PM, Michael Wood wrote: > > 2009/10/28 Kyle Schaffrick : > > > > Don't forget those of us who dislike web-forum software and prefer to > > interact with the group via email: I very seldom use the GG site itself. > > I find threaded email is a *very* good way of fo

Re: Scientific computing

2009-10-26 Thread Garth Sheldon-Coulson
I imagine you'll be better off with the flexibility and ease of nested vectors unless you have very specific performance needs (e.g. you need to pass the arrays frequently to third-party libraries that accept Java arrays, or for performance reasons you want to mutate them in place using amap etc.)

Re: Scientific computing

2009-10-23 Thread Garth Sheldon-Coulson
Hi Rock, Clojure isn't designed as an array processing language, so it doesn't have multidimensional array-slicing or matrix algebra tools built in. That's just not what Clojure's trying to be, and you're right, immutable data structures might get in the way. There's probably nothing stopping you

Re: JVM Language Summit talk on state, identity, time

2009-10-18 Thread Garth Sheldon-Coulson
7;has it right'] > > > On Oct 17, 7:58 am, Garth Sheldon-Coulson wrote: > > In his blog post Rich mentioned his JVM Language Summit talkhttp:// > wiki.jvmlangsummit.com/Clojure_Keynote > > on state, identity, value, time, etc. > > > > There are notes and s

JVM Language Summit talk on state, identity, time

2009-10-16 Thread Garth Sheldon-Coulson
In his blog post Rich mentioned his JVM Language Summit talk http://wiki.jvmlangsummit.com/Clojure_Keynote on state, identity, value, time, etc. There are notes and slides on the site, but no audio or video. Does anyone know if audio or video was recorded, or (if Rich is reading this) if there ar

Re: Help locating library for docstring, attr-map parsing in macros

2009-10-16 Thread Garth Sheldon-Coulson
Yes, thanks! On Fri, Oct 16, 2009 at 9:48 AM, James Reeves wrote: > > Could you be thinking of clojure.contrib.def/name-with-attributes ? > > On Oct 16, 1:20 pm, Garth Sheldon-Coulson wrote: > > Hi All, > > > > The other day when browsing the web I came across a l

Help locating library for docstring, attr-map parsing in macros

2009-10-16 Thread Garth Sheldon-Coulson
Hi All, The other day when browsing the web I came across a library that I can't locate anymore. The library is an aid for macro-writing. It automates the simple but annoying task of parsing optional attr-maps and docstrings for passing to defn, etc. Could someone jog my memory as to who wrote i

locking semantics: queue for the monitor?

2009-10-15 Thread Garth Sheldon-Coulson
Hi All, If multiple threads are competing for the monitor of an object using (locking obj ... ), is it a strict queue for the monitor (first in, first lock) similar to send and send-off? Or are there other considerations? I would probably know this if I knew more about Java sync, but quick web/gr

Re: Par branch question for Rich

2009-10-14 Thread Garth Sheldon-Coulson
Ah, that would make sense. Thanks. 2009/10/14 gerryxiao > > Garth, > Par branch is based openjdk 7 fork/jion lib which is not finished yet, > > It will be merged after openjdk7 has been released, i think > > Regards, > > gerry > > On 10月14日, 下午6时06分, Garth Sh

Re: Flags, binding, and laziness, oh my!

2009-10-14 Thread Garth Sheldon-Coulson
OK, thanks Meikel. On Wed, Oct 14, 2009 at 5:24 AM, Meikel Brandmeyer wrote: > > Hi, > > On Oct 14, 10:59 am, Garth Sheldon-Coulson wrote: > > > Finally, am I right that another reason to use explicit arguments, not > > dynamic binding, to pass the options i

Par branch question for Rich

2009-10-14 Thread Garth Sheldon-Coulson
Hi Rich, I've started using pvmap for some intensive vector operations and it's terrific. For small operations over large vectors I'm seeing a sizable speedup even on my piddly dual-core. It looks like the par branch is a ways behind master. What's the timeline for merging it in? Are you waiting

Re: Flags, binding, and laziness, oh my!

2009-10-14 Thread Garth Sheldon-Coulson
, 2009 at 4:30 AM, Garth Sheldon-Coulson wrote: > > > On Wed, Oct 14, 2009 at 4:07 AM, Meikel Brandmeyer wrote: > >> >> Hi, >> >> On Oct 14, 9:45 am, Garth Sheldon-Coulson wrote: >> >> > (In this parser I also have a non-stack-blowing version of

Re: Flags, binding, and laziness, oh my!

2009-10-14 Thread Garth Sheldon-Coulson
On Wed, Oct 14, 2009 at 4:07 AM, Meikel Brandmeyer wrote: > > Hi, > > On Oct 14, 9:45 am, Garth Sheldon-Coulson wrote: > > > (In this parser I also have a non-stack-blowing version of the parser for > > deep data structures, which you Meikel suggested a couple week

Re: Flags, binding, and laziness, oh my!

2009-10-14 Thread Garth Sheldon-Coulson
John: The options do effectively change once outside the dynamic scope because there are default options. If the lazy-seq is evaluated outside the dynamic scope it will use these default options. Within the dynamic scope it will use the bound options. I'm considering giving up laziness, but the s

Flags, binding, and laziness, oh my!

2009-10-13 Thread Garth Sheldon-Coulson
Hi All, I'm looking for general advice on using dynamic bindings to store flags/options that users pass to my code. a) Should I use dynamic bindings for this purpose? (elaboration on "this purpose" below...) b) If I do, how might the new macros I've been hearing about (with-bindings, bound-fn) al

Re: Dynamically building and evaluating s-expressions from Java

2009-10-12 Thread Garth Sheldon-Coulson
()ing them. On Mon, Oct 12, 2009 at 6:42 PM, John Harrop wrote: > On Mon, Oct 12, 2009 at 5:10 PM, Garth Sheldon-Coulson < > garth.sheldoncoul...@gmail.com> wrote: > >> Rich wrote somewhere that he wanted to make it possible for Java >> applications to build Clojure s-e

Re: Dynamically building and evaluating s-expressions from Java

2009-10-12 Thread Garth Sheldon-Coulson
10 PM, Garth Sheldon-Coulson < garth.sheldoncoul...@gmail.com> wrote: > Rich wrote somewhere that he wanted to make it possible for Java > applications to build Clojure s-expressions dynamically and pass them to an > embedded Clojure compiler/evaluator. > > I'm not talk

Dynamically building and evaluating s-expressions from Java

2009-10-12 Thread Garth Sheldon-Coulson
Rich wrote somewhere that he wanted to make it possible for Java applications to build Clojure s-expressions dynamically and pass them to an embedded Clojure compiler/evaluator. I'm not talking about evaluating strings of Clojure-syntax text. I'm talking about building up the actual s-expressions

Re: Agents for managing threads

2009-10-11 Thread Garth Sheldon-Coulson
Hi All, Thanks for the great replies. John, the self-send-off idea is terrific and hadn't occurred to me. I'll be using a variant of what you proposed. Garth On Sun, Oct 11, 2009 at 10:29 PM, John Harrop wrote: > On Sun, Oct 11, 2009 at 5:28 PM, Raoul Duke wrote: > >> >> will actors actually

Agents for managing threads

2009-10-08 Thread Garth Sheldon-Coulson
Hi All, This is a question about whether I can use agents or some other Clojure concurrency feature to manage a multithreaded process elegantly and extensibly. The following is a thought I had for how to do it, but I would appreciate additional suggestions. I have an application that needs to pol

Re: Linear Algebra Package

2009-10-05 Thread Garth Sheldon-Coulson
I develop Clojuratica. Kyle---I had no idea it works with Player. That's cool and interesting. Patrick---If you're doing straight-up numerical matrix algebra and require the greatest possible performance you'll probably do best with Parallel Colt. There's no time spent on data-type conversion and

Re: Matlab for Lisp programmers?

2009-09-12 Thread Garth Sheldon-Coulson
Patrick and Phil, Consider giving Mathematica another look. I wouldn't repeat David's suggestion if there weren't so many reasons to be enamored of it. Mathematica is to Matlab as Clojure is to Fortran. Mathematica is functional and wonderfully expressive. Matlab is basically the opposite. A compa

Re: Class function alwayrs returns java.lang.class??

2009-09-10 Thread Garth Sheldon-Coulson
What you're getting is the class of the String class, which is Class. What you want is just plain "String". On Thu, Sep 10, 2009 at 11:00 AM, Gorsal wrote: > > Hello. I'm trying to use (class String) to get the class object for > the String class. However, nomatter what class typ ei pass, i alw

Re: Clojure/EPL and the GPL

2009-08-29 Thread Garth Sheldon-Coulson
On Sat, Aug 29, 2009 at 12:00 PM, Rich Hickey wrote: > > This has been discussed as nauseam before: Ah, so it has. Fair enough. > > > > http://groups.google.com/group/clojure/browse_frm/thread/6e99caafcf2bbedf/b5519cc219a5baeb > > Nothing has changed, so let's give it a rest, please. > > Ric

Re: Clojure/EPL and the GPL

2009-08-29 Thread Garth Sheldon-Coulson
Another option Rich could consider for Clojure is the Mozilla tri-license (GPL/LGPL/MPL). http://www-archive.mozilla.org/MPL/relicensing-faq.html The tri-license would remove any lingering ambiguity about building GPLed Clojure projects. But actually I believe the status quo is already quite per

Re: How to generate a hash map from a list

2009-08-24 Thread Garth Sheldon-Coulson
Welcome again. Here's another way. Not sure if it's any more or less efficient, but it's the way my brain works. => (defn map-hashmap [coll f] (apply hash-map (interleave coll (map f coll #'user/map-hashmap => (map-hashmap [1 2 3] #(+ % 3)) {1 4, 2 5, 3 6} On Mon, Aug 24, 2009 at 2:1

Re: ANN: Clojure Ant Tasks

2009-08-10 Thread Garth Sheldon-Coulson
I haven't had a chance to try it out yet, but this is very promising. Thanks for doing it. On Sun, Aug 9, 2009 at 11:58 PM, Richard Newman wrote: > On 9 Aug 2009, at 8:14 PM, J. McConnell wrote: > > http://github.com/jmcconnell/clojure-ant-tasks/tree/master > > I hope someone finds some benefit

Re: Transient Data Structures

2009-08-04 Thread Garth Sheldon-Coulson
runtime? In an ant build file? Is there a better way? Garth On Mon, Aug 3, 2009 at 11:48 PM, Garth Sheldon-Coulson wrote: > Holy smokes. This is great. It's been said before and it'll be said again: > Rich really knows what he's doing. > > This will make number

Re: Transient Data Structures

2009-08-04 Thread Garth Sheldon-Coulson
Holy smokes. This is great. It's been said before and it'll be said again: Rich really knows what he's doing. This will make number crunching in Clojure even more attractive. Question: Suppose I want to write code that will run on 1.0 but take advantage of transients if available. Is there a more

Re: Memfn: what does it mean?

2009-08-03 Thread Garth Sheldon-Coulson
stance method on the > object passing the args. Use when you want to treat a Java method as > a first-class fn." > > > On Mon, Aug 3, 2009 at 2:44 AM, Garth Sheldon-Coulson wrote: > > Out of curiosity, does anyone know what memfn stands for? Is it an > > abb

Memfn: what does it mean?

2009-08-03 Thread Garth Sheldon-Coulson
Out of curiosity, does anyone know what memfn stands for? Is it an abbreviation? Fn obviously stands for function. Mem calls to mind memoize, but I'm not sure I see how memfn memoizes anything... --~--~-~--~~~---~--~~ You received this message because you are subscr

Re: Converting seqs to vectors & caching lazyseqs

2009-08-01 Thread Garth Sheldon-Coulson
a tree, but yours is much faster. Thank you. On Sat, Aug 1, 2009 at 5:53 PM, Meikel Brandmeyer wrote: > Hi, > > Am 01.08.2009 um 18:37 schrieb Garth Sheldon-Coulson: > > I have a program that produces multidimensional LazySeqs, i.e. seqs of >> seqs of seqs of... >>

Converting seqs to vectors & caching lazyseqs

2009-08-01 Thread Garth Sheldon-Coulson
Hi there, I have a program that produces multidimensional LazySeqs, i.e. seqs of seqs of seqs of... I would like to write a function to convert these multidimensional LazySeqs to vectors. This is in case a user needs constant lookup time. The following function will do it: (defn vectorize [obj]

Re: Bug in parallel.clj (and fix)

2009-08-01 Thread Garth Sheldon-Coulson
Brilliant. Can't wait to see this in action. On 8/1/09, Rich Hickey wrote: > > On Fri, Jul 31, 2009 at 10:40 AM, Eric wrote: >> >> I tried to import clojure.parallel today and it didn't work. It >> couldn't find forkjoin.ParallelArray >> >> So I went hunting for it and it doesn't exist. There

Is it possible to swap in a new classloader?

2009-07-31 Thread Garth Sheldon-Coulson
Dear Clojurians, Is it possible to dynamically swap in a new classloader or give Clojure's classloader a new parent classloader? I'm embedding Clojure in a parent app, and the parent app has its own classloader that keeps track of its own classpath. It gives my embedded Clojure a pretty meager cl

Re: Details of send vs. send-off

2009-07-27 Thread Garth Sheldon-Coulson
Never mind, RTFgooglegroup: http://groups.google.com/group/clojure/browse_thread/thread/80ae6ff3f2da8919 On Mon, Jul 27, 2009 at 5:46 PM, Garth Sheldon-Coulson wrote: > Hi, > > I'm updating the documentation for Clojuratica and want to make sure I have > the difference betw

Details of send vs. send-off

2009-07-27 Thread Garth Sheldon-Coulson
Hi, I'm updating the documentation for Clojuratica and want to make sure I have the difference between send and send-off right. Could someone in the know tell me if the following is accurate and complete? "Send" updates its agent using a thread from a limited thread pool. The > threads are recyc

ANN: Clojuratica -- A seamless interface to Mathematica for fast numerics and more

2009-07-27 Thread Garth Sheldon-Coulson
constructive pieces of criticism, and kudos on the design and implementation. Feature suggestions and bug reports are welcome. Please use the Google group<http://groups.google.com/group/clojuratica>. This is beta software with all the usual caveats. Best regards, Garth Sheldon-Coulson P.S. For tho

Re: Implementing ISeq

2009-07-26 Thread Garth Sheldon-Coulson
When I asked the same question a few weeks ago, Rich Hickey gave this response: http://groups.google.com/group/clojure/browse_thread/thread/77ba769caef82803/60738209810ec491 Looking at StringSeq, as he suggested, was particularly helpful. I found useful the idea of using an integer counter to rep

Re: Multimethods dispatching - performance for larger taxonomies

2009-07-23 Thread Garth Sheldon-Coulson
Ah. Thanks. On Thu, Jul 23, 2009 at 8:45 AM, Stuart Halloway wrote: > > Clojure's derive function creates an inheritance relationship between > keywords (or symbols). I have taken to calling this "keyword > inheritance" to emphasize that the inheritance is at the level of > *names*, not of interf

Re: Multimethods dispatching - performance for larger taxonomies

2009-07-23 Thread Garth Sheldon-Coulson
Hi Stuart, Could you give me a two-sentence description, or a pointer to a description, of what keyword inheritance is? Apparently this is something I haven't encountered or don't remember... Thanks a lot. On Wed, Jul 22, 2009 at 10:48 PM, Stuart Halloway wrote: > > I certainly agree with the

Re: Emacs clojure mode: how to set current directory & classpath

2009-07-20 Thread Garth Sheldon-Coulson
If the Eclipse plugin isn't working for you and you're looking for an IDE, you might try the La Clojure plugin for IDEA. It's stable and featureful and works great for me. On 7/20/09, Phil Hagelberg wrote: > > Howard Lewis Ship writes: > >> I have main my code in package folders under src/main/

Re: How to achieve indirection?

2009-07-16 Thread Garth Sheldon-Coulson
One tactic I've used for this is function-generating functions or, in more complex situations, closure-generating functions. I'd appreciate thoughts from gurus on whether this is idiomatic. For instance: You have functions do-something-quickly and do-something-elegantly. You want to call these in

Re: Trouble specifying a gen-class constructor taking an argument of the class being created

2009-07-08 Thread Garth Sheldon-Coulson
ul 8, 2009 at 2:00 PM, Chouser wrote: > > On Wed, Jul 8, 2009 at 7:57 AM, Garth Sheldon-Coulson wrote: > > > > Hello, > > > > Does anyone know a straightforward way to create a constructor using > > gen-class that takes an argument of the same class as the

Trouble specifying a gen-class constructor taking an argument of the class being created

2009-07-08 Thread Garth Sheldon-Coulson
Hello, Does anyone know a straightforward way to create a constructor using gen-class that takes an argument of the same class as the class you're generating? When I try to do it I get a ClassNotFoundException, assuming I don't have a previous compiled version of the class in my compile path. B

Re: Implementing ISeq

2009-07-07 Thread Garth Sheldon-Coulson
Thanks Rich, I'll take a look. By the way, Clojure is a beautiful and enriching thing. Keep up the great work. On Tue, Jul 7, 2009 at 6:21 PM, Rich Hickey wrote: > > > > On Jul 7, 5:31 pm, Garth Sheldon-Coulson wrote: > > Hello Clojurians--- > > > > I

Implementing ISeq

2009-07-07 Thread Garth Sheldon-Coulson
Hello Clojurians--- I'm about to begin writing a Clojure wrapper for a Java data structure that's amenable to seq-ability. 1) I'd like to implement the ISeq interface. Could someone point me to some up-to-date documentation on what I need to implement? Sorry if this is covered somewhere obvious..