Re: Sierra's Component

2024-04-06 Thread Paul Stadig
You can do either. If you pass the config as a dependency, then you have to access it in the `start` method after dependency injection has occurred. Sometimes it is useful to write a constructor function to initialize the component. If that constructor needs access to the config it must be passed

Re: variable name duplicate

2022-07-30 Thread Paul Stadig
I'm pretty sure what is happening is the Clojure compiler is munging "x-" into "x_" but since you already have an "x_" you get an exception. On Sat, Jul 30, 2022, 5:23 AM vinurs wrote: > hello, > i have the following code: > ``` > (let [x- 1 x_ 2] (fn [] [x- x_])) ; => Throws: Duplicate field na

Re: [?] alter-var-root and *out*

2021-09-01 Thread Paul Stadig
`*out*` may have a thread binding established. REPLs will often do this. If `*out*` is thread bound you should be able to use `thread-bound?` to check that and then `set!` to set it, but you have to be careful because https://clojure.atlassian.net/browse/CLJ-1077 On Wed, Sep 1, 2021 at 4:58 AM Ph

Re: Strange result for clojure.core/time

2020-04-11 Thread Paul Stadig
The output of `time` is in milliseconds and the output of `with-timer-print` is in seconds. So to make them comparable: `time` 0.01344 msec `time` with eval 0.922536 msec `with-timer-print` 0.048 msec `with-timer-print` with eval 1.041 msec The `with-timer-print` version is slower, and I suspect

Re: with-open pattern

2017-05-10 Thread Paul Stadig
this object like a sequence, it will fully consume the input > stream and fully realize the decoded data in memory." > > I'm specifically trying to avoid realizing the full collection in memory, > because it won't fit. > > On Thursday, May 4, 2017 at 11:22:36 AM UT

[ANN] pjstadig/reducible-stream 0.1.0

2016-08-19 Thread Paul Stadig
I have released a library for fusing a stream, decoder, and resource management into a reducible object with the intent to automatically manage resources. You can then apply a transducer to this object. This means you can apply a transducer pipeline that only partially consumes the stream, yet

Re: Hiring Clojure developers for our distributed team at Outpace Systems

2014-02-19 Thread Paul Stadig
On Wednesday, February 19, 2014 10:50:54 AM UTC-5, Michael Klishin wrote: > > > Paul, > > I believe last time candidates from non-US timezones were not considered. > Is it still the case? I'm pretty sure plenty of potential candidates on > this list care to know. > We like to be able to pair (thi

Hiring Clojure developers for our distributed team at Outpace Systems

2014-02-19 Thread Paul Stadig
than ourselves. Whatever the case, I'm happy to talk for 5-10 minutes, and if that doesn't result in hiring, then at least I made a new friend, right? :) I can do Skype, Google Hangouts, e-mail, IRC, whatever works for you. Paul Stadig p...@stadig.name paul.sta...@outpace.com http://gith

Re: ANN: byte vector backed, utf8 strings for Clojure

