A couple questions about the language

2009-11-01 Thread Andrew
1. Can I have compile time evaluation forms like in Lisp? For example, I want to obtain current namespace during macro expansion, or make Java imports in compile time. Is it possible? 2. Can I precompile Clojure code (not generated classes) and load precompiled version instead of text script? Th

what stack traces include / exclude regarding monads

2012-02-13 Thread Andrew
I've been experimenting with a state monad. Below is a list of what is included in my stack trace [+] and what isn't [-]. I've noticed that a call to a symbol that is bound to the result of a domonad (not sure if that's the right way to describe it) doesn't end up in my stack trace. I was plann

Re: what stack traces include / exclude regarding monads

2012-02-13 Thread Andrew
Here's the code if the list in the original post was too cryptic. None of the items beginning with "cc" show up in the stack trace by name -- m_bind shows up instead. (defn ee [] (show-stack)) (def dd (fn [s] [ (show-stack) s])) (def cc2 (with-monad sim-m (domonad [_# dd]

Re: what stack traces include / exclude regarding monads

2012-02-14 Thread Andrew
I guess the use of domonads leaves behind do statements with m_bind's and m_result's... and since these expressions are not fn's, they don't count as method calls and are thus not part of the stack trace. But if I'm mistaken or if anyone has figured out how to use monads and still get detailed s

seeking a lazy way to interleave a constant

2012-04-09 Thread Andrew
Given a lazy sequence of numbers is there a way to interleave a constant and get another lazy sequence? Say the first sequence is 1 2 3 4 ... I'd like the second sequence to be 1 0 2 0 3 0 4 0 Thanks in advance! -- You received this message because you are subscribed to the Google Groups

xml: parse -- edit -- emit

2012-04-17 Thread Andrew
1. It seems build.clojure.org now uses Java 6 so clojure.data.xml is available for use (vs February 20 2012 -- correct me if I'm wrong) 2. Using clojure.zip I'm able to make my desired edits. Then I call zip/root and I have my result. I'm not sure what the next steps are to get

Re: xml: parse -- edit -- emit

2012-04-18 Thread Andrew
Ah ... After zip/edit comes zip/root ... xml/emit-str ... spit. On Tuesday, April 17, 2012 3:29:01 PM UTC-4, Andrew wrote: > > >1. It seems build.clojure.org now uses Java 6 so clojure.data.xml is >available for use (vs February 20 2012 -- correct me if I'm wro

Re: The Kiln, an Evaulation Strategy for Insanely Complex Functions

2012-05-08 Thread Andrew
Cool... Do you use kilns at Akamai, and to what extent? Another question: you set up coals and clays and eventually kilns are fired. When you're setting up the coals and clays in code, you're telling the system about dependencies. Are these dependencies laid out explicitly enough to be always u

Re: Clojure and the Anti-If Campaign

2012-05-29 Thread Andrew
Thanks for sharing your blog post. Is there an Anti-If alternative to loop/recur in a situation where you have to poll for a condition to be true? (Seems to me that this necessitates some kind of conditional statement) On Thursday, May 24, 2012 5:57:47 AM UTC-4, Dominikus wrote: > > Three weeks

Re: Light Table on Windows XP

2012-07-05 Thread Andrew
fwiw, here's what I see on Windows XP. There are instructions for running LightTable without Powershell? What are they? --- PS C:\Documents and Settings\user\lighttable> .\light.ps1 table Security Warning Run only scripts that you trust. While scripts from the Internet can be useful, this scri

(let [a 0] (eval 'a)))

2012-07-31 Thread Andrew
I have a value and a string. The string contains valid Clojure code and it mentions a variable. I'd like to let-bind that variable to the value and then evaluate the string. Can this be done? As a small example, I thought this would work: (let [a 0] (eval 'a))) Or maybe this: user> (let [a 0]

Re: array literal syntax

2012-09-18 Thread Andrew
In my ClojureScript unit tests, the following doesn't evaluate to true (= (array 1 2) (foo)) even though all foo does is return (array 1 2). What should I do differently? On Tuesday, January 10, 2012 2:51:06 PM UTC-5, David Nolen wrote: > > There is no array literal syntax yet, but (array 22 33

Re: array literal syntax

2012-09-18 Thread Andrew
I tried this but it didn't work. (identical? (array 1 2) (foo)) Did you mean this? On Tuesday, September 18, 2012 5:08:11 PM UTC-4, David Nolen wrote: > > On Tue, Sep 18, 2012 at 4:54 PM, Andrew > > wrote: > > In my ClojureScript unit tests, the following d

optimized clojurescript->js file throws exception but debug version does not?

2012-10-04 Thread Andrew
Please see https://github.com/achengs/subpar/issues/1 which links to two demo pages. One page uses the debug (non-optimized non-munged) js version and seems to work fine. The other uses the optimized version and throws an exception. Details are in the github issues page and on the demo pages th

Re: optimized clojurescript->js file throws exception but debug version does not?

2012-10-04 Thread Andrew
/subpar.js for reindenting lines also makes the issue go away On Thursday, October 4, 2012 1:02:08 PM UTC-4, David Nolen wrote: > > On Thu, Oct 4, 2012 at 12:40 PM, Andrew >wrote: > >> Please see https://github.com/achengs/subpar/issues/1 which links to two >> demo pages. One

Re: optimized clojurescript->js file throws exception but debug version does not?

2012-10-05 Thread Andrew
Oh. I'm pretty sure it's because in the broken case I use two blobs of js which were minified at *separate* times thus allowing for name conflicts. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegr

Re: optimized clojurescript->js file throws exception but debug version does not?

2012-10-05 Thread Andrew
"resources/public/js/subpar.core.js" :optimizations :advanced :pretty-print false}}} On Friday, October 5, 2012 8:21:09 AM UTC-4, David Nolen wrote: > > On Fri, Oct 5, 2012 at 8:16 AM, Andrew >wrote: > >> O

