The Santa Claus Problem

2009-05-05 Thread graham
I thought this problem (described here http://www.cs.otago.ac.nz/staffpriv/ok/santa/) was nifty back when I first encountered Erlang and as a learning exercise I wanted to model something similar in Clojure. I tried to follow the Erlang solution described in the link (http:// www.cs.otago.ac.nz/

Re: Swank broken at r1369

2009-05-25 Thread graham
I had this problem too and solved it by adding the swank path to my classpath as Paul suggested. Now on r1373 it seems to be working again as before, so you could try updating to the latest svn. --~--~-~--~~~---~--~~ You received this message because you are subscr

Re: Swank broken at r1369

2009-05-26 Thread graham
Ah, sorry, I'm using swank-clojure. It was also broken, but now it's working again with the latest clojure svn. I didn't realise there was an alternative! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" gr

Re: The thread ring problem

2009-05-29 Thread graham
Have you seen the example on the agents page of the main clojure site? http://clojure.org/agents --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegrou

[ANN] 3T Software Labs MongoDB tools for CongoMongo and Monger users.

2014-04-17 Thread graham
just started our adventure, and would love to hear any feedback you have. Thanks a lot, Graham 3T Software Labs -- 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 post

Issue using agent under 1.3 and 1.4-snapshot or perhaps just my lack of understanding

2011-12-16 Thread Graham
Hi, learning clojure and came across some code discussing swing and a code for a flipper as below (defn new-flipper [] (agent {:total 0, :heads 0, :running false, :random (java.util.Random.)})) (defn calculate [state] (if (:running state) (do (send *agent* calculate)

LispCast's assessment of Lisp50

2008-10-22 Thread graham
Very positive about Clojure! http://www.lispcast.com/drupal/node/77 --~--~-~--~~~---~--~~ 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 To unsubscribe from

Re: Swing GUI Builder and Clojure

2008-11-04 Thread graham
rward to!). Graham --~--~-~--~~~---~--~~ 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 To unsubscribe from this group, send email to [EMAIL PROTECTED] For m

Re: What is this function called?

2009-01-02 Thread Graham Fawcett
5,6,7],[4,5,6,7,8],[5,6,7,8,9],[6,7,8,9,10],[7,8,9,10,11],[8,9,10,11,12],[9,10,11,12,13],[10,11,12,13,14]] "Rests" makes good sense as a Clojure-name, IMO, as does not including a null-value at the end. Graham > user> (take 10 (map #(take 5 %) (f (iterate inc 1 > ((1 2 3

Re: Object system for Clojure?

2009-01-30 Thread Graham Fawcett
his seems to leave a gaping hole saying "fill me with an > object system". Is the goal for everyone to roll their own? Hi, Just curious, have you seen the "a la carte hierarchies" scheme that Rich worked up last summer? http://groups.google.com/group/clojure/browse_frm/thread/9

Re: version of -> short-circuiting on nil

2009-03-22 Thread Graham Fawcett
eminiscent of Scheme's "and-let*" which is also sort-of similar. Best, Graham --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send em

Re: version of -> short-circuiting on nil

2009-03-24 Thread Graham Fawcett
" with a "if everybody agrees, I'll use > these names ... and write the patch". No worries, Laurent. Sorry for not joining the discussion earlier. :-) Actually I think the "-?>" squiggle is quite a good name for this function. Best, Graham > > Concerning th

Re: [ANN] leiningen - a Clojure build tool

2009-11-20 Thread Graham Fawcett
you! I'd love to see a short recipe on how to deploy a simple application (hello-world) into an executable jar using Leiningen. I've tried, but seem to be messing something up. Best, Graham -- You received this message because you are subscribed to the Google Groups "Clojure&qu

Re: leiningen - a Clojure build tool

2009-11-20 Thread Graham Fawcett
ingen'ly yours, Graham > > On Nov 20, 11:06 am, Graham Fawcett wrote: >> On Wed, Nov 18, 2009 at 2:29 AM, Phil Hagelberg wrote: >> >> > With Leiningen, your build is described using Clojure. You can put any >> > code you like in your project.clj file;

tree-shaking a jarred Clojure app?

2009-11-20 Thread Graham Fawcett
have off a meaningful fraction. I'm just curious whether there is enough dependency information in a set of class files to calculate a tree-shaking plan; and whether there are existing tools to do the job. Best, Graham -- You received this message because you are subscribed to the Google Group

Re: tree-shaking a jarred Clojure app?

2009-11-20 Thread Graham Fawcett
On Fri, Nov 20, 2009 at 1:37 PM, Jim Downing wrote: > Hi Graham > > 2009/11/20 Graham Fawcett : >> Hi folks, >> >> This is somewhat a Java question, but it's in the context of Clojure, >> so here goes. Playing with Leiningen got me thinking about bundling a

Re: tree-shaking a jarred Clojure app?

2009-11-20 Thread Graham Fawcett
f code! That's a great point. Thanks Richard and Jim for your thoughts! Best, Graham -- 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 member

Re: Clojure Scoping Rules

2009-11-21 Thread Graham Fawcett
of the Reader monad, which I think is most similar to the dynamic binding construct: http://www.haskell.org/all_about_monads/html/readermonad.html Best, Graham -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, s

Re: Clojure Scoping Rules

2009-11-23 Thread Graham Fawcett
might be more useful to your readers: take an input seq, and return an output seq which is evaluated stepwise in the binding environment. Best, Graham -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to

Re: Sneak Peek

2009-11-25 Thread Graham Fawcett
sed fans. You might already be familiar with other continuation-based frameworks. If not, consider looking at projects like Wee (for Ruby) and Seaside (for Smalltalk) to steal some ideas. :) Best, Graham > > One thing I love about FP in general and Clojure specifically is the > density o

Re: Handling XML

2009-12-02 Thread Graham Fawcett
2008/10/trying-clojure.html Best, Graham > I am also using: > (ns zod >   (:require [clojure.contrib.http.agent :as http]) >   (:import (java.util Timer TimerTask)) >   (:use [clojure.xml :only (parse)])) > -- Dennis > On Wed, Dec 2, 2009 at 10:23 AM, Sean Devlin > wro

Re: Question about "The whole language is there, all of the time."

2009-12-09 Thread Graham Fawcett
ises the bar significantly for people writing editors and other tools). But it would be useful if someone were to maintain a fork of Clojure that adds reader-macro capability, and let the community play with it for a while: sort of the way that the bleeding-edgers are playing now with protocols and d

Re: Code arrangement for understandability

2009-12-10 Thread Graham Fawcett
effects. I don't see anything similar about them. You could also write (let [x 1 _ (f x) y (+ x 2) _ (g y)] ...) which puts them all at the same nesting level. Best, Graham > > My Clojure code: > (let [x 1] >  ... >  (f x) >  ... >  (let [y (+ x

Pull request for clojure.contrib.sql?

2009-12-10 Thread Graham Fawcett
ng db connection instead of a db spec. This makes it trivial to get get c.c.sql to work with (for example) a Proxool db connection pool. http://github.com/gmfawcett/clojure-contrib/commit/c74833d5972eaf9357fdd9fd5da6f6bf7f1769bc Proxool: http://proxool.sourceforge.net/ Best, Graham -- You received

Re: Pull request for clojure.contrib.sql?

2009-12-10 Thread Graham Fawcett
Hi Steve, On Thu, Dec 10, 2009 at 4:53 PM, Stephen C. Gilardi wrote: > Hi Graham, > >> To whom should I send a pull-request for an enhancement for >> clojure.contrib.sql? I see that scgilardi is listed as the author, but >> I'm not very clear on how the con

Deploying Leiningen project as WAR file?

2009-12-11 Thread Graham Fawcett
ein uberjar' -- it's just a matter of getting the WAR-specific details ironed out. Best, Graham -- 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 fr

Re: Deploying Leiningen project as WAR file?

2009-12-11 Thread Graham Fawcett
and for lazier readers it also appears below. Many thanks to yogthos' clojure-maven-examples, which answered many questions (though it uses clojure-maven-plugin, and does not use Leiningen): http://github.com/yogthos/clojure-maven-examples Best, Graham * Start a new project with Leininge

Re: How to modify the last few elements of a vector

2009-12-16 Thread Graham Fawcett
t stack) user> (let [stack [1 2 3 4 5] f #(* 100 %)] (stack-apply 3 f stack)) [1 2 300 400 500] Best, Graham > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, sen

Re: How to modify the last few elements of a vector

2009-12-17 Thread Graham Fawcett
On Thu, Dec 17, 2009 at 2:04 AM, Meikel Brandmeyer wrote: > Hi, > > On Dec 16, 10:36 pm, Graham Fawcett wrote: > >> Not sure it's better, but I find this more readable: >> >> (defn stack-apply [n f stack] >>   (if (zero? n) >>     stack

Re: eval performance

2009-12-21 Thread Graham Fawcett
rand)) >  (eval '(prn (+(* x x) 5 So, 'x' is an open term within your expression. Simply define a function (fn [x] (prn (+ (* x x) 5))) instead, and call it with your binding for 'x'. No need for eval here -- maybe once to define the function, but certainly not to evaluate

Re: SQL addition: connection input

2009-12-23 Thread Graham Fawcett
at allows {:connection } as a valid DB > spec. I've tested it out and it seems to work fine. > > Should I create a ticket? Already ticketed and patched. Not sure what the release schedule is, though. http://www.assembla.com/spaces/clojure-contrib/tickets/50 Best, Graham &

Re: parsing/processing of big xml files...

2010-01-06 Thread Graham Fawcett
low, although i provide enough memory for java > (1Gb of heap). Someone asked this question a while back, and a suggestion given was to use Mark Triggs' XOM wrapper: http://github.com/marktriggs/xml-picker-seq Thread: http://groups.google.com/group/clojure/browse_thread/thread/365ca7aaaf8d55b

Re: Lift and bind (was: Understanding the continuation monad's bind operator)

2010-01-12 Thread Graham Fawcett
to the 'return' function: Prelude> :t (.) return (.) return :: (Monad m) => (a -> b) -> a -> m b > I considered something like this > > , > | (defn as-monadic-fn [f] > |   (fn [v] > |     (m-result (f v I'd say that looks right. It has

Re: Help needed regarding the "let"

2010-01-14 Thread Graham Fawcett
th buf 0)           res)) to: (String. buf) and see if your memory problem goes away. Allocating a new String should copy the StringBuilder buffer, not sharing any storage with it, and letting the StringBuffer storage be reclaimed. Best, Graham -- You received this message because yo

Re: New clojure support in Polyglot Maven

2010-04-09 Thread Graham Fawcett
auses that Polyglot Maven didn't expect (:main, :compile-path). These may not be relevant in a Maven build, but it would be nice if they could exist in the project.clj file without causing an error when using your tool. You've gone so far with Leiningen support already, this would be

Re: New clojure support in Polyglot Maven

2010-04-09 Thread Graham Fawcett
Hi Antony, On Fri, Apr 9, 2010 at 11:10 AM, Antony Blakey wrote: > > On 10/04/2010, at 12:24 AM, Graham Fawcett wrote: > >> Your building/installation instructions are a bit on the terse side, >> and left this Maven newbie in trial-and-error-land. :) > > I haven'

Re: [ANN] alpacas: a new Clojure source viewer

2013-06-04 Thread Gregory Graham
This looks like it might be helpful, especially for beginners. I taught Racket in a High School course last year, and I can think of cases where such a diagram could have helped some students. On Tuesday, June 4, 2013 3:58:52 PM UTC-5, Andrea Chiavazza wrote: > > Screenshot added > > -- -- Y

In what OS do you code?

2013-06-16 Thread Gregory Graham
I use Windows 8 at work, with Emacs and Windows Power Shell and bash when needed. It was easy to set up. I've been a long time Unix/Linux lover, but I've come to terms with the need to use Windows at work, and versions 7 and 8 are not bad. At home I have an old MacBook with OS X, and although it

Re: ANN: ClojureScript 0.0-3058, Enhanced REPLs, faster compile times

2015-03-11 Thread Christopher Graham
It seems that (doc ...) and (source ...) do not print any text after (require '[hello-world.core :as hello] :reload) has been entered at the (browser) REPL. On Monday, March 9, 2015 at 7:42:28 PM UTC-4, David Nolen wrote: > > ClojureScript, the Clojure compiler that emits JavaScript source code

Re: complex number library

2015-06-02 Thread Christopher Graham
How about changing the name of the complex-number function to, ideally, complex? complex-number seems irritating to (have to) read. Further, calling this function is a form of type coercion. (float ...), (int ...), etc., are idiomatic Clojure, whereas (float-number ...), (int-number ...), et

idiomatic data transformation

2015-07-07 Thread Joe Graham
Hi Clojure Users, I wanted to learn an idiomatic approach to data transformation in Clojure. For example I have a web service that is consuming some ReST services, Ultimately I need to consolidate these services into a data model which resembles a DAG. However I would like to transform the chi

Re: Installing Clojure on Windows 7

2013-01-26 Thread Gregory Graham
I'm a Clojure newbie, and during Christmas break I decided to learn Clojure, and installed it on my Mac, using Emacs, Nrepl, and Leiningen 2. When I got back to work, I put the same setup on my Windows 7 machine, and the only issue was the lack of wget. So, I installed Gnuwin32

Re: iOS and Windows RT support?

2013-01-26 Thread Gregory Graham
For iOS, I would take a look at clojure-scheme, which translates Clojure to Gambit Scheme, which then compiles to C. Gambit Scheme has been used successfully to create iOS apps. You can see more discussion here

Re: Migrate from IDEs to emacs or vim (already experienced with it) ?

2013-02-02 Thread Gregory Graham
I first learned vi (the predecessor to vim) working on a senior project in college in the early 1980s, and then learned Gosling emacs at my first job in the late 1980s. Since then, I have gone back and forth between the two for various reasons, and I'm about equally comfortable in each of them.

Re: Clojure - Python Style suggestion

2013-02-04 Thread Gregory Graham
I used to be a big Python user, and I liked the use of whitespace for structure back then. The only time it caused me a problem was when cutting and pasting code fragments, which didn't happen very often. Now that I've been using Racket (Scheme) and Clojure for a while, I like the parentheses b

Re: Clojure - Python Style suggestion

2013-02-09 Thread Gregory Graham
> I like the parentheses better. My only complaint is that I have to press >> the shift key to type them. >> > > You can always remap your keyboard / keyboard bindings. For example in > emacs: > > (define-key clojure-mode-map "9" 'paredit-open-round) > Thank-you, I'll try that. -- -- You r

What is the status of Clojure on LLVM or C?

2013-03-27 Thread Joe Graham
Hi Group, Good afternoon I hope everyone is well. I just wanted to reach out to this group and get the current status of Clojure today on the LLVM compiler or C based implementation? Has anyone looked into a Julia implementation? Just trying to get a roadmap on the main forks before searching

Re: Clojure special forms

2013-04-30 Thread Gregory Graham
This shows the pragmatic nature of Clojure. A founding idea of Lisp is that the whole language can be built up from a handful of simple elements, and this is a good thing for a lot of reasons. However, practical concerns such as efficiency and interoperability may lead implementers to access the

ClojureScript & Three.js

2012-12-04 Thread Graham MacDonald
r any tips to help me down the road? Thanks, Graham -- 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 moderated - please be patient with your

Re: ClojureScript & Three.js

2012-12-04 Thread Graham MacDonald
is places it outside closure, and wont be compiled with the > closure compiler. > I don't think this matters much (in most cases anyway). Because > clojurescript is pretty heavyweight as is. Also, 3d-applications > are typically one-page, so page size is not as important. > &g

Potential issue with clojure 1.3 and build of 1.4 master from 13/12 or perhaps just my lack of understanding !

2011-12-16 Thread Graham Berks
counts increase etc. Under 1.3 or latest 1.4 it runs out of heap, shortly after I attempt to defref flipper and see the state I get the exception below. Any ideas ? My lack of understanding or a bug ?? Thanks Graham --- AgentTest.core=> @flipper Exception in thread &q

Re: updating nested structure

2008-08-27 Thread Graham Fawcett
: (defn field-read [st as] (loop [st st as as] (if (first as) (recur (get st (first as)) (rest as)) st))) Best, Graham --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure"

Re: A LIST of questions..

2008-08-29 Thread Graham Fawcett
tire structure must be reconstructed. This isn't the case for prepending to a list, though). If you need to append, or want append/prepend/insert functions, pick a better data structure (like vectors). Best, Graham --~--~-~--~~~---~--~~ You received this m

Re: A LIST of questions..

2008-08-29 Thread Graham Fawcett
On Fri, Aug 29, 2008 at 3:41 PM, Graham Fawcett <[EMAIL PROTECTED]> wrote: > Appending to a list is kludgey in general. Clojure's PersistentLists > are singly-linked lists (like Lisp's cons cells), and appending onto > their tails is O(n) because the entire list must b

Re: (map f coll) using memfn

2008-10-15 Thread Graham Fawcett
Rather than (range (count coll)), I would use (iterate inc 0), which incurs no overhead for counting the argument. Best, Graham --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to t

Re: offtopic - where are you come from? (poll)

2008-10-17 Thread Graham Fawcett
Windsor, Ontario, Canada. (Just down the road, Mark!) Graham --~--~-~--~~~---~--~~ 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 To unsubscribe

Re: offtopic - where are you come from? (poll)

2008-10-17 Thread Graham Fawcett
Just for kicks, I made a publically-editable Google map of Clojure users. I've put my pin on the map, feel free to add your own. This is my first attempt at such a thing -- hopefully it works!) http://tinyurl.com/5kl68p Graham --~--~-~--~~~---~--~~ You rec

Re: offtopic - where are you come from? (poll)

2008-10-17 Thread Graham Fawcett
On Fri, Oct 17, 2008 at 10:03 AM, Randall R Schulz <[EMAIL PROTECTED]> wrote: > > On Friday 17 October 2008 06:44, Graham Fawcett wrote: >> Just for kicks, I made a publically-editable Google map of Clojure >> users. I've put my pin on the map, feel free to add you

Re: string interpolation

2008-10-28 Thread Graham Fawcett
let [greeting "Hello" name "Fred" age 33] (prn (i "${greeting}, my name is ${name} and my age is ${age}."))) -- Graham --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure&qu

Re: string interpolation

2008-10-28 Thread Graham Fawcett
On Tue, Oct 28, 2008 at 7:27 PM, Graham Fawcett <[EMAIL PROTECTED]> wrote: > But for fun, here's an (i ...) macro, that will give you ${} > interpolation in strings (if it works at all, I test it very > thorougly!). Haha, nor did I spell- or grammar-check very thoroughly! I

Re: string interpolation

2008-10-29 Thread Graham Fawcett
d to it from Ruby, Perl and JScheme), but wanted to support a > way of stopping the parser (by backslashing the opening brace: > "$\\{x}" ). I think adding the zero-width assertion in the re-matcher > and the replaceAll to knock the backslash out gets me there: You're very welc

Re: Newbie question: testing if an object is a Struct of a certain kind

2008-10-29 Thread Graham Fawcett
ing" at best. Others have suggested using metadata to "tag" struct values with type information -- that might be an option you prefer over key-comparision. Best, Graham > > Thanks in advance. > > > > > --~--~-~--~~~---~--~~ You rec

Re: (source name)

2008-11-03 Thread Graham Fawcett
er or learn > from the implementation. Hi Mark, Just FYI, if you use Clojure through Emacs/Slime, you already have this functionality. The command "slime-edit-definition", or M-. (meta-key period), will open the source for whatever name is currently under your cursor. Best, Graham

Re: Back on max again...

2008-11-04 Thread Graham Fawcett
that fact. > > So it does. I did not expect that; thought the standard numeric > coercion rules applied. For discussion's sake, here are a couple (lightly tested) functions that might be helpful in determining the "greatest thing in a sequence", given an arbitrary comparato

Re: sequence question and style question

2008-11-05 Thread Graham Fawcett
ake-nth 2 (rest seq The built-in (partition) function does this, no? (partition 2 my-seq) Best, Graham > > (2) When writing a function like pairwise, are there any bright-line > rules about whether to use variable arity? > > Cheers, > Stuart > > > > > --~--

Re: Concerned about Clojure's license choice.

2008-11-05 Thread Graham Fawcett
could download library A and install it, no? The sticking point is in redistribution, not installation or use. Best, Graham > > The CPL doesn't care, but the GPL does. I should probably have stated > this more explicitely. > > >> Anyone who uses your library and >

Re: sequence question and style question

2008-11-05 Thread Graham Fawcett
On Wed, Nov 5, 2008 at 2:00 PM, Stuart Halloway <[EMAIL PROTECTED]> wrote: > > Duh. Thanks, and I will be adding that to the sequences chapter. :-/ > > Stuart You're welcome -- looking forward to the book! Best, Graham > >> >> On Wed, Nov 5, 2008 a

Re: Having struggle in understanding FP (and Clojure question)

2008-11-07 Thread Graham Fawcett
ed application code, but Clojure's flexible syntax might be able to help "unify" the fragments into a more readable form. Best, Graham --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure&q

Re: Print compiled Clojure svn revision?

2008-11-07 Thread Graham Fawcett
cond rev) "unknown")) and then do this, svn propset svn:keywords "Revision" boot.clj svn commit boot.clj ...then (clojure-svn-revision) ought to return the revision number as a string. Best, Graham --~--~-~--~~~---~--~~ You received