2013-11-07 Thread Paul Stadig
On Thursday, November 7, 2013 2:57:03 PM UTC-5, Andy Fingerhut wrote: > > Very cool. > > I read through your README (thank you for that), and did not notice an > answer to the question of: does seq on a utf8 string return a sequence of > Unicode code points? Java UTF-16 code points (with pairs o

ANN: byte vector backed, utf8 strings for Clojure

2013-11-07 Thread Paul Stadig
I have released a byte vector backed, utf8 string library for Clojure. It exists because when doing lots of ASCII string processing, Java strings can be pretty hefty. Using byte arrays to represent strings can be annoying for various reasons (mutability, bad equality semantics). However, byte vecto

Re: JVM assertions in Clojure

2013-10-14 Thread Paul Stadig
/disable assertions at runtime in Clojure without any penalty. https://github.com/pjstadig/assertions Paul On Mon, Oct 14, 2013 at 2:37 PM, Paul Stadig wrote: > On Mon, Oct 14, 2013 at 5:59 AM, Phillip Lord < > phillip.l...@newcastle.ac.uk> wrote: > >> writes: >&g

Re: JVM assertions in Clojure

2013-10-14 Thread Paul Stadig
On Mon, Oct 14, 2013 at 5:59 AM, Phillip Lord wrote: > writes: > > Same trick as > Java -- optimise the check away at compile time. > > Indeed, this is how Clojure's assert works. > This is the way Clojure's assert works (by compiling away the assertion). This is not the way Java assertions work

Re: [ANN] scopes: a little library for resource scopes

2013-10-13 Thread Paul Stadig
scoping concept. It can evolve from there. Paul On Sat, Oct 12, 2013 at 10:11 AM, Jozef Wagner wrote: > Is it based on http://dev.clojure.org/display/design/Resource+Scopes ? > > On Friday, October 11, 2013 3:54:59 PM UTC+2, Paul Stadig wrote: >> >> It separates the resource

Re: [ANN] scopes: a little library for resource scopes

2013-10-11 Thread Paul Stadig
(with-open ...) doesn't do? Generalize to other > cleanup methods than (.close x)? > > > On Fri, Oct 11, 2013 at 6:36 AM, Paul Stadig > > wrote: > >> I have released version 0.1.0 of scopes, a little library for resource >> scopes. It can be used to establish

[ANN] scopes: a little library for resource scopes

2013-10-11 Thread Paul Stadig
I have released version 0.1.0 of scopes, a little library for resource scopes. It can be used to establish a resource scope with the with-resource-scope macro. Within the dynamic extent of that macro one can register a resource with the scoped! function so that when the macrco block goes out of

Re: JVM assertions in Clojure

2013-10-11 Thread Paul Stadig
As reflected in the linked discussion and Jira ticket, it seems possible to be able to use -ea/-da with Clojure. It would definitely require a compiler change, and I'm not aware of any further movement to make Clojure's asserts use a mechanism compatible with -ea/-da. An additional annoyance (a

Re: JVM assertions in Clojure

2013-10-11 Thread Paul Stadig
The problem is that you would still have a performance hit. As I understand, the reason that Java assertions have no runtime penalty when disabled is because they depend on the value of a final field in a class which the JIT will eliminate as dead code when that final field is set to false. The

Re: Performance issue with hashing records

2013-02-04 Thread Paul Stadig
On Sunday, February 3, 2013 9:56:49 PM UTC-5, puzzler wrote: > > In these examples, the map/record is freshly created each time through the > loop, so caching should not be a factor. > Good point. So maybe it's not the caching :). Another factor is that literal hashmaps are actually Persistent

Re: Performance issue with hashing records

2013-02-03 Thread Paul Stadig
On Sunday, February 3, 2013 1:07:41 AM UTC-5, puzzler wrote: > > I just went through the process of converting my map-based program over to > records, hoping it would improve speed. Much to my dismay, it actually > slowed my program down substantially. With some profiling, I discovered > that

ANN: nio 0.0.4

2013-01-29 Thread Paul Stadig
Wanted to let everyone know that I've released nio 0.0.4 on Clojars. nio is a library that extends clojure.java.io support to the java.nio classes. The 0.0.4 release adds two convenience functions for reading and setting the byte order of ByteBuffers. You can find out details and example usage at h

Re: Auto-indentation not working with clojure-mode 2.0.0

2013-01-01 Thread Paul Stadig
This was an intentional change. https://github.com/technomancy/clojure-mode/pull/89 On Jan 1, 4:15 am, Richard Elliott wrote: > I've just installed emacs and clojure-mode on a new machine. Out of the box > auto-indentation did not work for me. I noticed that in the latest release > of clojure-mo

Re: ANN: polyfn

2012-10-09 Thread Paul Stadig
On Tuesday, October 9, 2012 9:37:20 AM UTC-4, tbc++ wrote: > > >> Polyfns are exactly as fast as protocol functions (I am using the same > >> caching and dispatch code), but they do not generate a Java interface, > >> and they are slightly simpler to define. > > So I guess I have to ask the questio

Re: ANN: polyfn

2012-10-09 Thread Paul Stadig
On Tuesday, October 9, 2012 7:24:57 AM UTC-4, Tassilo Horn wrote: > > I'm happy to have complemented my questions with at least a bit useful > feedback and pointers. :-) At least this latter point is a blocker for > trying to replace my protocols with polyfns right now. > Yeah, thanks for the f

Re: ANN: polyfn

2012-10-09 Thread Paul Stadig
On Tue, Oct 9, 2012 at 2:40 AM, Tassilo Horn wrote: > Ah, so if I change a polyfn for a type X, the new behavior will only be > available to new X instances, right? If you change a polyfn implementation for a type X, then the new behavior will be available to all instances of X, even those create

Re: ANN: polyfn

2012-10-09 Thread Paul Stadig
On Mon, Oct 8, 2012 at 10:46 PM, Frank Siebenlist wrote: > Interesting project, although I'm still a little unclear about the > "convincing" use cases where you would choose polyfn over protocols... > > Also, how does the polyfn implementation compare to the clojurescript > protocol implementati

Re: ANN: polyfn

2012-10-08 Thread Paul Stadig
On Monday, October 8, 2012 1:55:50 PM UTC-4, Tassilo Horn wrote: > > Paul Stadig > writes: > > Hi Paul, > > > I created a library for Clojure to do open, single dispatch > > polymorphism. What does this mean? > > > > * A polyfn dispatches on the type

Re: ANN: polyfn

2012-10-08 Thread Paul Stadig
On Mon, Oct 8, 2012 at 11:33 AM, Timothy Baldridge wrote: > >>> Define some implementations for specific types. >>> >>> (require '[name.stadig.polyfn :refer [defpolyfn]]) >>> (defpolyfn foo Long [exp] (inc exp)) >>> (defpolyfn foo String [exp] "Hello, World!") > > I like the idea, but it seems

ANN: polyfn

2012-10-08 Thread Paul Stadig
I created a library for Clojure to do open, single dispatch polymorphism. What does this mean? * A polyfn dispatches on the type of its first argument. * You can add an implementation for a new type to an existing polyfn. * You can define a new polyfn on an existing type. Polyfns are exactly as f

[ANN] nio: Clojure support for java.nio

2012-08-25 Thread Paul Stadig
I have done a little library to provide better support in Clojure for java.nio. It covers three main areas: 1) extending clojure.java.io to cover java.nio type where reasonable, 2) providing a set of coercion functions for java.nio types (similar to those for java.io provided by clojure.java.io), a

Re: ClojureC - A Clojure to C compiler - Work in Progress

2012-07-09 Thread Paul Stadig
On Mon, Jul 9, 2012 at 12:12 PM, Paul Stadig wrote: > On Mon, Jul 9, 2012 at 12:07 PM, Mark Probst wrote: >> Yes. I'm sorry I forgot to mention that. Please let me know if it >> works and I'll update the README. > > It works with lein2. The tests are running now

Re: ClojureC - A Clojure to C compiler - Work in Progress

2012-07-09 Thread Paul Stadig
On Mon, Jul 9, 2012 at 12:07 PM, Mark Probst wrote: > Yes. I'm sorry I forgot to mention that. Please let me know if it > works and I'll update the README. It works with lein2. The tests are running now, but there are some failures. I'll keep poking at it. Thanks! Paul -- You received this m

Re: ClojureC - A Clojure to C compiler - Work in Progress

2012-07-09 Thread Paul Stadig
On Mon, Jul 9, 2012 at 11:50 AM, Mark Probst wrote: > On Mon, Jul 9, 2012 at 5:47 PM, Paul Stadig wrote: >> I checked out the code and followed the instructions to setup glib2 >> and the GC. When I run `lein test` "I get Exception in thread "main" >> java

Re: ClojureC - A Clojure to C compiler - Work in Progress

2012-07-09 Thread Paul Stadig
Mark, This looks interesting. Thanks for working on this. I checked out the code and followed the instructions to setup glib2 and the GC. When I run `lein test` "I get Exception in thread "main" java.io.FileNotFoundException: Could not locate clojurec/ core__init.class or clojurec/core.clj on cla

Re: Scheme dotted pair equivalent in Clojure

2012-06-17 Thread Paul Stadig
On Jun 16, 11:37 am, David Nolen wrote: > Not possible in Clojure and a source of hassle in Scheme and Common Lisp. > If you have dotted pairs you can never know if you have a proper list. I'm probably missing some context, but I've heard this argument before and had a hard time understanding it.

Re: Clojure 1.3 treatment of integers and longs

2012-03-07 Thread Paul Stadig
On Sunday, October 23, 2011 5:21:52 PM UTC-4, Rich Hickey wrote: > > Hi all, > > This reply is to the thread, not Luc specifically. > > Thanks everyone for your feedback and input. > > I have pushed 3 commits: > > 1) Fixes the inconsistency between the hash function used by Clojure maps > (was .

Sonian is looking for Clojure Developers

2012-01-03 Thread Paul Stadig
ftware Engineer, Cloud". Happy New Year! Paul Stadig -- 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: Clojure 1.3 treatment of integers and longs

2011-10-23 Thread Paul Stadig
On Sun, Oct 23, 2011 at 4:01 PM, Luc Prefontaine < lprefonta...@softaddicts.ca> wrote: > It's simpler to use one representation to port the core. You can choose the > fastest/efficient one. You do not have to carry all these intermediate > types > with you. > There are already at least two numeri

Re: Clojure 1.3 treatment of integers and longs

2011-10-23 Thread Paul Stadig
On Sat, Oct 22, 2011 at 5:51 PM, Stuart Halloway wrote: > I am dropping off this thread now. At this point I think it would be more > useful for me (or someone) to expand the notes about numerics into better > documentation, rather than continuing this rambling point-by-point treatment > without

Re: Clojure 1.3 treatment of integers and longs

2011-10-23 Thread Paul Stadig
On Sat, Oct 22, 2011 at 7:53 PM, Luc Prefontaine < lprefonta...@softaddicts.ca> wrote: > > Ha ! Ok, I missed the digression here and I now understand the issue. > Considering that a PersistentArrayMap may eventually become a > PersistentHashMap > this opens the door to *funny* bugs. > > Is this th

Re: Clojure 1.3 treatment of integers and longs

2011-10-22 Thread Paul Stadig
On Sat, Oct 22, 2011 at 5:42 PM, Luc Prefontaine < lprefonta...@softaddicts.ca> wrote: > What's missing from your shortened example ? > I think what you want is the example I posted originally: user=> (get {(Long. -1) :here} (Integer. -1)) :here That works fine because you are actually creating

Re: Clojure 1.3 treatment of integers and longs

2011-10-22 Thread Paul Stadig
Luc, On Sat, Oct 22, 2011 at 3:40 PM, Luc Prefontaine < lprefonta...@softaddicts.ca> wrote: > All the contracts you mention are language centric, each of them defined > their contract according > to their own needs. Clojure should have the right to do so. > The contract is required for implement

Re: Clojure 1.3 treatment of integers and longs

2011-10-22 Thread Paul Stadig
On Sat, Oct 22, 2011 at 1:49 PM, Luc Prefontaine < lprefonta...@softaddicts.ca> wrote: > > Java != JVM. > > That's a too common mistake. Integer vs Long, Byte, ... are Java creations. > They have nothing to do with the JVM primitive data types. > > Clojure implements a semantic different than Java

Re: Clojure 1.3 treatment of integers and longs

2011-10-22 Thread Paul Stadig
On Sat, Oct 22, 2011 at 9:48 AM, Chas Emerick wrote: > If Clojure's primary objective were Java interop, I might agree with you. > However, it's not, and it's bizarre to see someone argue that this is not > broken: > > user=> (.equals (Integer. -1) (Long. -1)) > false > > Sure, not broken accord

Re: Clojure 1.3 treatment of integers and longs

2011-10-22 Thread Paul Stadig
On Wednesday, October 19, 2011 10:38:56 AM UTC-4, stuart@gmail.com wrote: >Integers and longs are going to be painful no matter what because they are broken in Java, e.g. It is incorrect to say that "Integers and longs...are broken in Java." user=> (.hashCode (Integer. -1)) -1 user=> (.hash

Re: [ANN] Clojure 1.3 RC0

2011-09-14 Thread Paul Stadig
Yeah it makes sense and is vaguely familiar now. I should have read the changelog. In our case we have a with-channel macro that expands into a try that I think could be moved up to a higher level and not be recuring across a try. Thanks, Paul -- You received this message because you are sub

Re: [ANN] Clojure 1.3 RC0

2011-09-14 Thread Paul Stadig
For unsupported behavior it seemed to work pretty well in our code :), but perhaps it was just a timebomb. In our case it was several layers of macros obscuring the recur across try. I guess we'll have to figure out how to rewrite around it, when we get around to picking up 1.3. Paul -- You

Re: [ANN] Clojure 1.3 RC0

2011-09-14 Thread Paul Stadig
This compiles fine in 1.2.1, but fails in 1.3.0-RC0 (defn foo [[bar & baz]] (try (if (seq baz) (if (= bar 99) (throw (Exception. "FAIL")) (recur baz)) bar) (catch Exception e :fail))) You get a compiler error: java.lang.UnsupportedOperationException: Ca

Re: JVM 7 support (invokedynamic)

2011-09-06 Thread Paul Stadig
I started on some work to use invokedynamic instructions (instead of reflection) for calling Java interop. I based my work on 1.3beta2, and my goal was just to see how much of a performance difference it could make (if any). So far all I have done is update the bundled ASM and modify Clojure to em

Re: JVM 7 support (invokedynamic)

2011-08-28 Thread Paul Stadig
On Sun, Aug 28, 2011 at 10:58 AM, Tal Liron wrote: > I wonder if it would be that difficult to replace the reflector code with >> an invokedynamic. There is a way to get from a java.lang.reflect.Method to a >> java.lang.invoke.MethodHandle (see >> java.lang.invoke.MethodHandles.Lookup.unreflect).

Re: JVM 7 support (invokedynamic)

2011-08-28 Thread Paul Stadig
27;ve used the Clojure 1.2.1 codebase, because I didn't want to work on a > moving target, and also think it might be easier for the community to help > test this with existing applications. (As I said earlier, I also have a few > ideas on how to make sure we can have this mechanism gracefu

Re: JVM 7 support (invokedynamic)

2011-08-28 Thread Paul Stadig
On Sat, Aug 27, 2011 at 8:31 PM, Tal Liron wrote: > I can think of a few ways in which it would be possible to distribute a > clojure.jar that supports JVM 7 features while still falling back to JVM 5 > compatibility. So, I don't think this was ever a barrier. But you obviously > unconvinced by m

Re: JVM 7 support (invokedynamic)

2011-08-26 Thread Paul Stadig
On Thu, Aug 25, 2011 at 6:05 PM, Tal Liron wrote: > > Hmm... If you didn't have to worry about Java <7 compatibility, for one >> thing with invokedynamic you could remove a lot of code from Clojure. No >> more IFn or AFn. You simply have a method handle. >> > > Actually, Clojure's solution is alm

Re: JVM 7 support (invokedynamic)

2011-08-26 Thread Paul Stadig
On Thu, Aug 25, 2011 at 5:41 PM, Tal Liron wrote: > So, after setting up a JVM 7 environment to play with Clojure, and > enthusiastically rummaging through the codebase, I have good news and bad > news. :) > > So, when Clojure calls a function, it either already has the instance in > its entirety

