Re: Contributing to Clojure.Contrib

2010-02-10 Thread Kevin Downey
http://clojure.org/contributing seq-utils was recently renamed: http://groups.google.com/group/clojure-dev/browse_thread/thread/49068754a8c2efb9# On Wed, Feb 10, 2010 at 3:38 PM, Wardrop t...@tomwardrop.com wrote: I've written a function which I think would be a good inclusion into the

Re: Contributing to Clojure.Contrib

2010-02-10 Thread Kevin Downey
http://groups.google.com/group/clojure-dev/browse_thread/thread/d090b5599909497c# On Wed, Feb 10, 2010 at 3:57 PM, Wardrop t...@tomwardrop.com wrote: Thanks for the link. As part of my second question, could someone take a look at the code I've posted and tell me if it's a good implementation

Re: Integers can't be Objects?

2010-02-17 Thread Kevin Downey
the [ in front means an array. the String.format takes java varargs, which the compiler de-sugars as an array. easier to use clojure's own format function. which calls String's format method in the end, but you don't have to create the array manually. On Wed, Feb 17, 2010 at 9:21 AM, Phil

Re: funny (?) str behavior

2010-02-23 Thread Kevin Downey
pr-str On Tue, Feb 23, 2010 at 12:47 AM, Alfred Tarski atar...@gmail.com wrote: Hi, I have this function: (defn wrap [x]  (str % x %)) and I do bf= (str boo hoo (map wrap [fdfd ggfs])) boo hoo clojure.lang.lazy...@9e050eb0 This looks odd to me, but if the powers that be consider

Re: (seq? x) vr.s (not (empty? x))

2010-03-11 Thread Kevin Downey
seq is not seq? On Thu, Mar 11, 2010 at 11:19 AM, Brian Hurt bhur...@gmail.com wrote: So the doc comment on empty? reads, in part: Please use the idiom (seq x) rather than (not (empty? x)) A heads up to people: these two code sequences are *not* identical in behavior: user= (seq? '())

Re: (seq? x) vr.s (not (empty? x))

2010-03-11 Thread Kevin Downey
who said they are? On Thu, Mar 11, 2010 at 11:36 AM, Brian Hurt bhur...@gmail.com wrote: On Thu, Mar 11, 2010 at 2:33 PM, Kevin Downey redc...@gmail.com wrote: seq is not seq? No- it's just that empty lists are still seqs (seq? returns true). The only thing that is wrong here is the doc

Re: (seq? x) vr.s (not (empty? x))

2010-03-11 Thread Kevin Downey
it's not a corner case, seq returns a seq containing more items if there are more, or nil if there are not. have you looked at clojure's truth table? if distinguishes from nil and not-nil, with true and false thrown in for interop. On Thu, Mar 11, 2010 at 12:26 PM, Brian Hurt bhur...@gmail.com

Re: (seq? x) vr.s (not (empty? x))

2010-03-11 Thread Kevin Downey
it unchanged through that transition. On Thu, Mar 11, 2010 at 12:52 PM, Brian Hurt bhur...@gmail.com wrote: On Thu, Mar 11, 2010 at 3:40 PM, Kevin Downey redc...@gmail.com wrote: it's not a corner case, seq returns a seq containing more items if there are more, or nil if there are not. have

Re: Rebinding vars at compile time

2010-03-12 Thread Kevin Downey
there are a number of vars that are bound in clojure.main's repl, *assert* is one of them. So in the repl you can use set!. On Thu, Mar 11, 2010 at 3:25 PM, Benjamin Teuber bsteu...@googlemail.com wrote: (def *assert* false) You cannot use def to change the value of a var in another

Re: binary representation + operators

2010-03-12 Thread Kevin Downey
uh, you are confusing representation of the thing with the thing. Integers don't have bases, bases are used when displaying them. The reader does not convert a 2r0 to a base-10 Integer value because there is no such thing. On Fri, Mar 12, 2010 at 4:23 PM, Brendan Ribera brendan.rib...@gmail.com

Re: Spurious STDERR output (Picked up JAVA_TOOL_OPTIONS)

2010-03-12 Thread Kevin Downey
that is output by the jvm and clojure has no control over it. On Fri, Mar 12, 2010 at 4:04 PM, Michael Gardner gardne...@gmail.com wrote: I noticed that when I set JAVA_TOOL_OPTIONS, clojure outputs the following to STDERR before it runs my code: Picked up JAVA_TOOL_OPTIONS: ... This

Re: clojure.walk

2010-03-19 Thread Kevin Downey
I'm not overly familiar with clojure.walk, but I think you'll find the output of (prewalk #(doto % prn) [[3 [3]] [3 3]]) very illuminating. On Fri, Mar 19, 2010 at 2:13 PM, cej38 junkerme...@gmail.com wrote: This post has two parts. Part 1. I know that the API is trying to hit the sweet spot

Re: overrding function from other namespace

2010-03-19 Thread Kevin Downey
why are you def'ing your functions in the mock namespace? why are you juggling namespaces at all? On Wed, Mar 17, 2010 at 3:12 PM, Martin Hauner martin.hau...@gmx.net wrote: Hi, I trying to use clojure.contrib.mock. It says to override the function report-problem to integrate it into other

Re: getting compiler-like meta data from read

2010-04-19 Thread Kevin Downey
if you really want I have a port of LispReader to clojure, it only adds metadata to list forms, like LispReader, but altering it should not be too hard. I haven't made any attempt to keep the reader up to date, but I don't believe LispReader is under going very many changes.

Re: getting compiler-like meta data from read

2010-04-20 Thread Kevin Downey
to compute it. Kevin On Apr 19, 4:44 pm, Kevin Downey redc...@gmail.com wrote: if you really want I have a port of LispReader to clojure, it only adds metadata to list forms, like LispReader, but altering it should not be too hard. I haven't made any attempt to keep the reader up to date, but I

Re: Serializable functions?

2010-05-11 Thread Kevin Downey
http://github.com/technomancy/serializable-fn/ On Tue, May 11, 2010 at 6:18 AM, Konrad Hinsen konrad.hin...@fastmail.net wrote: On 11.05.2010, at 13:07, Michael Jaaka wrote: Right now I can imagine that implementation would look like this. Each function has it own raw input form (string which

Re: Rationals, and their size

2010-06-01 Thread Kevin Downey
http://github.com/richhickey/clojure/commit/5772be9fc5ac9ddf92b727908c20b9aab971224a On Mon, May 31, 2010 at 2:12 PM, alux alu...@googlemail.com wrote: Yep, know that, been there ;-)) On 31 Mai, 21:39, ataggart alex.tagg...@gmail.com wrote: On May 31, 12:18 am, alux alu...@googlemail.com

Re: numerator fn

2010-06-06 Thread Kevin Downey
what version of clojure are you using? On Sun, Jun 6, 2010 at 2:33 AM, Dave Pawson dave.paw...@gmail.com wrote: user= (def pie 22/7) #'user/pie user= (class pie) clojure.lang.Ratio user= (numerator pie) java.lang.Exception: Unable to resolve symbol: numerator in this context

Re: numerator fn

2010-06-06 Thread Kevin Downey
http://github.com/richhickey/clojure/commit/5293929c99c7e1b1b3bcdea3d451108c5774b3d1 vs. http://github.com/richhickey/clojure/commit/5772be9fc5ac9ddf92b727908c20b9aab971224a On Sun, Jun 6, 2010 at 2:38 AM, Dave Pawson dave.paw...@gmail.com wrote: On 6 June 2010 10:37, Kevin Downey redc

Re: numerator fn

2010-06-06 Thread Kevin Downey
numerator is added after 1.1.0 was released On Sun, Jun 6, 2010 at 2:58 AM, Dave Pawson dave.paw...@gmail.com wrote: On 6 June 2010 10:48, Kevin Downey redc...@gmail.com wrote: http://github.com/richhickey/clojure/commit/5293929c99c7e1b1b3bcdea3d451108c5774b3d1 vs. http://github.com

Re: Protocols

2010-06-29 Thread Kevin Downey
manually? did we lose macros? On Tue, Jun 29, 2010 at 12:54 AM, Mark Engelberg mark.engelb...@gmail.com wrote: On Sun, Jun 27, 2010 at 7:18 AM, Rich Hickey richhic...@gmail.com wrote: There are no extension points built on protocols in Clojure yet. Delivering protocols is step one,

Re: Module For COM Objects

2013-02-21 Thread Kevin Downey
The are a few tools for doing interop with COM from the JVM. They all kind of suck. We use com4j at work with Clojure. Com4j generates JVM stubs for COM libraries. On Feb 21, 2013 3:53 PM, octopusgrabbus octopusgrab...@gmail.com wrote: Does Clojure have a module that allows initializing, passing

Re: Clojure crash on OpenJDK 8

2013-02-27 Thread Kevin Downey
what version of clojure are you using? I doubt line #100 of main is the correct line in server.clj, the content of the stacktrace looks more like https://github.com/clojure/tools.nrepl/blob/master/src/main/clojure/clojure/tools/nrepl/server.clj#L146, what version of nrepl?

Re: Clojure crash on OpenJDK 8

2013-02-27 Thread Kevin Downey
clojure uses a class called DynamicClassloader to load runtime generated classes, but it is a pretty strait forward extension of URLClassloader On Wed, Feb 27, 2013 at 11:27 AM, Ben Evans benjamin.john.ev...@gmail.comwrote: On Wed, Feb 27, 2013 at 5:42 PM, Kevin Downey redc...@gmail.com wrote

Re: features expression

2013-03-07 Thread Kevin Downey
Class names are read in as symbols On Mar 7, 2013 7:10 AM, Andy Fingerhut andy.finger...@gmail.com wrote: I may be wrong, but I think this, and anything else that tries to solve this problem after read time, will fail for one of the primary uses of feature macros: Java packages/namespaces that

Re: realizing a lazy line-seq inside with-open

2013-05-27 Thread Kevin Downey
doall doesn't recurse, so you are not realizing the lazy-seq, you want something like [msg (doall sig-strs)] if you are looking to play around with io stuff, I recommend looking in to using reducers for io, they allow you to sort of invert control, keeping the nice property of with-open always

Re: Making things go faster

2013-06-04 Thread Kevin Downey
midje makes each test a top level form, so test runs happen as a side effect of code loading, which means you cannot really run tests in a good way from the repl without doing some kind of ridiculous forced code reloading. I would definitely recommend staying far away from midje, if you want a

Re: bootclasspath

2011-06-29 Thread Kevin Downey
I have attached a patch to the jira issue http://dev.clojure.org/jira/browse/CLJ-673 it checks for a null classloader before calling methods, if the classloader is null it uses ClassLoader.getSystemResource or ClassLoader.getSystemResourceAsStream On Sat, Nov 6, 2010 at 2:04 PM, Phil Hagelberg

Re: pretty-print by default?

2011-07-01 Thread Kevin Downey
pprint by default would be excellent, except it deref's vars On Fri, Jul 1, 2011 at 8:59 AM, Jeffrey Schwab j...@schwabcenter.com wrote: Thank you!  That is exactly what I needed. -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this

Re: Extending a type to an Interface

2011-07-08 Thread Kevin Downey
if only lisp had macros On Fri, Jul 8, 2011 at 12:16 PM, David Jagoe davidja...@gmail.com wrote: Hi All, I am battling with how to deal with the difference between Protocols and Interfaces in a particular case. Consider the following code: (defrecord DomainTypeA []  SomeInternalProtocol

Re: Java object field access

2011-07-26 Thread Kevin Downey
you guys realize there are functions in contrib that do the reflection for you, yes? On Tue, Jul 26, 2011 at 3:31 AM, Shantanu Kumar kumar.shant...@gmail.com wrote: My motivation is need to construct list of Java objects and I would like to have some concise syntax to write them. So I decided

Re: Bizarre ClojureScript issue

2011-07-27 Thread Kevin Downey
are you sure you don't have an extra space in there? (. createConnection net …) vs. (.createConnection net …) On Wed, Jul 27, 2011 at 5:38 PM, Anthony Grimes disciplera...@gmail.com wrote: Sorry for the terrible subject line. I couldn't think of an easy way to describe the problem in a single

Re: Bizarre ClojureScript issue

2011-07-27 Thread Kevin Downey
have you looked at the generated javascript? On Wed, Jul 27, 2011 at 5:44 PM, Anthony Grimes disciplera...@gmail.com wrote: Yep, just double checked. No extra spaces. -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send

Re: What information does (:key x) convey?

2011-08-03 Thread Kevin Downey
the clojure compiler also does some optimizations for keyword literal calls on deftypes which you lose if you def it On Wed, Aug 3, 2011 at 10:29 AM, Laurent PETIT laurent.pe...@gmail.com wrote: 2011/8/3 Sean Corfield seancorfi...@gmail.com On Wed, Aug 3, 2011 at 10:03 AM, Brian Marick

Re: Why do transactions block each other?

2011-08-29 Thread Kevin Downey
https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/LockingTransaction.java#L424 is definitely the line that causes the write lock to be acquired. I get the same behavior on master(1.3) and 1.2.1: the first time I run the code on a particular ref it locks for writing while the

Re: Why do transactions block each other?

2011-08-29 Thread Kevin Downey
PM, Kevin Downey redc...@gmail.com wrote: https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/LockingTransaction.java#L424 is definitely the line that causes the write lock to be acquired. I get the same behavior on master(1.3) and 1.2.1: the first time I run the code

Re: Why do transactions block each other?

2011-08-29 Thread Kevin Downey
can complete without retries. On Mon, Aug 29, 2011 at 6:42 PM, Kevin Downey redc...@gmail.com wrote: weird, it actually ping-pongs, every other run of the (time …) the transaction in the future locks the ref writing so you get Elapsed time: 10006.505 msecs Elapsed time: 0.358 msecs Elapsed time

Re: Why do transactions block each other?

2011-08-30 Thread Kevin Downey
the two threads race to acquire the write lock and the winner runs, the loser retries. my guess is acquiring the write lock helps avoid live locks between transactions. On Mon, Aug 29, 2011 at 10:59 PM, Laurent PETIT laurent.pe...@gmail.com wrote: My tests were false. Since I sent the code at

Re: new Getting Started page

2011-09-02 Thread Kevin Downey
I largely agree, what more do you need to get started than just a repl? writing functions and run them. The bells and whistles you get from various editors and ides are not a requirement for having fun writing functions and running them. It is great to let people know how to get a good integrated

Re: new Getting Started page

2011-09-03 Thread Kevin Downey
The idea that the way to get started is with a fancy editor and a fancy ide is just crazy. The way to get started with Clojure is: write functions, and run them, and be happy. None of that requires any of the mandated complications that come from sophisticated editing environments. Now once you

Re: How to compose futures?

2011-09-10 Thread Kevin Downey
the future thread pool is unbounded (it uses the same thread pool as send-off). I have a library for composing async tasks like futures: https://github.com/hiredman/die-geister On Sat, Sep 10, 2011 at 12:12 PM, Illim illminou...@gmail.com wrote: I'm a clojure beginner and from the future api ,

Re: How to compose futures?

2011-09-11 Thread Kevin Downey
I hate to see agents used this way. If people want a thread pool they should either use the ones provided by clojure, or create their own. Using agents when you want a thread pool smacks of ignorance. http://download.oracle.com/javase/6/docs/api/java/util/concurrent/ThreadPoolExecutor.html You

Re: How to compose futures?

2011-09-11 Thread Kevin Downey
, Laurent PETIT laurent.pe...@gmail.com wrote: 2011/9/11 Kevin Downey redc...@gmail.com I hate to see agents used this way. If people want a thread pool they should either use the ones provided by clojure, or create their own. That's right, the agents part of my answer is more a hack

Re: How to compose futures?

2011-09-11 Thread Kevin Downey
Clojure's concurrency primitives are built on the functionality provided by java.util.concurrent and I think solutions for asynchronous composition should also be built on java.util.concurrent. Agents are identities over a series of results from asynchronous function application. Nothing about

Re: Clojure embedded in a Java Application

2011-09-18 Thread Kevin Downey
Just skimming this on the phone, has no one mentioned RT.map? On Sep 18, 2011 5:58 PM, Eamonn odon...@gmail.com wrote: Hi Meikel,Ken Thank you so much for taking the time to reply to my question. Meikel Thanks for the code. I will implement as described above. On Sep 18, 6:28 pm, Meikel

Re: How does clojure class reloading work?

2011-09-22 Thread Kevin Downey
most likely the compiler is creating a new DynamicClassLoader, it uses a var clojure.lang.Compiler/LOADER and pushes and pops class loaders from there. On Thu, Sep 22, 2011 at 1:52 PM, Brent Millare brent.mill...@gmail.com wrote: Hi, An update to this question. While Chouser gave a good

Re: How does clojure class reloading work?

2011-09-22 Thread Kevin Downey
classloader, would have to re-find the classes the old classloader found from before. How does the pushing/ popping mechanism work so that it only applies to the deftypes? Best, Brent On Sep 22, 2:56 pm, Kevin Downey redc...@gmail.com wrote: most likely the compiler is creating a new

Re: seeking advice for reducing boilerplate

2011-09-28 Thread Kevin Downey
the browser bit should really use with-open (with-open [browser (create-browser :firefox)] On Wed, Sep 28, 2011 at 4:32 PM, Andrew ache...@gmail.com wrote: 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

Re: pattern matching in clojure

2011-09-29 Thread Kevin Downey
Last I checked matchjure generates fns which break recur (there is an issue open for it). Trading recursion for matching seems like a bad deal, I recommend using match instead. On Sep 29, 2011 4:32 AM, Christian Pohlmann chr.pohlm...@googlemail.com wrote: Additionally to core.match there is also

Re: Exception handling changes in Clojure 1.3.0

2011-10-03 Thread Kevin Downey
Reflector.java wraps checked exceptions in runtime exceptions On Mon, Oct 3, 2011 at 12:27 PM, Stuart Halloway stuart.hallo...@gmail.com wrote: The Google App Engine SDK uses checked exceptions on many of its API methods. In many cases, I want to catch these exceptions and do something

Re: Exception handling changes in Clojure 1.3.0

2011-10-06 Thread Kevin Downey
On Thu, Oct 6, 2011 at 4:39 AM, Meikel Brandmeyer (kotarak) m...@kotka.de wrote: It does. user= (defn f [] (Class/forName nonexistant)) #'user/f user= (try (f) (catch ClassNotFoundException e caught!)) caught! the problem is in Reflector.java and the call to Class/forName is

Re: Faster JSON library

2011-10-07 Thread Kevin Downey
seems like that could be added to Intrinsics.java On Fri, Oct 7, 2011 at 1:20 PM, Stuart Halloway stuart.hallo...@gmail.com wrote: Trying to be a little bit constructive here, in case I come across as complaining, I took the source for c.d.json and put it into a leiningen project, enabled warn

Re: Libraries supporting 1.31.2 and bignums

2011-10-10 Thread Kevin Downey
(defmacro plus [] (if … (resolve (symbol clojure.core/+)) (resolve (symbol clojure.core/+' ((plus) actual delta) On Mon, Oct 10, 2011 at 4:28 PM, Brian Marick mar...@exampler.com wrote: I may be missing something obvious. Midje has a checker that lets users say things like   (fact

Re: Exception handling changes in Clojure 1.3.0

2011-10-12 Thread Kevin Downey
On Wed, Oct 12, 2011 at 12:00 PM, Marshall T. Vandegrift llas...@gmail.com wrote: Stuart Sierra the.stuart.sie...@gmail.com writes: I was a little worried about this when the exception behavior for fns was changed. I think it's solvable, but don't know right now what the solution is. I'm

Re: confusion about refs

2011-10-12 Thread Kevin Downey
refs, called as a function, try to call the value they hold as a function with the given arguments ((first @my-contacts) :fname) ~= (:fname @(first @my-contacts)) basically you have two levels of refs, but are only derefing once, but by happy accident ((first @my-contacts) :fname) works On Wed,

Re: Clojure 1.3 treatment of integers and longs

2011-10-18 Thread Kevin Downey
On Tue, Oct 18, 2011 at 7:45 PM, nathanmarz nathan.m...@gmail.com wrote: Thanks. I read through that and it didn't quite answer my question. To me it seems more logical that: 1. Clojure defaults to longs when you create a new number (with a literal 0, 1, etc) 2. You can create ints by doing

Re: Clojure 1.3 treatment of integers and longs

2011-10-19 Thread Kevin Downey
On Wed, Oct 19, 2011 at 5:14 PM, nathanmarz nathan.m...@gmail.com wrote: Here's a code example illustrating the problem I'm having: https://gist.github.com/1300034 I've simplified it to the bare minimum necessary to illustrate the problem. Agree 100% that ints and longs are broken in Java.

Re: Clojure 1.3 treatment of integers and longs

2011-10-20 Thread Kevin Downey
I ran into with the ClassCastException. My proposal still stands. -Nathan On Oct 19, 5:29 pm, Kevin Downey redc...@gmail.com wrote: On Wed, Oct 19, 2011 at 5:14 PM, nathanmarz nathan.m...@gmail.com wrote: Here's a code example illustrating the problem I'm having: https://gist.github.com

Re: Clojure 1.3 treatment of integers and longs

2011-10-20 Thread Kevin Downey
On Thu, Oct 20, 2011 at 12:45 PM, nathanmarz nathan.m...@gmail.com wrote: But Clojure is already inconsistent. ints and Integers in interop are treated differently. The only way to make Clojure consistent is to either: as David said Clojure now only has 64bit primitives. an Integer is not a

Re: Clojure 1.3 treatment of integers and longs

2011-10-24 Thread Kevin Downey
;; lein for all 3 commits [org.clojure/clojure 1.4.0-master-20111023.210239-5] and I imagine you can do something similar with maven, the main thing is you need to add the sonatype snapshot repo. but you can't access individual commits because the build machine polls and gathers the latest

Re: Confusing interplay between macros and metadata

2011-10-24 Thread Kevin Downey
it's not a macro issue, it's a syntax quote issue On Mon, Oct 24, 2011 at 11:54 AM, Alan Malloy a...@malloys.org wrote: I'm struggling with a basic feature of how macros behave. I understand how the problem arises, and I can cobble together my own fix in the specific places where it's

Re: Tutorial/examples of pprint dispatch functions

2011-10-25 Thread Kevin Downey
https://gist.github.com/1314616 On Tue, Oct 25, 2011 at 6:33 AM, Alasdair MacLeod alasdair.clj@gmail.com wrote: Hello, Are there any tutorials or examples of setting up pprint dispatch functions?  I know the docs suggest looking at the source, but I find it a bit cryptic.  In particular

Re: Please try the alphas and betas!

2011-10-31 Thread Kevin Downey
profess to be whacky called ridiculous by someone on the internet, you might need fewer internet connected devices. On 31 Oct 2011, at 21:42, Kevin Downey redc...@gmail.com wrote: the responses to rich here sort of read like lets make an ad-hoc test suite for clojure and everyone can run it which

Re: What is the cost of calling require for something that already have been loaded?

2011-11-12 Thread Kevin Downey
clojure tracks this info in a ref On Sat, Nov 12, 2011 at 6:47 PM, Nicolas Buduroi nbudu...@gmail.com wrote: I'm using a function in Lobos to automatically load the backend code associated to a specific database and wonder if I should track what is loaded to avoid repeatedly calling `require`?

Re: use namespace locally in a function

2011-11-22 Thread Kevin Downey
On Tue, Nov 22, 2011 at 3:14 PM, Sean Corfield seancorfi...@gmail.com wrote: On Tue, Nov 22, 2011 at 3:13 PM, Sean Corfield seancorfi...@gmail.com wrote: On Tue, Nov 22, 2011 at 2:52 PM, Igor TN igor...@gmail.com wrote: Is it possible to require or use a namespace as metadata inside the

Re: use namespace locally in a function

2011-11-22 Thread Kevin Downey
something distasteful I imagine On Tue, Nov 22, 2011 at 3:20 PM, Sean Corfield seancorfi...@gmail.com wrote: On Tue, Nov 22, 2011 at 3:18 PM, Kevin Downey redc...@gmail.com wrote: require/use/import etc make global changes to a namespace(compilation environment), best not to hide that inside

Re: Clojure 1.3.0 and reduce order of evaluation

2011-11-23 Thread Kevin Downey
On Wed, Nov 23, 2011 at 3:33 PM, James Reeves jree...@weavejester.com wrote: Hi folks, I've just noticed that the evaluation order for reduce differs slight between Clojure 1.2.1 and 1.3.0. If you have a lazy seq xs, (b c d ...) and an expression (reduce f a xs), then the initial evaluation

Re: A few enhancements

2011-12-01 Thread Kevin Downey
On Thu, Dec 1, 2011 at 10:00 AM, joegallo joega...@gmail.com wrote: Here are some things I've run across in Clojure that seem asymmetric to me -- I looked through Jira for issues related to these, but I didn't find any (of course, I might have just missed them).  Some of these might be valid

Re: A few enhancements

2011-12-04 Thread Kevin Downey
On Sat, Dec 3, 2011 at 9:58 AM, Stuart Sierra the.stuart.sie...@gmail.com wrote: A matter of curiosity: What are you doing that requires so much symbol manipulation? -S macros mostly. most recently a macro that registers a cache with a name to make it available for flushing via a command

Re: Dynamically Loading Jar Strategy

2011-12-07 Thread Kevin Downey
try something like https://github.com/hiredman/clojurebot/blob/master/src/clojurebot/plugin.clj On Wed, Dec 7, 2011 at 11:53 AM, Pierre-Yves Ritschard p...@spootnik.org wrote: I ended up doing that, all the other approaches fail for me. Thanks for the confirmation. On Wed, Dec 7, 2011 at

Re: java reflection during macro

2011-12-08 Thread Kevin Downey
you can use all the things can use outside of macros: resolve Class/forName etc On Thu, Dec 8, 2011 at 1:06 PM, Razvan Rotaru razvan.rot...@gmail.com wrote: Hi, I'm trying to write some macros for java object instanciation. Here's the code: (defn- gen-object-method [my-class id option

Re: TDD with Leiningen

2011-12-08 Thread Kevin Downey
ala carte testing is easy, clojure comes with a testing library called 'clojure.test' the simplest way to test functions is to define tests using deftest, and to assert things using is (use '[clojure.test :only [deftest is]]) (defn foo [x] (+ x 1)) (deftest test-foo ;; deftest creates a var,

Re: multiple return values

2011-12-12 Thread Kevin Downey
On Mon, Dec 12, 2011 at 10:54 AM, Razvan Rotaru razvan.rot...@gmail.com wrote: Hi, I read that there's no such thing as lisp-like multiple values return in clojure. We can use vectors, and the destructuring feature helps also. However, for what I'm trying to do I need to emulate somehow the

Re: Clojure on java me vms?

2010-12-12 Thread Kevin Downey
no, the runtime you get with every j2me implementation I've seen ia a stipped down java 1.3 or 1.4. Clojure requires 1.5 at least. Basically there are no phones with a real, up to date, jre. On Sun, Dec 12, 2010 at 6:25 PM, Stuart Sierra the.stuart.sie...@gmail.com wrote: In theory, it should.

Re: 'case' macro problem when clause is a type

2010-12-20 Thread Kevin Downey
user (type 'java.lang.Integer) clojure.lang.Symbol user the docs for case say the test constants are not evaluated. On Mon, Dec 20, 2010 at 8:16 PM, David Nolen dnolen.li...@gmail.com wrote: On Mon, Dec 20, 2010 at 10:54 PM, Stephen Pardue pardue.step...@gmail.com wrote: (defn panda-2 [x]  

Re: Community attitude

2010-12-21 Thread Kevin Downey
great, yet another email on the list so unrelated to clojure that not only does it contain no code, but no reference to code. if you need to whinge publicly please do it on your own blog. if you don't feel like the clojure community is giving you the love and support you need then I am sure rails

Re: Dynamic record creation

2011-02-03 Thread Kevin Downey
18:16 hiredman http://groups.google.com/group/clojure/browse_thread/thread/83ad2eed5a68f108?hl=en 18:17 hiredman it amazes me how convoluted people can make things 18:17 brehaut hiredman: at least he recognises it 18:17 dnolen mattmitchell: word of advice, just do the simplest thing. OO

Re: Dynamic record creation

2011-02-03 Thread Kevin Downey
, 2011 at 6:36 PM, Quzanti quza...@googlemail.com wrote: On Feb 4, 2:23 am, Kevin Downey redc...@gmail.com wrote: whole crazy concat thing                 which has nothing to do with anything I probably should have clarified that the reason I need concat is that various functions

Re: Dynamic record creation

2011-02-03 Thread Kevin Downey
=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel Does anyone know anything more about it, or where the sourcecode would be? On Feb 4, 2:44 am, Aaron Cohen aa...@assonance.org wrote: On Thu, Feb 3, 2011 at 9:36 PM, Quzanti quza...@googlemail.com wrote: On Feb 4, 2:23 am, Kevin Downey redc...@gmail.com wrote

Re: Dynamic record creation

2011-02-03 Thread Kevin Downey
then define a factory function when you define the record, and use that, you can easily apply a function to arbitrary arguments without using eval On Thu, Feb 3, 2011 at 7:00 PM, Quzanti quza...@googlemail.com wrote: On Feb 4, 2:55 am, Kevin Downey redc...@gmail.com wrote: I strongly

Re: Release.Next Version Number

2011-02-24 Thread Kevin Downey
you mean inc On Thu, Feb 24, 2011 at 8:45 AM, Dennis Crenshaw crensha...@gmail.com wrote: What makes an ecosystem '1.x' vs '2.x' etc. needs to be quantifiable to make a standard out of it. To quote Peter Drucker, What gets measured gets managed. Are there any solid examples of languages that

Re: About a networked REPL...

2011-03-20 Thread Kevin Downey
nrepl's protocol is also very line reader centric, which is a drag, and the integer that prefixes messages is really just a variable length string and is not useful for allocating buffers to receive data in a client because it is a lines / 2 instead of a byte count. this makes writing a client

Re: About a networked REPL...

2011-03-20 Thread Kevin Downey
My objection has nothing to do with string vs. byte. Messages used in wire protocols exist on a continuum between fixed width and variable width. The happy medium there, which almost all protocols follow is a fixed width header that also provides the bye count of the following variable width

Re: About a networked REPL...

2011-03-21 Thread Kevin Downey
take it from someone who has been digging through the swank clojure source for the last few days, the protocol is not synchronuous. swank-clojure is completely built around async message passing (to the point where it can be difficult to trace an evaluation request and a response), and it is a

Re: About a networked REPL...

2011-03-21 Thread Kevin Downey
On Mon, Mar 21, 2011 at 2:15 PM, James Reeves jree...@weavejester.com wrote: On 21 March 2011 13:14, Chas Emerick cemer...@snowtide.com wrote: I think we're in violent agreement.  Here's a sample nREPL exchange from https://github.com/clojure/tools.nrepl: Ah, I did look through that REPL

Re: Access constructor and fields with default (package) access level

2011-04-05 Thread Kevin Downey
you can easily access a packaged scoped field using reflection without having to write java. in fact there are functions in contrib to do just that, please use them instead of writing java. On Tue, Apr 5, 2011 at 3:18 PM, Stuart Sierra the.stuart.sie...@gmail.com wrote: It's a legitimate

Re: Fun: Write the fastest code that flattens nested maps of a particular type

2011-04-13 Thread Kevin Downey
https://gist.github.com/918487 On Wed, Apr 13, 2011 at 11:56 AM, Meikel Brandmeyer m...@kotka.de wrote: Hmm… I did the following timings with criterium. d is a random data structure generated by virtue of the following function: user= (defn data         [size]         (let [l  (rand-int

Re: Fun: Write the fastest code that flattens nested maps of a particular type

2011-04-13 Thread Kevin Downey
Kevin Downey: https://gist.github.com/918487 I never understood this asian trait of pointing to something and then leaving the other without clue. Do you care to enlighten me, what I'm missing? Sincerely Meikel -- You received this message because you are subscribed to the Google Groups

Re: Two types of special symbol

2011-04-21 Thread Kevin Downey
the current compiler doesn't namespace qualify special forms (forms which are built into the compiler) but somethings that the documentation lists as special forms are infact macros defined in clojure.core based on the real special forms provided by the compiler. macros are namespace qualified so

Re: Two types of special symbol

2011-04-23 Thread Kevin Downey
http://dev.clojure.org/display/design/Compiler+in+Clojure On Sat, Apr 23, 2011 at 3:37 AM, Simon Katz nomisk...@gmail.com wrote: Thanks -- interesting, especially the bit about the design notes on a compiler rewrite. On Thu, Apr 21, 2011 at 22:23, Kevin Downey redc...@gmail.com wrote

Re: Error with eval syntax-quote PersistentArrayMap

2011-04-25 Thread Kevin Downey
your map is being spliced in to the output, but your output contains lists (...) which are interpreted as functions, and the first thing in the list is a map, makes take 1-2 args, your list forms with maps as the operator have more that 2 args. please use macroexpand. On Mon, Apr 25, 2011 at 7:29

Re: Error with eval syntax-quote PersistentArrayMap

2011-04-25 Thread Kevin Downey
for the feedback. It's something small that I'm missing. Tim On Mon, Apr 25, 2011 at 10:40 PM, Kevin Downey redc...@gmail.com wrote: your map is being spliced in to the output, but your output contains lists (...) which are interpreted as functions, and the first thing in the list is a map, makes

Re: Concatenating InputStreams (was: Re: Parsing SGML)

2012-07-13 Thread Kevin Downey
http://docs.oracle.com/javase/1.5.0/docs/api/java/io/SequenceInputStream.html On Fri, Jul 13, 2012 at 7:29 AM, Meikel Brandmeyer (kotarak) m...@kotka.de wrote: Hi again, talking about thread safety. Am Freitag, 13. Juli 2012 16:13:54 UTC+2 schrieb Meikel Brandmeyer (kotarak): (close

Re: Concatenating InputStreams (was: Re: Parsing SGML)

2012-07-13 Thread Kevin Downey
noted your response and will in the future let you prattle on endless reinventing functionality that already exists. On Fri, Jul 13, 2012 at 12:42 PM, Meikel Brandmeyer m...@kotka.de wrote: tl;dr Am 13.07.2012 um 18:35 schrieb Kevin Downey: http://docs.oracle.com/javase/1.5.0/docs/api/java/io

Re: atom and lock

2012-07-17 Thread Kevin Downey
if you do it as a lock, then readers must block writers (think it through). Clojure's reference types + immutable datastructures and the views on perception that underlay them are strongly opposed to readers interfering with writers. http://www.infoq.com/presentations/Are-We-There-Yet-Rich-Hickey

Re: atom and lock

2012-07-17 Thread Kevin Downey
On Tue, Jul 17, 2012 at 4:58 PM, Warren Lynn wrn.l...@gmail.com wrote: On Tuesday, July 17, 2012 7:50:10 PM UTC-4, red...@gmail.com wrote: if you do it as a lock, then readers must block writers (think it through). Clojure's reference types + immutable datastructures and the views on

Re: cljs is not defined

2012-07-26 Thread Kevin Downey
On Wed, Jul 25, 2012 at 6:48 PM, trashhalo step...@mindjunk.org wrote: If I compile... (def x 5) ... with advanced optimization it comes out as cljs.a.x = 5; means something like make x, in the namespace cljs.a equal to 5 so you are missing an (ns cljs.a) somewhere Which throws 'cljs is

Re: auxiliary methods like :before and :after for multimethods?

2012-07-26 Thread Kevin Downey
https://github.com/technomancy/robert-hooke/ On Thu, Jul 26, 2012 at 2:15 PM, George Oliver georgeolive...@gmail.com wrote: hi, I'm wondering if anyone has extended multimethods with auxiliary methods like CL-style :before and :after, and if not what a suitable substitute might be. thanks,

Re: Isolated Clojure Environments

2012-08-30 Thread Kevin Downey
https://github.com/hiredman/polycosm On Aug 30, 2012 6:38 PM, Dave Ray dave...@gmail.com wrote: Hi, I'm looking for the best way to execute some Clojure code in a more or less completely isolated environment. That is, say we load one piece of code: A: --- (ns my-ns) (def foo []

Re: redefining multimethods at the repl

2012-09-05 Thread Kevin Downey
if I recall, the current defonce like behavior of multimethods was a response to the situation where if you have your multimethods split across multiple files reloading the file with the defmulti in it would re-def the multimethod with the new dispatch, but it would not have any of the methods

<    1   2   3   >