Re: ANN: ClojureScript 0.0-3211

2015-04-25 Thread Allen Rohner
On Saturday, April 25, 2015 at 4:11:40 PM UTC-5, Allen Rohner wrote: > > > > On Saturday, April 25, 2015 at 12:02:08 PM UTC-5, Mike Fikes wrote: >> >> Hey Tony, try updating the version of Clojure in your project.clj to >> 1.7.0-beta1, which is used by 0.0-3211.

Re: ANN: ClojureScript 0.0-3211

2015-04-25 Thread Allen Rohner
On Saturday, April 25, 2015 at 12:02:08 PM UTC-5, Mike Fikes wrote: > > Hey Tony, try updating the version of Clojure in your project.clj to > 1.7.0-beta1, which is used by 0.0-3211. > > (In short, reader/read was given a second arity to allow options to be > passed, thus supporting #? conditi

Re: Are keys and vals guaranteed to return in the same order?

2015-04-18 Thread Allen Rohner
On Friday, April 17, 2015 at 4:40:07 PM UTC-5, Michael Blume wrote: > > > In other people's Clojure code I sometimes see things like > > (zipmap > (map some-fn (keys m)) > (map other-fn (vals m))) > > If it were my code I'd be much more inclined to write > > (into {} > (for [[k v] m] > [

[ANN] lein-docker, lein-beandock

2015-04-07 Thread Allen Rohner
https://github.com/arohner/lein-docker https://github.com/arohner/lein-beandock `lein-docker` is a simple plugin for performing `docker build` and `docker push`. lein-beandock is a semi-fork of `lein-beanstalk`, specializing in deploying docker containers to AWS Elastic Beanstalk. Thanks, All

Re: Continuously Integrating Leiningen Projects

2015-02-18 Thread Allen Rohner
CircleCI uses: https://github.com/circleci/lein-version-specs https://github.com/circleci/version-specs Which can be used to set the version string arbitrarily. Thanks, Allen On Wednesday, February 18, 2015 at 2:10:14 PM UTC-6, Michael Blume wrote: > > Afraid the plugin's internal. > > On Wed

Re: How to handle refactoring with TDD and mocking/stubbing

2015-01-08 Thread Allen Rohner
On Wednesday, January 7, 2015 at 2:49:50 PM UTC-6, Sean Corfield wrote: > > On Jan 7, 2015, at 10:21 AM, Allen Rohner > > wrote: > > As a design rule, I prefer making I/O fns (things that hit the DB or a > REST API), 'dumb', and perform all logic/processing in

Re: How to handle refactoring with TDD and mocking/stubbing

2015-01-07 Thread Allen Rohner
On Wednesday, December 31, 2014 8:48:27 AM UTC-6, Jonathon McKitrick wrote: > > I use TDD and mocking/stubbing (conjure) to test each layer of my code. > The problem is when I change the function signature and the tests do not > break, because the mocks/stubs do not know when their argument li

Re: [ClojureScript] Re: [ANN] Silk, an isomorphic routing library for Clojure and ClojureScript

2014-08-09 Thread Allen Rohner
I'd like to thank everyone in the community for both Silk, and Secretary. I'll throw out some (uninvited) feature requests I'd love to see in a future route-matching library. 1) Make trie-based route dispatching possible. A feature pedestal has/will soon have, is to compile the routing table

Available for Contracting

2014-06-09 Thread Allen Rohner
I hope this isn't frowned upon here, but here goes. I'm looking for freelance work while I figure out my next startup. Until recently, I was Founder & CTO of a startup of 10 engineers, the product is 100% Clojure (except for the UI, which was transitioning from Coffeescript to Clojurescript).

Re: [ANN] core.typed 0.2.0 - Production Ready

2013-08-28 Thread Allen Rohner
Awesome. Thanks for your hard work! Allen On Wednesday, August 28, 2013 3:28:35 PM UTC-7, Ambrose Bonnaire-Sergeant wrote: > > Hi, > > After 10 months and 26 0.1.x releases of transitioning core.typed from an > ambitious student project, I am finally comfortable recommending core.typed > for

Re: Seeking advice on a safe way to mock/stub fns

2013-03-24 Thread Allen Rohner
I've also run into the problem. You could write your own version of with-redefs (it's not that hard). In your case, it sounds like you're not running tests in parallel in the same process, so could you work around it by waiting for your app to finish initializing before running tests? Allen

[ANN] bond, a spying & stubbing library

2013-03-22 Thread Allen Rohner
I'd like to announce bond, a spying and stubbing library, intended for tests. https://github.com/circleci/bond Don't let the low version number scare you, we've been using it "in production" every day for several months. Allen -- -- You received this message because you are subscribed to

Re: lein-daemon 0.5

2013-01-16 Thread Allen Rohner
I've just released 0.5.0. I had to get a patch into leiningen to make things work in lein2, so you'll need to be using lein-2.0.0-RC1 or later. I've also updated the readme at https://github.com/arohner/lein-daemon Let me know how it goes! Allen -- You received this message because you are su

ANN clj-wallhack

2012-05-15 Thread Allen Rohner
I've resurrected old school clojure.contrib.java-utils/wall-hack- {method,field} into a new library https://github.com/arohner/clj-wallhack Thanks to hiredman for the original implementation. Allen -- You received this message because you are subscribed to the Google Groups "Clojure" group. To

Re: lein-daemon 0.3

2011-05-12 Thread Allen Rohner
> Can I use this in order to run, for examples, a lein ring session as a > deamon? :) > Yes, that exactly its intention. -- 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 f

lein-daemon 0.3

2011-05-11 Thread Allen Rohner
I've released a new version of lein-daemon. daemon is like 'lein run', only it runs the process in the background rather than blocking. 0.3 and up is a complete re-write, that no longer depends on apache commons daemon. The new version has no dependencies on any external programs. For more, see h

ANN lein-daemon, lein-test-out

2010-07-15 Thread Allen Rohner
I'd like to announce two new lein plugins, lein daemon and lein test- out. Lein-daemon is a wrapper around the Apache Commons Daemon, for starting a clojure process as a daemon. Lein test-out is a plugin for running your tests and outputting the results to junit or TAP (using clojure.test.junit a

Re: Inheriting from IDeref - good idea or bad practise?

2010-02-07 Thread Allen Rohner
I can't comment on style, but I can say I successfully made a protocol to implement SoftReferences: (deftype SoftRefHolder [#^java.lang.ref.Reference ref] clojure.lang.IDeref (deref [] (.get ref))) (defn soft-reference "returns a soft reference to x. Access using deref" [x] (le

Re: merge doesn't work on deftypes implementing IPersistentMap

2009-12-30 Thread Allen Rohner
> i'm hoping the "yet" part means it is slated to maybe someday be upgraded? I've filed a bug and submitted a patch. Assuming my fix is acceptable, this should be in soon. https://www.assembla.com/spaces/clojure/tickets/231-deftype-cons-doesn-t-support-maps- -- You received this message because

merge doesn't work on deftypes implementing IPersistentMap

2009-12-28 Thread Allen Rohner
I tried to call merge on a deftype implementing IPersistentMap, and got an exception: user> (deftype Foo [a b] clojure.lang.IPersistentMap) #'user/Foo user> (Foo 1 2) #:Foo{:a 1, :b 2} user> (merge (Foo 1 2) {:a 3}) ; Evaluation aborted. nth not supported on this type: PersistentArrayMap [Thro

Re: Hooks library. (Is this clojure-y?)

2009-12-06 Thread Allen Rohner
> What is it supposed to do?  What's the usage look like? > Oh right, a description would be useful. The point is to build up the functionality of a function from several places. You define a hook function: (defhook foo [a b]) Initially, it does nothing. Then, other code can add hooks: (add-ho

Hooks library. (Is this clojure-y?)

2009-12-06 Thread Allen Rohner
I started playing with the idea of a hooks library for Clojure, similar to Emacs hooks. You can see the code at http://gist.github.com/250575 Does this library have the Tao of Clojure? If hooks aren't a clojure-y way of doing things, what is? -- You received this message because you are subscr

Re: Datatypes and Protocols - early experience program

2009-11-24 Thread Allen Rohner
On Nov 12, 6:10 am, Rich Hickey wrote: > An early version of the code for a few important new language > features, datatypes[1] and protocols[2] is now available in the 'new' > branch[3]. Note also that the build system[4] has builds of the new > branch, and that the new branch works with curren

Re: Datatypes and Protocols - early experience program

2009-11-23 Thread Allen Rohner
On Nov 12, 6:10 am, Rich Hickey wrote: > An early version of the code for a few important new language > features, datatypes[1] and protocols[2] is now available in the 'new' > branch[3]. Note also that the build system[4] has builds of the new > branch, and that the new branch works with curren

Re: ANN: scriptjure, a library for generating javascript

2009-10-08 Thread Allen Rohner
> Did you try > (defmulti emit class) ? That is a good point. I'm actually not sure why I used type there. It's probably a bug. Thanks for pointing it out. Allen On Oct 8, 4:38 am, Emeka wrote: > Allen, > Great job! > > > Regards, > Emeka > > > > On Thu, Oct 8, 2009 at 7:18 AM, Meikel Brandmey

Re: ANN: scriptjure, a library for generating javascript

2009-10-08 Thread Allen Rohner
orms] (quasiquote (_js forms)) That and IMO, (clj foo) is slightly more readable than ~foo. Allen On Oct 8, 12:50 am, Jarkko Oranen wrote: > On Oct 8, 5:01 am, Allen Rohner wrote: > > > > > > > Hello, I'd like to announce the availability of a new library, called

ANN: scriptjure, a library for generating javascript

2009-10-07 Thread Allen Rohner
Hello, I'd like to announce the availability of a new library, called Scriptjure. It's a macro that generates javascript strings from Clojure s-exprs. My initial use for it is in glue code for Clojure webapps. For example: (js (fn foo [x] (var y 3) (return (+ x y => "funct

Re: Was it decided to add these functions to core?

2009-06-23 Thread Allen Rohner
> (range 0 :infinity 1) is not any shorter than (iterate inc 0) It's not shorter, but it is a lot more clear. That alone makes it worthwhile IMO. Allen --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" grou

Re: PermGen OutOfMemory error

2009-06-11 Thread Allen Rohner
I haven't hit the permgen issue, but it sounds like I have a similar setup to you. Out of curiosity, how do you redeploy while compiling your .clj files? I typically connect via Slime and use slime-load- file, which I assume calls (load filename) Allen On Jun 11, 1:23 pm, hughw wrote: > On Jun

unit testing private methods?

2009-06-02 Thread Allen Rohner
I have a namespace with some public functions, and some private functions. I would like to write unit tests for the functions, and put them in a separate file from the main name space. I would also like to have an (ns) declaration in my tests file, because the tests require several libraries. Of c

Re: test-expect functional mocking/expectation library

2009-04-13 Thread Allen Rohner
>Of course, it was not until I had an early working version that I discovered >Allen > Rohner's expectation tools, but I figured that mine were sufficiently > different to merit further development (at least relative to the > latest code of his I could find). > > > Suggestions for further changes

Re: "Transparent" delays

2009-04-12 Thread Allen Rohner
> > > user=> (= {:a 5 :b (delay 12)} {:a 5 :b 12}) > > false > > user=> (= {:a 5 :b (tdelay 12)} {:a 5 :b 12}) > > true > > You shouldn't ignore your nervousness in this case: > > user=> (= {:a 5 :b 12} {:a 5 :b (tdelay 12)}) > false > Out of curiosity, why are those different? Allen --~--~

Re: A large Clojure deployment

2009-04-07 Thread Allen Rohner
> It's deployed on an Ubuntu server on Amazon EC2.  Just one server for > now, but designed to scale to more.  No RDBMS! > Awesome, Congratulations. I was hoping to be the 2nd "famous" Clojure app, but it looks you beat me to it. :-) Can you go into detail about what/how you are persisting sinc

Re: inconsistency with ref & get

2009-03-30 Thread Allen Rohner
> I disagree. When you understand what's happening (Refs implement IFn > by dispatching, just like Vars), you see that it has nothing to do > with obtaining the value of a ref without deref, and get can't work > since it doesn't take a ref. > Thanks for the explanation. Since get can't work beca

inconsistency with ref & get

2009-03-29 Thread Allen Rohner
I noticed an inconsistency with refs and get: (def ref-map (ref {:a 1, :b 2})) (ref-map :a) => 1 (get ref-map :a) => nil Now I haven't seen any documentation that getting the value of a ref without a @/deref is supported at all, so maybe this isn't supported. But if those forms are supported,

Re: Turning a non-standard iterator into a seq

2009-03-25 Thread Allen Rohner
> Calling > >    (def input (BufferedReader. (FileReader. "data/dm4p1/dm4p1.dEID"))) >    (def data (RichSequence$IOTools/readFastaDNA input nil)) >    (doseq [d (bio-iterator-seq data)] (prn 'Sequence (show d))) > > Printed all the sequences from the file, as required. > > Just to be sure, is `d

Re: suggestion for resultset-seq and duplicate column names

2009-03-16 Thread Allen Rohner
On Mar 12, 1:32 pm, Ron Lusk wrote: > Works for me: I just overwrote my copy of resultset-seq with one that > uses getColumnLabel, and I am now getting the results I expected from > complex queries (in Interbase, at least). > > On Feb 23, 9:33 am, Rich Hickey wrote: > > > Sounds good to me - a

Re: mocking in clojure

2009-03-16 Thread Allen Rohner
On Mar 13, 3:35 pm, "Stephen C. Gilardi" wrote: > On Mar 13, 2009, at 4:10 PM, Stuart Sierra wrote: > > > Hi Allen, > > Sorry I haven't kept up with this. I think, though, that it's best to > > have it as a standalone library in clojure-contrib, so that people can > > use it with other testing

Re: Clojure, swank-clojure, and Debian

2009-03-14 Thread Allen Rohner
On Mar 14, 5:42 am, Javier wrote: > Ok, I can answer myself, thanks to maacl in the IRC: > > Download clojure-mode: > > git clone git://github.com/jochu/clojure-mode.git > > And put this: > > (add-to-list 'load-path "/path/to/clojure-mode") > (require 'clojure-mode) > > in .emacs, restart, and M-

Re: mocking in clojure

2009-03-13 Thread Allen Rohner
> > > Any other options out there? I posted a patch for test-is a while ago that never made it in, and I don't know why. http://groups.google.com/group/clojure/browse_frm/thread/883d4833f869f764/47a45325c8f29599?lnk=gst&q=test-is+expect+patch#47a45325c8f29599 The patch handles creating stub fun

Re: What profilers are you using?

2009-03-11 Thread Allen Rohner
pmf wrote: > On Mar 11, 4:41 am, Allen Rohner wrote: > > Replying to my own question because I figured it out. On the profiler > > tab, before you hit "start profiling", click the settings checkbox. > > Edit the "start from class" field. Mine was set

Resurrecting request for infinity

2009-03-10 Thread Allen Rohner
http://groups.google.com/group/clojure/browse_frm/thread/5e665ce7a318f44a/3ddb49bd3ca34709?lnk=gst&q=infinite+inc+0#3ddb49bd3ca34709 I would have replied to the above post, but google groups doesn't seem to want to let me. In it, Stephen Gilardi makes the case for a fn equivalent to "(iterate inc

Re: What profilers are you using?

2009-03-10 Thread Allen Rohner
> Can you go into more detail about how you used visualvm? I'm trying to > run it (visualvm 1.1.1), and it seems to have a race condition with > the clojure classloader. Sometimes it won't find all of the compiled > clojure source, and sometimes it will correctly profile methods until > I reload

Re: What profilers are you using?

2009-03-10 Thread Allen Rohner
On Feb 7, 9:16 am, David Powell wrote: > Newer versions of JDK 1.6, eg Update 11, have an application called > 'jvisualvm' in the bin directory. It lets you attach to any running > Java process and it has aprofilerthat you can switch on at runtime. > > It seems quite good. It does profiling via

Re: Chrono date library

2009-03-07 Thread Allen Rohner
> > Yes, but any library that requires third-party jars can't be used out of > the box in contrib, and I think a language that doesn't support > date-processing out of the box is at a severe disadvantage. > One of the primary reasons Clojure is on the JVM is to re-use Java libraries. Date & Time

Re: Chrono date library

2009-03-06 Thread Allen Rohner
> > What's the status of this JSR? Is it possible the JDK 7 will include > more palatable date processing capabilities? I think it would be a shame > if external libraries were required to get sane date processing in > Clojure, but if the JDK 7 has potential to fix it, that's encouraging. > As f

Re: Chrono date library

2009-03-05 Thread Allen Rohner
On Mar 5, 6:10 pm, Phil Hagelberg wrote: > Allen Rohner writes: > > I strongly recommend that you make sure you understand where and why > > Joda differs from the Java standard lib. If you don't handle the cases > > that Joda already does, you *will* have bug

Re: Chrono date library

2009-03-05 Thread Allen Rohner
On Mar 5, 5:49 pm, Phil Hagelberg wrote: > Cosmin Stejerean writes: > > I like the API so far, although I'll probably have to wait for > > timezone support before I can start using this. > > Would love some suggestions on what you'd expect the API to look like > for this. Failing test cases wo

Re: Opinions on -> macro? (was Re: Extensive use of let?)

2009-02-27 Thread Allen Rohner
> > It's pretty useful for nested keywords: > >   (:name (:profile (:user message))) > >   (-> message :user :profile :name) > > - James That is really cool. Once again the language and the community impress me with how elegant the language is. Allen --~--~-~--~~~--

Re: Mathy operations on non-numerics (was "Adding" strings)

2009-02-26 Thread Allen Rohner
If we wrote (add 2 3), there would be no confusion at > all about what (add "foo" 2) should do, because you'd be writing (conj > "foo" (str 2)) I wrote this too hastily. This could more easily be written (str "foo" 2) --Allen --~--~-~--~~~---~--~~ You received th

Re: Mathy operations on non-numerics (was "Adding" strings)

2009-02-26 Thread Allen Rohner
> I agree regarding concatenation as well, but I think the case for > comparison of non-numerics is still pretty strong. > > -Phil Are you referring to using <, >, =, with objects that implement java.lang.Comparable? i.e. given x.compareTo(y) == -1 (< x y) => true I would find that useful. Al

Re: Mathy operations on non-numerics (was "Adding" strings)

2009-02-26 Thread Allen Rohner
> > So my vote is that String are atomic built in objects, and at least +, < > and > should work with Strings.  The behavior should be just like Java, > so (+ "foo" 2) --> "foo2" > -1 Concatenation is not addition. I'm almost opposed to numeric operators all together. If we wrote (add 2 3), the

Re: test-is: is called? [PATCH]

2009-02-05 Thread Allen Rohner
On Jan 6, 10:06 pm, Allen Rohner wrote: > I had to revisit my test stubbing/expectation code after the recent > changes to test-is. The good news is, because of the excellent change > to make "is" a multi-method, the expectation code easily fits into > test-is. The foll

Re: improvement: make main.clj not die when exception in --init

2009-01-31 Thread Allen Rohner
> Patch welcome. > > Rich http://code.google.com/p/clojure/issues/detail?id=62&colspec=ID%20Type%20Status%20Priority%20Reporter%20Owner%20Summary --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To

improvement: make main.clj not die when exception in --init

2009-01-30 Thread Allen Rohner
A minor annoyance of mine is that clojure.main exits if there is an exception in an --init file, even if you ask for a repl. i.e. java -cp clojure.jar clojure.main --init file-with-errors.clj -r It would be useful to get to the repl so I can read doc strings and experiment with solutions. I have

very simple javascript source using clojurescript?

2009-01-21 Thread Allen Rohner
Chouser, how usable is clojurescript to generate extremely simple javascript calls? When creating HTML templates, I find myself using ugly string interpolation to generate the .js. I would really love it if I could do something like: (clojurescript/str (swfobject/embedSWF "open-flash-chart.swf" "

Re: How to implement "go to definition" and "find all references"

2009-01-16 Thread Allen Rohner
On Jan 16, 9:32 am, Peter Wolf wrote: > Hello, and thanks for all the help with the IntelliJ plugin. > > The next feature I want to implement is "references".  That is, one > selects a symbol, and then can go to the location where that symbol was > defined (e.g. def, defn, let, etc.).  One can

test-is: set! *e

2009-01-14 Thread Allen Rohner
Here's a trivial patch that I've found useful. After catching an uncaught exception in a test, set! *e so you can examine the stack trace afterward. === --- src/clojure/contrib/test_is.clj (revision 314) +++ src/clojure/contrib/t

Re: Can't lookup java.lang.Long keys in a map using int literal

2009-01-13 Thread Allen Rohner
I still find this confusing, but thanks for the quick response. > In general, you should use uniform types for hash keys. I thought I was using all ints, but it turns out that a java API returned a long when I thought it returned an int. So then my map had some keys that were ints and some that

Can't lookup java.lang.Long keys in a map using int literal

2009-01-12 Thread Allen Rohner
Keys in a map that are of type long can't be looked up in a map using int literal syntax: user=> (def my_map { (java.lang.Long. "42") "foo"}) #'user/my_map user=> my_map {42 "foo"} user=> (my_map 42) nil user=> (my_map (long 42)) "foo" user=> (= 42 (java.lang.Long. "42")) true I found this b

Re: test-is: is called? [PATCH]

2009-01-08 Thread Allen Rohner
On Jan 8, 10:27 am, Stuart Sierra wrote: > Nice work, Allen.  I want to add stubs/mocks to test-is.  One question > -- would it work without Var.pushThreadBindings, maybe using a > combination of "with-local-vars" and "binding"? > It should be possible to make that work with binding. I did it

test-is: is called? [PATCH]

2009-01-06 Thread Allen Rohner
I had to revisit my test stubbing/expectation code after the recent changes to test-is. The good news is, because of the excellent change to make "is" a multi-method, the expectation code easily fits into test-is. The following patch adds a new assertion for is, (is (called?)) ;; creates a stub

Re: Multiple table SELECT problem

2009-01-05 Thread Allen Rohner
I made a post about this in October, with an attached patch. I guess it got lost in the shuffle. http://groups.google.com/group/clojure/browse_frm/thread/e533e9cdf758f210?q=#43e5775c2d959dc7 I'll file a bug and attach the patch. Allen --~--~-~--~~~---~--~~ You r

Re: reload library, blowing away old public symbols

2008-12-16 Thread Allen Rohner
On Dec 16, 4:55 pm, Stuart Sierra wrote: > I would find this useful; I've even tried writing it in the past. > Perhaps it could go in clojure.contrib.ns-utils. > > A thought -- would it be more thorough to use "remove-ns"? > > -the other Stuart (Sierra) > > On Dec 16, 4:32 pm, Stuart Halloway wr

test-is uncaught exception behavior

2008-12-15 Thread Allen Rohner
In recent versions of test-is, it appears that exceptions are only caught inside of the 'is' macro, as opposed to during the whole test run. This is a problem when running test-is from slime, because when a test throws an exception outside of the 'is' macro, it requires user intervention to handle

Re: clojure.contrib.test-is: first major rewrite

2008-12-07 Thread Allen Rohner
One other feature idea: I'd like the ability to run individual tests. Once I've discovered a unit test failure, I want to be able to run the test by itself without the noise from other tests. Allen --~--~-~--~~~---~--~~ You received this message because you are sub

Re: clojure.contrib.test-is: first major rewrite

2008-12-07 Thread Allen Rohner
> In the mean time; I'm happy to hear about what you think, and > any other improvements I could make to the library.  Some things I > have in mind for the next version: > > 3. Adding test metadata to vars that are already defined elsewhere. > I had a related idea the other night. I commonly like

Re: Accept RE Pattern in (find-doc ...)?

2008-12-02 Thread Allen Rohner
On Dec 2, 10:03 am, Randall R Schulz <[EMAIL PROTECTED]> wrote: > Hi, > > I was thinking it would be nice if (find-doc ...) accepted a Pattern (in > addition to the String it now accepts), thus allowing #"RE pattern" > regular expression pattern literals. > > What do Rich and others think? > > R

expectation framework

2008-11-23 Thread Allen Rohner
I've been working on a small library to assert that functions are called during a unit test. The syntax looks like: (calls [[user/foo :times 2 :returns 3] [user/bar :returns 42]] (fn-being-tested)) This will assert that foo is called exactly twice, and bar is called exactly once

Re: with-gensyms

2008-11-20 Thread Allen Rohner
On Nov 20, 1:58 pm, Rock <[EMAIL PROTECTED]> wrote: > I've done my best to get a good enough grasp of how macros and syntax- > quotes work in Clojure. While waiting for some more detailed > documentation (thanks Meikel), I thought I'd work on something > practical. Here's my attempt at writing a

Re: (Newbie) Are lexically-scoped methods possible?

2008-11-18 Thread Allen Rohner
On Nov 18, 11:53 pm, samppi <[EMAIL PROTECTED]> wrote: > Yes, but I meant creating methods rather than regular functions, in a > lexical scope. Is it possible to create methods using fn? > What do you mean by methods as distinct from functions? In clojure there are only functions. Are you referr

Re: (Newbie) Are lexically-scoped methods possible?

2008-11-18 Thread Allen Rohner
On Nov 18, 6:48 pm, samppi <[EMAIL PROTECTED]> wrote: > I'm trying to unit-test a library with which a user can define methods > on the library's multi-function to change its behavior. So I need to > be able to define lexically-scoped methods in each test. Is it > possible to use let to create a

Re: General question, what are using for clojure?

2008-11-18 Thread Allen Rohner
On Nov 18, 5:16 pm, BerlinBrown <[EMAIL PROTECTED]> wrote: > What projects have you used clojure for?  Have you completed them? Are > they one-off projects.  Small big?  Is it web based, a GUI? > > I am working on this, haven't made much progress but at least I > started. > > http://code.google.co

Re: Eager map?

2008-11-17 Thread Allen Rohner
>. If you really need strict evaluation, wrap the map with > doall. Another way to do that would be to use doseq. Allen --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send e

Re: Standard Error to the REPL under Slime?

2008-11-13 Thread Allen Rohner
On Nov 7, 3:00 am, [EMAIL PROTECTED] wrote: > Hey folks, > > Is there a way to get the System.err directed to the slime-repl > clojure buffer instead of (or in addition to) inferior-lisp buffer?  I > looked through the docs, but I didn't see anything obvious. > > Thanks! > --Darren I'd also lik

Re: Clojure Maven integration

2008-11-06 Thread Allen Rohner
On Nov 6, 1:20 pm, "Brian Doyle" <[EMAIL PROTECTED]> wrote: > Does anyone know of any Clojure maven integration? > What I'd like to see is something that will modify Clojure's > classpath updated based upon a given pom.xml file. > Thanks. There's this: http://www.bitbucket.org/achimpassen/cloj

Re: troubleshooting classloader problems

2008-10-28 Thread Allen Rohner
On Oct 28, 8:48 am, Stuart Halloway <[EMAIL PROTECTED]> wrote: > Hi all, > > When I am troubleshooting classloader problems I find myself wanting   > to know the list of URLs currently on the classpath. I didn't find   > this exposed anywhere, so I wrote the functions below. > > Usage: > > (take 3

Re: Debugging with JSwat

2008-10-21 Thread Allen Rohner
> I wonder if this doesn't have something to do with the fact that I'm > doing everything via the REPL. Is it possible to break on code you've > evaluated via M-x slime-eval-buffer? I'm able to set breakpoints in > (e.g.) boot.clj. I think it does. The compiler associates a file name line number

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

2008-10-17 Thread Allen Rohner
On Oct 17, 4:27 am, "Rastislav Kassak" <[EMAIL PROTECTED]> wrote: > Hello Clojurians, > > I think after 1st year of Clojure life it's good to check how far has > Clojure spread all over the world. > > So wherever are you come from, be proud and say it. > Austin, Texas Allen --~--~-~--

Re: Can macros be used for blunt token-pasting?

2008-10-16 Thread Allen Rohner
> > I've wanted to do this type of thing before (with CL) and generally > try to avoid it, so I'll share my reason: the declaration does not > appear in source code.   I completely agree with you. That being said, clojure does have a very useful, underrated feature that makes this kind of problem

Re: with-open binding form

2008-10-13 Thread Allen Rohner
> I noticed with-open kind of stuck out because it doesn't use vectors > for binding like let, loop, and others. I had a similar comment about doseq. I don't think the obstacle is the technical challenge, but rather Rich's decision about whether to do it or not. This would be a breaking change, o

Re: REPL does not print stack trace in some cases

2008-10-11 Thread Allen Rohner
er <[EMAIL PROTECTED]> wrote: > On Sat, Oct 11, 2008 at 1:26 PM, Allen Rohner <[EMAIL PROTECTED]> wrote: > > > If you exercise the bug in my previous post about resultset-seq, the > > repl will not print a stack trace, it will only print the name of the > > exception

REPL does not print stack trace in some cases

2008-10-11 Thread Allen Rohner
If you exercise the bug in my previous post about resultset-seq, the repl will not print a stack trace, it will only print the name of the exception and the message. The following patch modifies the repl to print the stack trace. Allen Index: src/jvm/clojure/lang/Repl.java =

BUG: resultset-seq breaks on duplicate column names

2008-10-11 Thread Allen Rohner
If you create a SQL query that returns duplicate names, resultset-seq throws an exception: "java.lang.RuntimeException: java.lang.IllegalArgumentException: Too many arguments to struct constructor" i.e. (let [rs (query "select description,description from table")] (resultset-seq rs) The foll

Re: can we change how contains? works for vectors

2008-10-03 Thread Allen Rohner
> It is not necessary. All Java collections can already be turned in to > sets using set: > > (set (java.util.ArrayList. [1 2 3 4 5 3 2])) > #{1 2 3 4 5} > > Enumerations are not collections, but can be turned into seqs > (manually only) using enumeration-seq. > > Rich It's always great to see st

Re: can we change how contains? works for vectors

2008-10-03 Thread Allen Rohner
> The main reason, which I discussed with Hans on IRC, is that they have > bad performance characteristics. Lists and vectors make for bad sets, > and alists make for bad maps, with linear lookup times. Clojure has > real sets and maps, with reader and library support. I ran into this problem las

Re: Printing documentation

2008-10-01 Thread Allen Rohner
On Oct 1, 1:48 pm, Hans Hübner <[EMAIL PROTECTED]> wrote: > Hi, > > I know it has been asked for in April and been answered with "no", but > maybe it changed since then.  Has anybody come up with a good way to > print the online documentation?  I am not looking for anything fancy, > and a CSS styl

Re: Clojure at the JVM Languages Summit

2008-09-30 Thread Allen Rohner
> > Thanks. The summit was really fantastic - so many interesting and > smart people and lots of great presentations and conversations. Left > me exhausted and a bit MIA here, which I'm afraid will continue > through my talk Monday at the Boston Lisp Group: > > http://fare.livejournal.com/134108.

Re: Native library calls from Clojure via JNA

2008-09-29 Thread Allen Rohner
On Sep 29, 1:09 pm, Aaron Brooks <[EMAIL PROTECTED]> wrote: > I've had success using JNA to call system libraries I thought I'd post > an example snippet in case it helps someone else. This looks very cool. I didn't know it would be this easy. Thanks for the example. Allen --~--~-~--~

Re: Current Projects

2008-09-29 Thread Allen Rohner
> I have been looking into Clojure and I am looking for active projects > using Clojure so that I can look at production code. I don't know of much public code yet. Here are a few ideas though: * rhickey's ants demo http://clojure.googlegroups.com/web/ants.clj?gda=hYoBxzoAAABoLitVpBTEcNIQc_NHg39

Re: assert raises

2008-09-25 Thread Allen Rohner
On Sep 25, 8:33 pm, Stuart Sierra <[EMAIL PROTECTED]> wrote: > Hi Allen, > Here's the result, which I just committed: Cool, thanks. Allen --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to

assert raises

2008-09-23 Thread Allen Rohner
Here's a first pass at an addition to test_is, the assert-raises macro. It asserts that the given expression throws an exception of the specified type. There are two things I don't like about this implementation: the name doesn't quite go with the test_is theme, and the (is :a :a) at the bottom.

Re: "Getting Started" is NOT starting for me...

2008-09-19 Thread Allen Rohner
On Sep 19, 1:10 pm, ".Bill Smith" <[EMAIL PROTECTED]> wrote: > I see the same problem on Windows XP SP 3. > > % java -version > java version "1.6.0_03" > Java(TM) SE Runtime Environment (build 1.6.0_03-b05) > Java HotSpot(TM) Client VM (build 1.6.0_03-b05, mixed mode) > Works for me on XP SP2. $

Re: Improved compiler error messages, part 2

2008-09-19 Thread Allen Rohner
> > I've enhanced handling of reader errors during load (rev 1033), see if > that helps. > > Rich Looks good. Thanks! Allen --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, s

Re: Improved compiler error messages, part 2

2008-09-18 Thread Allen Rohner
> > Reader errors don't tell you the name of the file that had problems: > > eof.clj: > > (defn foo [a] >    (println "hello") > > $ java -cp clojure.jar clojure.lang.Repl eof.clj > java.lang.Exception: ReaderError:(3,1) EOF while reading >         at clojure.lang.LispReader.read(LispReader.java:

Re: Patch to provide special form documentation online (doc, find-doc)

2008-09-18 Thread Allen Rohner
> > > There's simply no substitute for reading the special forms page on the > > site, and everyone who intends to use Clojure should do so in its > > entirety. > > > If we want to make it so (doc def) et al do something, they should > > return the simple message: > > > Please see:http://clojure.

Re: Improved compiler error messages, part 2

2008-09-18 Thread Allen Rohner
Ok, I have a new one. Reader errors don't tell you the name of the file that had problems: eof.clj: (defn foo [a] (println "hello") $ java -cp clojure.jar clojure.lang.Repl eof.clj java.lang.Exception: ReaderError:(3,1) EOF while reading at clojure.lang.LispReader.read(LispReader.ja

Re: Improved compiler error messages, part 2

2008-09-18 Thread Allen Rohner
> I've made some enhancements to the location info (rev 1031), see if > that helps. > > Rich This looks good. Thanks! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email

Re: Improved compiler error messages, part 2

2008-09-17 Thread Allen Rohner
Ok, concrete. Here's one mistake I made the other day. I created a ref, and then forgot to access it using @. The example code is (def my_map (ref {:a 1, :b 2})) (def map_vals (vals my_map)) $ java -cp clojure-clean.jar clojure.lang.Repl bad-ref.clj java.lang.IllegalArgumentException: Don't kno

Re: Improved compiler error messages, part 2

2008-09-17 Thread Allen Rohner
> It seems to me you need to distinguish runtime errors from compilation > errors. For runtime errors, the file and line numbers are already in > the stack trace, as Clojure emits that information in the bytecode. > For example, in the above trace: > > >         at user.eval__2291.invoke(broken-a

  1   2   >