Re: JVM 7 support (invokedynamic)

2011-08-25 Thread Paul Stadig
Right invokedynamic doesn't just "mostly benefit object-oriented languages." A MethodHandle can be used for anything that the JVM can do from a static method call, to an instance method call, to a constructor, to a field access. And in fact the bootstrap method that links an invokedynamic call

Re: JVM 7 support (invokedynamic)

2011-08-25 Thread Paul Stadig
Hmm... If you didn't have to worry about Java <7 compatibility, for one thing with invokedynamic you could remove a lot of code from Clojure. No more IFn or AFn. You simply have a method handle. Second, I think it would allow the JVM to have a better view into optimization, and would allow the

Michael Fogus will talk about ClojureScript tomorrow night (8/25)

2011-08-24 Thread Paul Stadig
If you're in the Washington DC area, and are interested in hearing about ClojureScript from Fogus, he'll be presenting at the CAPCLUG meeting tomorrow night http://www.meetup.com/Cap-Clug/events/16237174/. I believe his talk will be something about the compilation of ClojureScript to JavaScript

Re: User.clj and set!

2011-06-22 Thread Paul Stadig
On Jun 19, 5:11 pm, Andreas Liljeqvist wrote: > Thanks for the answer. > Would there be any problems associated with changing the root bindings? > It means that every thread in the whole JVM would get that value, but that's probably what you want. It also means that if someone else changed the ro