Re: optimized clojurescript->js file throws exception but debug version does not?

2012-10-05 Thread Andrew
After I read the link you provided and another page, I discovered that wrapping my compiled stuff in an anonymous function keeps Google Closure's output symbols from colliding wi

Re: optimized clojurescript->js file throws exception but debug version does not?

2012-10-06 Thread Andrew
What about the --output_wrapper part? My clojurescript js never calls the minified foreign library directly: What I have is [1] some plain non-optimized javascript that calls [2] CodeMirror for the code and position, then calls [3] my clojurescript js to find out how to do the requested paredi

ANN subpar (paredit for codemirror)

2012-10-12 Thread Andrew
A ParEdit approximation for use in CodeMirror. https://github.com/achengs/subpar Could conceivably benefit Light Table. *In other news, I'm in the market for a job...* -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send emai

Re: ANN subpar (paredit for codemirror)

2012-10-12 Thread Andrew
x bindings. Maybe I can figure it out. > > > On Fri, Oct 12, 2012 at 4:21 PM, Andrew > > wrote: > > A ParEdit approximation for use in CodeMirror. > > https://github.com/achengs/subpar Could conceivably benefit Light > Table. In > > other news, I'

Re: ANN subpar (paredit for codemirror)

2012-10-12 Thread Andrew
output? > > > > On Fri, Oct 12, 2012 at 5:04 PM, Andrew > > wrote: > > I forgot to add that the README.md has a link to a demo page (here) > > > > > > On Friday, October 12, 2012 4:47:47 PM UTC-4, kovasb wrote: > >> > >> This is g

Re: ANN subpar (paredit for codemirror)

2012-10-13 Thread Andrew
Anthony: Great! What needs to happen on my end for that to happen? -- 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 yo

Re: ANN subpar (paredit for codemirror)

2012-10-13 Thread Andrew
Marc, could you send me an email directly? It's available on my github page. I have some questions I'd like to ask you offline and wasn't sure whether mslimotte@... would get to you or a stranger... -- You received this message because you are subscribed to the Google Groups "Clojure" group. To