Re: Print compiled Clojure svn revision?

2008-11-07 Thread Graham Fawcett
On Fri, Nov 7, 2008 at 1:15 PM, Rich Hickey <[EMAIL PROTECTED]> wrote: > > > > On Nov 7, 1:02 pm, "Graham Fawcett" <[EMAIL PROTECTED]> wrote: >> On Fri, Nov 7, 2008 at 11:46 AM, vdm <[EMAIL PROTECTED]> wrote: >> >> > Is there a way to

Re: Print compiled Clojure svn revision?

2008-11-07 Thread Graham Fawcett
On Fri, Nov 7, 2008 at 1:48 PM, Chouser <[EMAIL PROTECTED]> wrote: > > On Fri, Nov 7, 2008 at 1:02 PM, Graham Fawcett <[EMAIL PROTECTED]> wrote: >> >> If Rich would be willing to add this to boot.clj, > [snip] >> >> ...then (clojure-svn-revision) ought

Re: Print compiled Clojure svn revision?

2008-11-07 Thread Graham Fawcett
hooks appears to be impossible -- while in an SVN commit transaction, the SVN server cannot say "and also touch this file over here" if that file was not part of the commited patch. It seems the best alternative is to let Ant try to get the SVN revision and push in the change, as Ch

Re: doseq, dotimes & loop/recur