Re: What is the reason Lisp code is not written with closing parenthesis on new lines?

2010-08-18 Thread Paul Stadig
I've rarely found these coding style discussions to be productive, and have wondered why source control systems don't just store code in a whitespace normalized format and automatically format the code to your own taste when you check it out, because, let's face it, formatting is semantically irrel

Re: Speeding up equals using the cached hash code?

2010-08-05 Thread Paul Stadig
I believe the code already does what you are asking about. Are you talking about something like this? http://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/APersistentMap.java#L57 this? http://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/APersistentSet.java#L58 and th

Re: terracotta?

2010-07-21 Thread Paul Stadig
There are agents, atoms, vars, seqs, and lisp macros all of which may make Clojure a more appealing alternative to Java for use with Terracotta. My goal was to get Clojure working with Terracotta, period. Most of the work I did was actually focused on vars so that you could define a function and h

Re: persistent LRU cache (request for input)

2010-07-18 Thread Paul Stadig
I think what you are doing is analogous to the peek and pop operations in core. To get and remove and item you would peek to get the first item, and then alter your ref with a pop, which returns the structure minus with the first item removed. If you do all of this within a dosync, including the

Re: terracotta?

2010-07-15 Thread Paul Stadig
If anyone is interested, the latest version of my terracotta TIM is at http://github.com/pjstadig/tim-clojure-1.0.0 and it tries to be a Clojure 1.0.0 compatible TIM, which shows how its a bit out-of-date. I am very open to collaboration, and I would love pull requests, or any patches that anyone