seeking advice for reducing boilerplate

2011-09-28 Thread Andrew
While trying out clj-webdriver (for testing web pages), I got the impulse to reduce some of my boilerplate. I'd like your advice on best practices. Here's the original code. (deftest test-login (let [b (start :firefox "https://github.com";)] (try (implicit-wait b 6) (-> b (

unable to resolve symbol: doc

2011-09-30 Thread Andrew
When I do M-x clojure-jack-in on one project.clj which uses clojure 1.2.1, I'm able to evaluate (doc map). But with another project.clj which uses clojure 1.3.0-RC0, the repl is unable to resolve symbol: doc. I also changed it to use clojure 1.3.0, ran lein deps... M-x clojure-jack-in repl

Re: seeking advice for reducing boilerplate

2011-09-30 Thread Andrew
Thanks (both) for the advice! -- 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 first post. To unsubscribe from t

Re: unable to resolve symbol: doc

2011-09-30 Thread Andrew
Oh **that's** what was meant by the blurb below. Thanks.2.26 doc & find-doc moved to REPL Adds special form docs to the REPL -- 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

Re: newbie, installation problem

2011-10-14 Thread Andrew
Sagar, I had trouble on Windows until Mark Rathwell suggested following the instructions at http://sourceforge.net/apps/wordpress/codesounding/tag/emacs -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@goog

ultra-noob read-line question

2011-10-27 Thread Andrew
At the REPL in Emacs, shouldn't the following code allow me to type something followed by [Enter] and then shouldn't it print my input back out? (println (read-line)) When I enter this at the prompt, I immediately see the following. It doesn't wait for input. user> (println (read-line)) nil ni

Re: ultra-noob read-line question

2011-10-27 Thread Andrew
What does the exception below mean? Does trampoline require something to be defined/included that the usual way doesn't? Exception in thread "main" java.lang.IllegalArgumentException: No implementation of method: :make-writer of protocol: #'clojure.java.io/IOFactory found for class: nil (NO_SOU

Re: ultra-noob read-line question

2011-10-28 Thread Andrew
I should be more specific. I see the exception only with trampoline. Exception in thread "main" java.lang.IllegalArgumentException: No implementation of method: :make-writer of protocol: #' clojure.java.io/IOFactory found for class: nil (NO_SOURCE_FILE:0) -- You received this message because yo

start-process-shell-command: Spawning child process: invalid argument

2011-11-16 Thread Andrew
Having trouble setting up Clojure/Emacs on Windows again. Earlier Mark Rathwell helped meby pointing out a recipe for Windows

Re: start-process-shell-command: Spawning child process: invalid argument

2011-11-16 Thread Andrew
The attempt revealed the need to install the slime package. After that, the two commands succeed. However, M-x clojure-jack-in still fails in a fresh emacs session with the same error. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this

Re: start-process-shell-command: Spawning child process: invalid argument

2011-11-17 Thread Andrew
Thanks Do I need Cygwin at all for Clojure work on Windows/Emacs/Swank/clojure-mode/lein? Or can I remove Cygwin from my machine? And are these two functionally equivalent? - clojure-jack-in - lein swank and slime-connect -- You received this message because you are subscribed

repl dodges ns :use :only ?

2011-11-18 Thread Andrew
I'm surprised that I can do the following. Am I wrong about namespaces? 1. M-x clojure-jack-in 2. at the repl, execute (ns my-proj.core) 3. compile my core.clj (see ns snippet below) 4. back in the repl, use a function from a library that wasn't included in the :only clause from my

Re: repl dodges ns :use :only ?

2011-11-18 Thread Andrew
Oh, thanks. Is there a way to "import" some functions and not others such that the others cannot be used at all? -- 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 m

Re: repl dodges ns :use :only ?

2011-11-19 Thread Andrew
And how can I get what I originally wanted? (Import only function bar from library foo - renaming foo to f - requiring my own code to say f/bar and ensuring that foo/baz and f/baz and baz don't work since baz is not imported?) -- You received this message because you are subscribed to the Goog

Literate Programming in Emacs?

2011-11-22 Thread Andrew
For those who do Literate Programming in Emacs, what do you use? I was looking at org-babel-clojurewhich says: > You will need to install the following packages: clojure-mode, > swank-clojure, slime, slime-repl But wh

Re: Literate Programming in Emacs?

2011-11-22 Thread Andrew
I should add that I am starting with a working setup (able to M-x clojure-jack-in and compile and execute stuff in the REPL as expected). -- 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 No

Re: Literate Programming in Emacs?

2011-11-23 Thread Andrew
Here's my attempt at following the steps at http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-clojure.html. *The result is org-babel-execute-src-block: No org-babel-execute function for clojure * 1. The recommendation was to follow "Connecting with SLIME" from https://github.

Re: Literate Programming in Emacs?

2011-11-23 Thread Andrew
Thanks! Next step: org-babel-execute:clojure:Cannot open load file: swank-clojure ... -- 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 - pleas

Re: Literate Programming in Emacs?

2011-11-29 Thread Andrew
Thanks -- it does help somewhat... 1. How is it that you have swank-clojure in your elpa directory? M-x list-packages does not have swank-clojure as an option. 2. Why does your elpa directory have 1.1.0 and your project file have 1.3.0? 3. Is there a choice between SLIME and infer

Re: Errors w/ dynamic symbols in macro-utils or monads?

2011-12-02 Thread Andrew
Does this still happen for you? It appears to still be the case in my environment. Dropping back to Clojure *1.2.1* seems to work but in addition to trying out monads, I need to use a library (clj-webdriver) that relies on Clojure *1.3.0* What to do? -- You received this message because y

Re: Errors w/ dynamic symbols in macro-utils or monads?

2011-12-02 Thread Andrew
ah: http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go clojure.contrib.monads - Migrated to clojure.algo.monads - lead Konrad Hinsen . - Status: latest build status

delayed recursive macro expansion?

2011-12-02 Thread Andrew
Is there a way for a macro m to expand into code that includes another "delayed" use of m such that this second use of m is only expanded if needed (and thus avoiding a stack overflow)? -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this

Re: delayed recursive macro expansion?

2011-12-02 Thread Andrew
(defmacro interactive-try "If expr results in an exception, prompt the user to retry or give up. The user can execute arbitrary code somewhere else or fiddle with a DB before retrying. Returns nil if the user gives up." [expr] `(try ~expr (catch Exception e# (-> (ui/dialog :o

Re: delayed recursive macro expansion?

2011-12-02 Thread Andrew
Well, I found a way to dodge that need. But still interested in whether it's possible. Here's my dodge. Ugly and proud. (defmacro itry "If expr results in an exception, prompt the user to retry or give up. The user can execute arbitrary code somewhere else or fiddle with a DB before retrying. R

Re: delayed recursive macro expansion?

2011-12-03 Thread Andrew
Aren't the calls to itry-the-fn different from the calls to itry-the-macro? For example, let's say my expr is (/ a b) where b is currently zero and maybe the user decides to set a new value for b when prompted. itry-the-macro can be called this way: (itry (/ a b)) and is able to print out the s

Re: delayed recursive macro expansion?

2011-12-03 Thread Andrew
There's no light on in my attic. It's hollow and dark. :-P (itry (/ 5 0)) ==> exception (itry (fn [] (/ 5 0))) ==> # But that's ok. I have my ugly macro that uses loop-recur. And I'll be fine. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To po

Re: swank-cdt: Using Slime with the Clojure Debugging Toolkit

2011-12-06 Thread Andrew
I get the same thing on Windows XP with Leiningen 1.6.2 on Java 1.7.0 Java HotSpot(TM) Client VM - copied tools.jar manually to my lib/ just to see if it would work - it did, and still gave a warning about tools.jar - tried the test drive and when I type v I get this: *clojure\set.clj -

Re: swank-cdt: Using Slime with the Clojure Debugging Toolkit

2011-12-06 Thread Andrew
user> (require 'clojure.set) nil user> (set-bp clojure.set/difference) nil nil user> (clojure.set/difference #{1 2} #{2 3}) CDT buffer appears CDT BreakpointEvent in thread Swank REPL Thread >From here you can: e/eval, v/show source, s/step, x/next, o/exit func Restarts: 0: [QUIT] Quit to t

Re: swank-cdt: Using Slime with the Clojure Debugging Toolkit

2011-12-06 Thread Andrew
Thanks for taking the time Sean! You're right... - I'm on Windows XP - I had to copy tools.jar to my projects lib manually after lein deps (not sure how to change the classpath) - My emacs setup is munged -- I can run M-x eshell but not M-x shell; I have to do lein swank and M-x s

getting inside another dynamic scope?

2011-12-06 Thread Andrew
Is there a way (without swank-cdt) to get inside some other dynamic scope that's blocked in order to evaluate some arbitrary code? Let's say a thread has paused waiting for some UI input. Earlier a dynamic var binding happened. You know the name of that var ... you know that thread is waiting

Re: getting inside another dynamic scope?

2011-12-07 Thread Andrew
(Sorry, I'll read this first http://clojure.org/vars#Vars%20and%20the%20Global%20Environment) -- 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

question from wikibooks page on macros?

2012-01-06 Thread Andrew
http://en.wikibooks.org/wiki/Learning_Clojure/Macros The page says the following: (def pointless (fn [n] n)) "Whatever is passed to this macro---a list, a symbol, whatever---will be returned unmolested and then evaluated after the call. Effectively, calling this macro is pointless:" (pointles

Re: question from wikibooks page on macros?

2012-01-06 Thread Andrew
I see. That section is just horribly written, calling something a macro when it isn't one yet. Here's my thinking in **bold**, inlined. Simple Macro If you understand the reader and evaluator, there actually isn't all that much more to understand about the operation and creation of macros, for

where's let* ?

2012-01-06 Thread Andrew
I have spent a little time trying to find the source code for let* and have so far failed :-P Can someone help me? (source let) points to a use of let* I can see the definition of let at github in clojure/clojure ... src core.clj... But I can't find let* Thanks in advance! -- You

does symbol completion work after 2nd slime-compile-and-load-file ?

2012-01-10 Thread Andrew
If you do these steps, do you get a better result for #5? If so, what might be wrong with my setup? 1. in emacs shell, lein swank & 2. M-x slime-connect (I have to do these as two separate steps vs M-x clojure-jack-in because of my broken environment) 3. M-x slime-compile-and-load-fi

Re: does symbol completion work after 2nd slime-compile-and-load-file ?

2012-01-10 Thread Andrew
or is M-x slime-compile-and-load-file the wrong command to use? -- 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: Literate Programming in Emacs?

2012-01-11 Thread Andrew
As you know, now I get org-babel-execute:clojure:Cannot open load file: swank-clojure The method org-babel-execute:clojure in my .emacs.d/elpa/org-2029/ob-clojure.el file says (require 'swank-clojure). Given that the swank-clojure elisp package is deprecated and should not be used what sho

Re: Literate Programming in Emacs?

2012-01-12 Thread Andrew
I found [1] from Eric Schulte which says to add certain package archives such that ELPA finds swank-clojure... But what about the swank-clojure elisp package being deprecated? (By the way, I do get further now... the clojure code evaluates) (setq package-archives '(("original". "ht

Re: Literate Programming in Emacs?

2012-01-12 Thread Andrew
Eric asks: The only function ob-clojure uses from swank-clojure is `swank:interactive-eval-region' (used with `slime-eval') in the `org-babel-execute:clojure' function. Which function would now be used to evaluate a region of clojure code? Would `slime-eval-region' suffice? -- You received thi

why is assert-args private?

2012-02-03 Thread Andrew
In clojure's core.clj, assert-args is marked with ^{:private true}. Why? Seems like something that would be useful in any macro definition, not just the ones in core.clj... -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send

Re: confused by Vars, Refs, Agents and Atoms

2008-12-16 Thread Andrew Baine
Check out http://blip.tv/file/812787/ which is a video presentation by Rich Hickey on clojure concurrency; it ends with an description of an ant simulation that uses refs and agents -- it really helped my own intuitive feel of when to use those two constructs. Best, Andrew

subset?

2008-12-19 Thread Andrew Baine
ere? Andrew --~--~-~--~~~---~--~~ 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 clojure+unsubscr...@goo

Re: subset?

2008-12-19 Thread Andrew Baine
I should note that this also works because of sets being seq-able. Since they're callable, we can use b as the predicate in every?; since they're seq-able we can use a as the coll in every?. Very cool! On Dec 19, 1:46 pm, Andrew Baine wrote: > Since sets are callable like func

clojure.contrib.enum Exception

2008-12-20 Thread Andrew Baine
$CompilerException] I'm using the latest version of clojure and clojure-contrib: andrew$ svn update clojure At revision 1162. andrew$ svn update clojure-contrib/ At revision 313. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

Re: clojure.contrib.enum Exception

2008-12-22 Thread Andrew Baine
Okay, thanks Stuart. --~--~-~--~~~---~--~~ 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 clojure+unsubscr...@g

containsAll patch?

2008-12-24 Thread Andrew Baine
Index: src/jvm/clojure/lang/PersistentQueue.java === --- src/jvm/clojure/lang/PersistentQueue.java (revision 1185) +++ src/jvm/clojure/lang/PersistentQueue.java (working copy) @@ -181,10 +181,10 @@ public boolean containsAll(Coll

Re: containsAll patch?

2008-12-24 Thread Andrew Baine
I also uploaded the patch to this group's files: http://groups.google.com/group/clojure/web/containsAll.patch On Dec 24, 7:05 pm, Andrew Baine wrote: > Index: src/jvm/clojure/lang/PersistentQueue.java > === > --- s

What is this function called?

2009-01-01 Thread Andrew Baine
4 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)) Does this fn already exist in clojure? If not what would an idiomatic name be for it from Haskell or CL? Andrew --~--~-~--~~~---~--~~ You received this mess

Re: What is this function called?

2009-01-02 Thread Andrew Baine
On Fri, Jan 2, 2009 at 8:09 AM, Perry Trolard wrote: > > I did something similar using (iterate rest coll), which I called iter- > rest: > > (defn iter-rest > "Takes the first (count coll) items from call to (iterate rest > coll). > If passed function as first argument, calls it on each invoc

Re: Bug in .hashCode for vectors/lists (Old subject: "Bugs in contains? (?))

2009-01-03 Thread Andrew Baine
On Sat, Jan 3, 2009 at 1:30 PM, Jason wrote: > Thanks for your posts. I think I understand what happens now, but I > still maintain that it's a bug. In particular, the Java API says: "If > two objects are equal according to the equals(Object) method, then > calling the hashCode method on each o

Re: Please submit patches as attachments to issues

2009-01-05 Thread Andrew Baine
Where do I find the Clojure Contributor Agreement so I can submit a patch with my issue? Andrew --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email

Re: Please submit patches as attachments to issues

2009-01-05 Thread Andrew Baine
Here: http://clojure.org/contributing On Jan 5, 3:39 pm, Andrew Baine wrote: > Where do I find the Clojure Contributor Agreement so I can submit a > patch with my issue? > > Andrew --~--~-~--~~~---~--~~ You received this message because you are subsc

Re: More SLIME woes

2009-01-23 Thread Andrew Baine
On Jan 23, 1:53 pm, Tom Emerson wrote: > Hi all, > > I updated my entire Clojure environment today to the latest in source > control: slime, swank-clojure, clojure, clojure-contrib, clojure-mode. > Now SLIME is unhappy. It appears that the swank-clojure code has been > patched appropriately. I

Re: Fresh Clojure Tutorial

2009-03-29 Thread Andrew Wagner
Excellent tutorial. I pretty much zipped right through it, even though I'm on osx and had to figure out the right way to get a git client for myself. Thanks! On Sun, Mar 29, 2009 at 3:34 PM, Curran Kelleher wrote: > > Hello, > > I've created an introductory tutorial for Clojure and Emacs here: >

Re: Fresh Clojure Tutorial

2009-03-29 Thread Andrew Wagner
Oh, I should point out that it looks like your abs examples, under "Learning basic clojure" got mangled. On Sun, Mar 29, 2009 at 3:34 PM, Curran Kelleher wrote: > > Hello, > > I've created an introductory tutorial for Clojure and Emacs here: > > http://lifeofaprogrammergeek.blogspot.com/2009/03/l

Thread-local bindings per agent

2009-03-31 Thread Andrew Stein
Hi all! Here's a set of macros I have found useful for creating simulated thread-local bindings for specific agents: (defmacro bind-agent "Adds bindings to an agent's metadata" [#^clojure.lang.Agent a bindings] (list 'let (vector 'ba# a) (list 'do (list 'alter-meta!

keyword and /

2009-04-06 Thread Andrew Rimes
Hello, This tripped me up today: user=> (:the/key { :the/key "the val"}) ; ok "the val" user=> (:the/key { (keyword "the/key") "the val"}) ; returns nil? nil Shouldn't both return "the val"? Thanks, Andrew --~--~-~--

Re: keyword and /

2009-04-06 Thread Andrew Rimes
ame part > is "key" just like :the/key. > > Does this accomplish what you're after or are you specifically > requesting that (keyword "the/key") be made to work? Yeah, that is alright. Thanks. > > --Steve > > On Apr 6, 2009, at 2:45 AM, Andrew Ri

ICFP 2009

2009-04-20 Thread Andrew Wagner
It would be fun to have a team of clojure programmers work on the ICFP '09 contest. Has this been done previously? Anybody interested? I'm new to clojure and to lisps in general, but have a pretty good grasp of functional programming (mostly from haskell). It would be great fun to work with some mo

Re: ICFP 2009

2009-04-23 Thread Andrew Wagner
> > Sounds like a fun thing to try. Could someone give a brief > description of what would be required in terms of time commitment to > participate on a team? (Sadly, spare time is hard to come by...) > It's just one weekend. As much or as little time as you can commit to for that weekend. --~-

Re: PeepCode screencast

2009-04-25 Thread Andrew Wagner
Just to provide a review - I must say, I really wanted to like this screencast, and failed, unfortunately. It tries to cover everything from "what is functional programming?" (tracing through passing functional arguments, and basic map/reduce stuff, for example) to the intricacies of STM use and cl

Re: PeepCode screencast

2009-04-27 Thread Andrew Wagner
ly very good,especially as it gives a >> good overview of how to break up your code and about packaging. It >> does go a bit quick, but I found that by re-watching + reading the >> code at the same time very helpful. It a useful demo to see the power >> and conciseness of clo

Re: What's the function that returns the opposite of a predicate?

2009-04-30 Thread Andrew Wagner
I think maybe you want complement: http://clojure.org/api#complement On Thu, Apr 30, 2009 at 1:50 PM, samppi wrote: > > I know there's a core function that takes a predicate and returns its > opposite: > > (defn mystery [predicate] > (fn [x] (not (predicate x > > I'm having a lot of trouble

Re: ANN: Full, continuously updated documentation for clojure.contrib

2009-05-04 Thread Andrew Wagner
Absolutely brilliant. Exactly what clojure-contrib and the clojure community needed. Thank you! On Mon, May 4, 2009 at 2:41 AM, Tom Faulhaber wrote: > > Hello everybody, > > As many of you know, I have been working on a "contrib autodoc robot" > for the last little while. > > It is now up and run

with-open macro

2009-05-12 Thread Andrew Wagner
I just saw this on the JavaWorld article (great article by the way: http://www.javaworld.com/javaworld/jw-05-2009/jw-05-clojure.html ) (defmacro with-open [bindings & body] `(let bindings (try @body (finally (

Re: with-open macro

2009-05-12 Thread Andrew Wagner
ive that means > assigning rdr to function (reader file). So now it is pretty obvious that > what you need is the variable, rdr, (in side the scope) and that's why > clojure takes only the first element of the vector.I guess that's logical. > > Emeka > > > > > > On

Re: with-open macro

2009-05-12 Thread Andrew Wagner
Wow. Ok, yeah, I'm glad he didn't put that version in the article :) On Tue, May 12, 2009 at 1:17 PM, Stephen C. Gilardi wrote: > > On May 12, 2009, at 12:30 PM, Andrew Wagner wrote: > >> It seems like this idiom would be easy to implement in this macro. Or am I >>

Re: with-open macro

2009-05-12 Thread Andrew Wagner
Oh, it's just significantly harder to read if you don't know clojure, that's all. On Tue, May 12, 2009 at 2:43 PM, Emeka wrote: > Why? > > > On Tue, May 12, 2009 at 5:37 PM, Andrew Wagner wrote: > >> Wow. Ok, yeah, I'm glad he didn't put that ver

Enclojure problem

2009-05-15 Thread Andrew Wagner
Hi everyone, Trying to set up a new project using enclojure. I created the new project, then put a new .clj file in Project Sources. In that file, I typed: (defn main [] (print "hi")) ...which works in a REPL. But when I try to build the project, I get a big old stack trace (http://paste.lisp.org

Re: Clojure at JavaOne

2009-05-18 Thread Andrew Wagner
I can only speak from my experience, but the thing that really got my attention was the idea of 'code as data'. In particular, for me, looking through Koza's Genetic Programming book blew my mind. It would be cool to come up with a nice GP demo. On Mon, May 18, 2009 at 8:36 AM, Rich Hickey wrote:

Re: Saving the Clojure.org webiste

2009-05-19 Thread Andrew Wagner
Can I get it in a bedtime-story format too? :) On Tue, May 19, 2009 at 3:49 PM, Kei Suzuki wrote: > > I wanted to save the Clojure.org website so that I can read it when > I'm off-line. The problem is that none of the website downloader tools > I found is satisfactory; the pages don't look right

Architecture for a clojure project

2009-05-25 Thread Andrew Wagner
I'm trying to wrap my head around how to architect this project. I've got some functional programming experience (with Haskell), but am pretty new to Lisps, and feel a bit lost without the type system. So. The project is a chess AI. Now the nice thing is, there's a protocol for interacting with a

Re: Programming Clojure Arrives!

2009-05-28 Thread Andrew Wagner
I ordered mine today and look forward to getting it soon! On Thu, May 28, 2009 at 8:51 PM, Sean Devlin wrote: > > I just got my copy of Programming Clojure in the mail today. This is > the only time I expect to see the book in pristine condition, as I > know it will get bookmarked, highlighted,

Re: filter on sequence

2009-06-02 Thread Andrew Wagner
> > You can use destructuring in your predicate's arg list: > > Not to hijack the thread but...is there some reason clojure doesn't just just call this pattern-matching? Is it different somehow? --~--~-~--~~~---~--~~ You received this message because you are subscr

Re: filter on sequence

2009-06-02 Thread Andrew Wagner
> > Why doesn't Ruby just call it destructuring like Lisp has been doing > for decades? ;) > > So that non-academics have a prayer at not getting scared away by an unnecessarily-technical name? --~--~-~--~~~---~--~~ You received this message because you are subscri

Re: filter on sequence

2009-06-02 Thread Andrew Wagner
The same is true of irrefutable patterns in haskell. > > The difference is that a pattern match can fail, and in that case > other patterns are tried. Clojure's destructuring assumes that the > value has the right structure. If it doesn't, then you will get an > exception thrown. > > --~--~-

  1   2   3   4   >