2008-11-08 Thread Graham Fawcett
ums) (+ (first nums) sum) (* (first nums) product) (defn sum-and-product-reducing [numbers] (reduce (fn [[sum prod] frst] [(+ sum frst) (* prod frst)]) [0 1] numbers)) In short, if you can figure out how to write your expression using

Re: doseq, dotimes & loop/recur

2008-11-08 Thread Graham Fawcett
traverse a sequence, and doseq can be thought of as a "map" that is evaluated immediately, for side-effects, and which discards the result of the map. (Like for-each in Scheme, compared with map in Scheme -- the former is for side-effects, the latter t

Re: doseq, dotimes & loop/recur

2008-11-08 Thread Graham Fawcett
q', `dotimes' and `doall' complete, > and if not, what is missing? Of course, dotimes could be implemented in terms of doseq, e.g. (dotimes i n ...) (doseq i (take n (iterate inc 0)) ...) so really there aren't any special cases in Clojure. I can't think

The Dread Revision 1089

2008-11-10 Thread Graham Fawcett
ce projects, Clojure seems to have a HEAD culture rather than a Release culture, so intentionally breaking HEAD should be taboo, IMHO. Best, Graham --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure"

Re: The Dread Revision 1089

2008-11-10 Thread Graham Fawcett
s a willingness to make > such changes. All points well-taken, Rich -- thanks for the response. Cheers, Graham --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group

Re: Readable names

2008-11-10 Thread Graham Fawcett
) Old habits die hard, and I'm enough of a dinosaur to feel edgy when my code expands far beyond that invisible 78-character wall. I've also had to emergency-edit enough code at the console to appreciate that 78-ish still isn't a bad soft limit. Og make fire, go find slide-rule and wr

Re: PATCH: Make name accept String

2008-11-11 Thread Graham Fawcett
ged, I'd vote to have it return nil for any input value other than a Named instance. Then you could write (or (name ks) ks) which is concise and very Lispy, IMHO. Graham > > user=> (name :foo) > "foo" > user=> (name "foo") > "foo" &g

Re: newbie: can clojure do ...

2008-11-11 Thread Graham Fawcett
he forward/backward buttons. Presumably you can hook into Muse's publishing function and have it generate the JS file automatically for you. You might learn some JavaScript, HTML and Elisp this way, but no Clojure. :-) Graham --~--~-~--~~~---~--~~ You received th

Re: Print compiled Clojure svn revision?

2008-11-14 Thread Graham Fawcett
mirror the SVN repos, the build > script can be made to use the tools available in any of the other SCMs > to identify the SVN revision and generate the "versioninfo" file. +1. I think it's worth it, and would really like to see this put in place. Best, Graham --~--~-~

Re: Patch: precompiling Clojure core sources in Ant build script

2008-11-14 Thread Graham Fawcett
the source definition of the word under point. I'm sure there's a work-around, of course. The meta information is still there: user> (meta #'last) {:arglists ([coll]), :doc "Return the last item in coll, in linear time", :name last, :file "cor

Re: Patch: precompiling Clojure core sources in Ant build script

2008-11-14 Thread Graham Fawcett
On Fri, Nov 14, 2008 at 4:01 PM, Stephen C. Gilardi <[EMAIL PROTECTED]> wrote: > > On Nov 14, 2008, at 3:38 PM, Graham Fawcett wrote: > > I'm sure there's a work-around, of course. The meta information is still > there: > > This appears to be because

Re: writing binary values (bytes) to a file

2008-11-19 Thread Graham Fawcett
takes a width N, and returns a function that takes an Integer as input and returns an N-width byte array containing the Integer in big-endian order. E.g. ((byte-array-maker 4) 652187261) => [4-byte array: 26, df, 96, 7d] Cheers, Graham --~--~-~--~~~---~--~~ You re

Re: [SOLVED] writing binary values (bytes) to a file

2008-11-19 Thread Graham Fawcett
en accepts any number of bindings. Does it just > call close on the first one when the body finishes or on all of them? > > If I wanted to figure this out for myself, how would I find the source > code for with-open? Hi, If you're using Slime in Emacs, type in the word "with-

Re: writing binary values (bytes) to a file

2008-11-21 Thread Graham Fawcett
Hi Vlad, On Thu, Nov 20, 2008 at 5:36 PM, prhlava <[EMAIL PROTECTED]> wrote: > > Hello Graham, > >> Bonus question for the bored reader: write a function, >> (byte-array-maker N), that takes a width N, and returns a function >> that takes an Integer as input

Re: offtopic - where are you come from? (poll)

2008-11-21 Thread Graham Fawcett
vited to take a moment and add yourself to the map. I know the map and this discussion thread aren't of any technical value, but it's very nice to feel the size and scope of the Clojure community. Thank you, Rastislav Kassak, for starting th