Re: ANN: Deview - Better test results

2010-07-14 Thread Paul Stadig
On Wed, Jul 14, 2010 at 2:11 AM, Heinz N. Gies wrote: > > On Jul 14, 2010, at 6:40 , Phil Hagelberg wrote: > > > This is really cool! > > > > Unfortunately since I spend all my time in the terminal, (for remote > > pairing) I can't really use a web-based interface like this for normal > > work. D

Re: terracotta?

2010-07-13 Thread Paul Stadig
I have not pursued any further work with Terracotta, because I haven't had a real project that required it. I'd be glad to try to pick something back up, especially if there are others interested in helping out. Paul http://paul.stadig.name/ (blog) 703-634-9339 (mobile) pjstadig (twitter) p..

1.0 Compatible Terracotta Integration Module

2009-12-10 Thread Paul Stadig
Hey everyone, I haven't been in #clojure that often lately, but when I have been there were people asking about Terracotta integration on two separate occasions. What are the chances of that?! :) There is a new repo at http://github.com/pjstadig/tim-clojure-1.0.0/ that has a 1.0 compatible version

Re: Clojure & Terracotta - TIM

2009-11-18 Thread Paul Stadig
Thanks for your feedback. I was able to get it to work again and pushed some minor changes to the git repo. I downloaded Terracotta 3.1.1, and followed the instructions in the tim-clojure-1.0-SNAPSHOT/example/README. I ended up uncommenting all of the code in ClojureTerracottaConfigurator.java. I

Re: Clojure & Terracotta - TIM

2009-11-16 Thread Paul Stadig
Sorry! I forgot to say this, but the short answer is: No, I would not consider it to be production ready. It may be close, but it is not production ready. Paul On Sun, Nov 15, 2009 at 2:47 PM, Sergey Didenko wrote: > Hi from a Clojure newbie! > > I have read the april thread "Clojure + Terracot

Re: Clojure & Terracotta - TIM

2009-11-16 Thread Paul Stadig
Hey Sergey, I did the work on the Clojure TIM. I published a report of my findings at [1]. At least three of the roadblocks that I encountered were fixed in Terracotta 3.0.1 [2]. I believe the TIM works with Clojure 1.0, but it's been several months since I've looked at the code. There are still s

Re: Clojure goes Git!

2009-06-17 Thread Paul Stadig
On Wed, Jun 17, 2009 at 7:03 AM, Mark Volkmann wrote: > On Tue, Jun 16, 2009 at 8:17 PM, Antony Blakey wrote: > > We must be talking about a different way of using git. In my case I created > a local repo from the remote github repo using the following command: > > git clone git://github.com/richh

Re: Rebinding functions?

2009-06-16 Thread Paul Stadig
On Tue, Jun 16, 2009 at 1:38 PM, Michel Salim wrote: > > It's currently not possible to dynamically rebind functions: > > (binding [+ -] (+ 5 3)) ==> 8 ;; not 2 > > Thanks, > > -- > Michel S. > It is possible to rebind (even core) functions, but there are a couple of limitations. One of which is

Re: Clojure at LispNYC tonight 7pm

2009-06-16 Thread Paul Stadig
On Wed, Jun 10, 2009 at 11:37 AM, Stuart Sierra wrote: > > On Jun 9, 10:32 am, Stuart Sierra wrote: > > Join us Tuesday, June 9 from 7:00-9:00 for Stuart Sierra's > > presentation: > > > > Implementing AltLaw.org in Clojure > > Slides and video here: http://lispnyc.org/wiki.clp?page=past-mee

Re: Contributing to Clojure CLR.

2009-06-11 Thread Paul Stadig
I believe David Miller is the one who wrote the CLR code, and he is still hacking on it when he has time. In addition to what is checked into contrib there is also this: http://github.com/dmiller/ClojureCLR/tree/master I'm not sure if they are in sync or which is the most current (github may be

Re: Silly question from Programming Clojure

2009-06-05 Thread Paul Stadig
Concepts of Programming Languages by Sebesta is a book that we used that as the text for my comparative programming languages class. I haven't read CTMCP, so I cannot compare. However, after taking that class during my undergraduate, I couldn't believe that it was an elective! There should definite

Re: You know you've been writing too much Clojure when...

2009-06-02 Thread Paul Stadig
On Tue, Jun 2, 2009 at 10:06 AM, Shawn Hoover wrote: > On Tue, Jun 2, 2009 at 9:52 AM, Michael Reid wrote: > >> On Fri, May 29, 2009 at 2:51 PM, Paul Stadig wrote: >> > You meant to type disclosure, but instead you typed disclojure. >> > >> > Paul >>

Re: Concerns About Pushing Clojure 1.0.0 to Maven Central Repo?

2009-06-02 Thread Paul Stadig
I signed up and voted. Only took about 30 seconds. Thanks for the work everyone. I would love to see Clojure get into the Maven repo. Paul On Tue, Jun 2, 2009 at 6:04 AM, Stefan Hübner wrote: > > The upload bundle, which is found at > http://jira.codehaus.org/browse/MAVENUPLOAD-2464, promotes

You know you've been writing too much Clojure when...

2009-05-29 Thread Paul Stadig
You meant to type disclosure, but instead you typed disclojure. Paul --~--~-~--~~~---~--~~ 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

Re: clojure-mode install on Windows XP does not work, for me

2009-05-19 Thread Paul Stadig
ure") > (directory-files "~/.clojure" t ".jar$" > > This does not work, with "origin/master", rolling back to "origin/1.0" > works though. (with or without setting swank-clojure-extra-classpaths) > > Paul, you must have done

Re: clojure-mode install on Windows XP does not work, for me

2009-05-18 Thread Paul Stadig
I just happened to be setting up emacs an a new Ubuntu install today. I think it might have something to do with 'add-classpath. The swank-clojure-init function is trying to add the swank-clojure directory to the classpath, but the 'require still fails when starting up the clojure REPL. I added th

Re: Google App Engine - best workflow

2009-05-15 Thread Paul Stadig
I'm not a java security manager expert, but I've been playing with this a bit. Could you not do it the other way round? Start a REPL and run the server in the REPL, instead of starting a server and trying to run a REPL in the server? I got as far as setting up the classpath and doing: (com.googl

Re: Macros applied to entire programs

2009-05-12 Thread Paul Stadig
You could write a Clojure program that took in a Clojure program and spit out an optimized Clojure program. You could do something similar to the meta-circular evaluator, where you step through the program (which is just a data structure) recursively matching the head each time against different sy

Re: Got a Clojure user group?

2009-05-05 Thread Paul Stadig
I manage the Clojure Users Group on LinkedIn, which might also be worth mentioning. http://www.linkedin.com/groups?gid=1058217 Paul On Thu, Apr 23, 2009 at 9:43 PM, Rich Hickey wrote: > > Thanks all - the list is here: > > http://clojure.org/community > > More additions welcome! > > Rich > >

Re: ICFP 2009

2009-04-23 Thread Paul Stadig
On Thu, Apr 23, 2009 at 11:04 AM, Rich Hickey wrote: > On Apr 23, 8:59 am, Andrew Wagner wrote: > > > 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

Re: The Path to 1.0

2009-04-21 Thread Paul Stadig
On Mon, Apr 20, 2009 at 8:52 PM, Rich Hickey wrote: > On Apr 20, 2009, at 7:02 PM, Antony Blakey wrote: > > On 21/04/2009, at 5:12 AM, Laurent PETIT wrote: > > > >> { :major 1 :minor 0 :release 0 :status :SNAPSHOT } > >> then > >> { :major 1 :minor 0 :release 0 :status :RC1 } (release candidate

Re: The Path to 1.0

2009-04-17 Thread Paul Stadig
On Fri, Apr 17, 2009 at 9:21 AM, Rich Hickey wrote: > > > As for tests, there are tests in: > > > http://code.google.com/p/clojure-contrib/source/browse/#svn/trunk/src/clojure/contrib/test_clojure > > Anyone who wants more tests can contribute them. > I think what would be useful, though, is to

Re: java.lang.String cannot be cast to [Ljava.lang.CharSequence;

2009-04-16 Thread Paul Stadig
Are you trying to give it a string, or an array of strings? sendKeys takes a variable number of arguments. The error you are getting is that it can't cast a java.lang.String into [Ljava.lang.CharSequence, where the '[' at the beginning of the type means an array. It is telling you that it cannot c

Re: DISCUSS: clojure.contrib.java-utils/as-str

2009-04-09 Thread Paul Stadig
I think it makes sense for (str) to return "", but I'm not sure about (as-str) being "". It doesn't seem as obvious and expected to me. Paul On Thu, Apr 9, 2009 at 2:57 AM, Eric Tschetter wrote: > > Might I suggest > > (defn as-str > ([] "") > ([& args] >(apply str (map #(if (instance? c

Re: Clojure on Google AppEngine

2009-04-08 Thread Paul Stadig
Nice writeup John! Thanks very much. Not sure if I made it into the first 10k developers, but I can't wait to play with this. Paul On Wed, Apr 8, 2009 at 12:52 AM, David Nolen wrote: > Very exciting, thanks for the excellent and informative writeup. > > > On Wed, Apr 8, 2009 at 12:41 AM, John

Re: ANN: Pretty printer is now part of contrib

2009-04-07 Thread Paul Stadig
Isn't it somewhat standard procedure in the Java world (or at least the Maven world...sorry to bring that up again :)) to distribute with a clojure-contrib.jar and clojure-contrib-sources.jar, one being only the compiled classes and the other only being the source files? Paul On Tue, Apr 7, 2009

Re: Simple dosync/alter question

2009-04-06 Thread Paul Stadig
Alter expects a function that take the current value of the ref it will alter as the first arg. I think what you want to do is ref-set. user=> (doc alter) - clojure.core/alter ([ref fun & args]) Must be called in a transaction. Sets the in-transaction-value of ref to:

Re: How do you handle different string encodings?

2009-04-03 Thread Paul Stadig
Works For Me (TM). user=> (def s "québécois français") #'user/s user=> (print s) québécois françaisnil Are you running on Windows, Mac, or Linux? Using the Sun JVM? Which revision of Clojure? p...@pstadig-laptop:~$ lsb_release -a No LSB modules are available. Distributor ID:Ubuntu Descriptio

Re: Keeping a ref and a DB in sync

2009-04-03 Thread Paul Stadig
I'll just throw this out there. It may not be exactly what you're looking for, but you could use a Terracotta cluster. Terracotta will persist the cluster to disk. If you have an existing database that you are working with, then this may not help, but if you are starting from scratch you may not ne

Re: Every function is a thread in Clojure?

2009-04-03 Thread Paul Stadig
The operations will happen synchronously. Clojure will not add threading to your code without you asking it to, but when you want to add threading there are lots of great tools built-in to make it Easy On You (TM). Paul On Fri, Apr 3, 2009 at 9:36 AM, BerlinBrown wrote: > > Someone correct me

Re: Clojure + Terracotta Update

2009-04-02 Thread Paul Stadig
ter On Mon, Mar 30, 2009 at 7:38 PM, Rich Hickey wrote: > > > > On Mar 30, 5:12 pm, Paul Stadig wrote: > > I have gotten to the point in my Clojure + Terracotta experiment, where I > > believe all of the features of Clojure are functional (Refs, Atoms, > > transacti

Re: speed question

2009-04-02 Thread Paul Stadig
Yeah that works the same as defining a function, just more explicit. I was looking for a way to define a constant and just use it as "my-const" without having to use the parens to call a function or a macro. I guess that would be something like a symbol macro in CL? Paul On Thu, Apr 2, 2009 at 1

Re: speed question

2009-04-02 Thread Paul Stadig
I think you are right, Brad. However, I wonder though if there is a better way to define a constant. Neither the macro nor function seems clean. I like David's wrapping-the-whole-thing-in-a-let, but what if you wanted to access the value of "width" in a different file? Would one have to resort to

Re: Ironicly Maven2 is the lightest I could come up with

2009-04-02 Thread Paul Stadig
This works great for Java libraries, but only libraries that are in a maven repo. How hard is it to get code into a repo? What about java libraries not in a maven repo, or clojure code like clojure-json on GitHub? 1. You could set up your own repo. Ok. Cool, but not the easiest to setup and mainta

Re: speed question

2009-04-02 Thread Paul Stadig
I got it down to about 3 seconds. I did what William said, but the biggest improvement was from changing the way *width*, *height*, and *max-steps* were defined. I noticed that in the Java version they are constants, but in the Clojure version they are Vars which means that inside your tight inner

Re: Advanced Practical Recursion in Lisp 1.0

2009-04-01 Thread Paul Stadig
On Wed, Apr 1, 2009 at 6:00 AM, David Sletten wrote: > [snip] > > Here's 'length' again: > (((fn [m] > ((fn [future] >(m (fn [arg] > ((future future) arg > (fn [future] >(m (fn [arg] > ((future future) arg )) > (fn [rec] > (fn [l] >

Re: Parameter ordering on map/reduce

2009-03-31 Thread Paul Stadig
Hi Nathan, There is actually a simple answer to your question. map can take a fuction of multiple parameters along with multiple collections. i.e. (defn f [x y] (+ x y)) (map f [1 2] [3 4]) => (4 6) (Warning I did this computation in the Clojure instance in my head, so some details may be sligh

Clojure + Terracotta Update

2009-03-30 Thread Paul Stadig
I have gotten to the point in my Clojure + Terracotta experiment, where I believe all of the features of Clojure are functional (Refs, Atoms, transactions, etc.). I do not have a way to extensively test the Clojure functionality, but I have run the clojure.contrib.test-clojure test suites successfu

  1   2   >