Re: ATTN contrib authors: Automatic documentation for clojure.contib

2009-04-15 Thread Sean Devlin
Check out the thread below in the Compojure group. Specifically, look for the comment by Brain Carper http://groups.google.com/group/compojure/browse_thread/thread/67d92ceb4128a375?hl=en Brian's code: http://briancarper.net/clojure/compojure-doc.clj This might be an alternate approach to the

Re: Possible contrib contribution: clojure.contrib.timing

2009-04-15 Thread Sean Devlin
Start by putting your code on github or something similar :) On Apr 14, 8:01 pm, Chris ccons...@gmail.com wrote: While playing around with clojure I've found the (time ...) macro isn't as powerful as I'd like.  To fix this I made a timing library to help me figure out where all my runtime is

Oracle and Clojure

2009-04-20 Thread Sean Devlin
Okay, I'm willing to bet this crowd has already seen this: http://www.sun.com/third-party/global/oracle/index.jsp Any thoughts on how this affects Clojure? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Clojure

Re: Oracle and Clojure

2009-04-20 Thread Sean Devlin
at 9:13 AM, Sean Devlin francoisdev...@gmail.com wrote: Okay, I'm willing to bet this crowd has already seen this: http://www.sun.com/third-party/global/oracle/index.jsp Any thoughts on how this affects Clojure? No effect. -- blog: whydoeseverythingsuck.com

Re: Oracle and Clojure

2009-04-21 Thread Sean Devlin
Thanks to *everyone* for responding! I can see that I was over reacting yesterday. Time for me to stop worrying and get back to coding. Sean On Apr 21, 2:05 am, Adrian Cuthbertson adrian.cuthbert...@gmail.com wrote: There are some precedents - the acquisition of SleepyCat (berkeley db, et

Google announcement, version 1.0 SCM Holy War (not really)

2009-04-24 Thread Sean Devlin
There recently was a ton of traffic about SCM in the Path to 1.0 thread. Google made the following announcement: http://google-code-updates.blogspot.com/2009/04/mercurial-support-for-project-hosting.html Does this make changing the SCM tool to Hg a real possibility? While this might not be

Re: Clojure 1.0

2009-05-04 Thread Sean Devlin
Thank you and congrats! On May 4, 9:46 am, AlamedaMike amino.metr...@gmail.com wrote: | Congratulations, Rich! And thanks for all your hard work. Having a 1.0 | release out to help adoption in the workplace environments that we | need to get into. Indeed, this is the case where I work. Having

Clojure, SAP and JCo

2009-05-04 Thread Sean Devlin
Hi, Has anyone else here been using Clojure to interact with SAP? Or, are there any JCo experts in the house? Sean --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to

Help: Java code works, Clojure code doesn't

2009-05-05 Thread Sean Devlin
Okay, I've got code that works in Java but I can't get working in Clojure. Here's the code in Java public class TutorialConnect1 extends Object { JCO.Client mConnection; public TutorialConnect1() { try { // Change the logon information to your own system/user mConnection =

Re: Help: Java code works, Clojure code doesn't

2009-05-05 Thread Sean Devlin
to include everything you need in the classpath the the invoked JVM, for example: java -classpath my-jar-file-containing-DsrlPassport.jar;clojure.jar clojure.main On 5 May, 15:54, Sean Devlin francoisdev...@gmail.com wrote: Okay, I've got code that works in Java but I can't get working

Re: Help: Java code works, Clojure code doesn't

2009-05-05 Thread Sean Devlin
from the repl... (TutorialConnect1.) That might highlight the problem - your java stack strace might give some clues. It does sound like a classpath problem of some sort. Rgds, Adrian. On Tue, May 5, 2009 at 6:04 PM, Sean Devlin francoisdev...@gmail.com wrote: That's a really good point

RESOLVED: Java code works, Clojure code doesn't

2009-05-05 Thread Sean Devlin
Yeah, it was a classpath error. I had to create the following dummy object: com.sap.jdsr.writer.DsrIPassport Once I did that and added it to the classpath, I was golden. Turns out this is a known error with SAP JCo Thanks everyone! On May 5, 1:49 pm, Sean Devlin francoisdev...@gmail.com

Re: Add JNDI lookup support for contrib/sql

2009-05-09 Thread Sean Devlin
+1 On May 9, 2:33 am, Mark Derricutt m...@talios.com wrote: Hi, Can we add the following to contrib's sql namespace, it simply adds jndi as a db-spec scheme ( I also raised this ashttp://code.google.com/p/clojure-contrib/issues/detail?id=39, which google decided to set as a defect and I

Re: Designing an SQL-based application

2009-05-11 Thread Sean Devlin
Here are my thoughts on the three approaches: Approach #1: This seems the most straightforward. I'd write a function that takes a map of conditions, and returns a list of tuples. You can then do what you want with the list of tuples. Approach #2: Remember the first rule of macro club:

Re: Designing an SQL-based application

2009-05-11 Thread Sean Devlin
can save those for another day :) On May 11, 12:04 pm, Victor Rodriguez vict...@gmail.com wrote: On Mon, May 11, 2009 at 11:32 AM, Sean Devlin francoisdev...@gmail.com wrote: Here are my thoughts on the three approaches: Approach #1:  This seems the most straightforward.  I'd write

Re: Macros applied to entire programs

2009-05-11 Thread Sean Devlin
Macros are definitely the tool to do this. Take a look here at Paul Graham's The Roots of Lisp. In it you'll get an idea of why eval is so powerful, and why macros are exactly the tool for the job you're thinking of. http://lib.store.yahoo.net/lib/paulgraham/jmc.ps I'll let someone else

Re: Macros applied to entire programs

2009-05-12 Thread Sean Devlin
One thing hit me as I went to bed last night about this problem: Writing a macro to optimize an s-exp *is* writing a compiler. The good news is that you *don't* have to write a parser. There is some low hanging fruit here (like the + macro described above), but I imagine there will be a lot of

str-utils change proposal, round 2

2009-05-13 Thread Sean Devlin
Hello again everyone, I've added a few new routines to a string library I've been working on. I mentioned it about a month ago, as a proposed change to str- utils. Original Thread: http://groups.google.com/group/clojure/browse_thread/thread/42152add46b851a0# Github:

Re: str-utils change proposal, round 2

2009-05-14 Thread Sean Devlin
:12 AM, Sean Devlin francoisdev...@gmail.com wrote: Hello again everyone, I've added a few new routines to a string library I've been working on.  I mentioned it about a month ago, as a proposed change to str- utils. Original Thread: http://groups.google.com/group/clojure/browse_thread

Re: str-utils change proposal, round 2

2009-05-14 Thread Sean Devlin
not a bad idea. On Thu, May 14, 2009 at 1:12 AM, Sean Devlin   francoisdev...@gmail.com wrote: Hello again everyone, I've added a few new routines to a string library I've been working on.  I mentioned it about a month ago, as a proposed change to str- utils. Original Thread: http

Re: str-utils change proposal, round 2

2009-05-14 Thread Sean Devlin
Hmmm... it sounds like there would be use for a string table utils or something like that. On May 14, 11:12 am, Daniel Lyons fus...@storytotell.org wrote: On May 14, 2009, at 7:14 AM, Stuart Halloway wrote: FYI: I am working on an open-source CSV parser in Clojure. Splitting on

Re: lazy-cat

2009-05-16 Thread Sean Devlin
Clearly you are all dog people. Lazy cat is redundant. On May 16, 3:55 pm, Meikel Brandmeyer m...@kotka.de wrote: Hi, Am 16.05.2009 um 21:48 schrieb George Jahad: I can't come up with  a reason to use lazy-cat over concat.  Is it just around for backwards compatibility, or am I missing

Re: lazy-cat

2009-05-16 Thread Sean Devlin
, Laurent PETIT laurent.pe...@gmail.com wrote: 2009/5/16 Sean Devlin francoisdev...@gmail.com: Clearly you are all dog people. Hello, What means calling others dog people exactly ? Not being a native english person, I'm unsure whether the above is an insult, is ironic, or something else

Re: lazy-cat

2009-05-16 Thread Sean Devlin
I was making a joke about housecats. Maybe I should file a bug report saying cat should default to being lazy :) Again, sorry for the confusion. On May 16, 4:34 pm, Meikel Brandmeyer m...@kotka.de wrote: Hi, Am 16.05.2009 um 21:58 schrieb Sean Devlin: Lazy cat is redundant. concat

Re: Clojure at JavaOne

2009-05-21 Thread Sean Devlin
The duck streams library should give some examples the Java crowd will be ready to appreciate. That, or maybe use the with-open macro. My $.02 On May 21, 7:42 am, Rich Hickey richhic...@gmail.com wrote: On May 21, 3:39 am, mikel mev...@mac.com wrote: On May 18, 7:36 am, Rich Hickey

some vs. every?

2009-05-26 Thread Sean Devlin
I just noticed a quirk in the core API. The some and every? functions have different naming conventions. Is there a reason for this? If not I think renaming/creating an alias some? would be very helpful. --~--~-~--~~~---~--~~ You received this message because

Re: some vs. every?

2009-05-26 Thread Sean Devlin
On May 26, 9:02 am, Sean Devlin francoisdev...@gmail.com wrote: I just noticed a quirk in the core API.  The some and every? functions have different naming conventions.  Is there a reason for this?  If not I think renaming/creating an alias some? would be very helpful

Re: quote vs quasiquote

2009-05-26 Thread Sean Devlin
I would lead the desired term with ~' For example: `(+ 1 2) = (clojure.core/+ 1 2) `(~'+ 1 2) = (+ 1 2) This is very useful when defining a function in a macro On May 26, 2:30 pm, kyle smith the1physic...@gmail.com wrote: user (def nums '(1 2 3)) #'user/nums user (def funs '((+ (1 2 3))

Re: Macro Writing Helper?

2009-05-28 Thread Sean Devlin
Okay, this looks a lot like the ruby yeild statement. Is that what inspired you? On May 28, 12:50 pm, CuppoJava patrickli_2...@hotmail.com wrote: That's unfortunate. It would have made matters much easier for me. The macro I'm attempting to write is: (defblockfn my_block_fn [arg1 arg2

Re: Macro Writing Helper?

2009-05-28 Thread Sean Devlin
Okay, great. That's my background too. Without discussing a specific application, I think what you're looking for can be achieved by normal macros and functions in Clojure. I'll try implement the collect method in Clojure, and hopefully that will explain things. Let's start by creating a

Re: Macro Writing Helper?

2009-05-28 Thread Sean Devlin
On May 28, 3:10 pm, CuppoJava patrickli_2...@hotmail.com wrote: Thank you Meikel for going to the trouble of writing out the full macro. It's going to take me a while to decipher it, and hopefully grasp some understanding at the end of it. I find defblockfn very useful for functions that

Re: Macro Writing Helper?

2009-05-28 Thread Sean Devlin
Okay, good to know. It's interesting to see other approaches. It's how we collectively get better. My $.02: (with_file myfile.txt #(write asdf) (close)) Sean On May 28, 3:23 pm, CuppoJava patrickli_2...@hotmail.com wrote: It's useful in all the cases where a blocks are useful in

Re: Macro Writing Helper?

2009-05-28 Thread Sean Devlin
That's true. Good job Meikel, macro master! On May 28, 3:31 pm, CuppoJava patrickli_2...@hotmail.com wrote: Correction: By My macro I, of course, mean Meikel's macro since you're the one that actually got it working. Have to give credit where it's due. =)

Programming Clojure Arrives!

2009-05-28 Thread Sean Devlin
I just got my copy of Programming Clojure in the mail today. This is the only time I expect to see the book in pristine condition, as I know it will get bookmarked, highlighted, and well used in a hurry. Congratulations Stuart! --~--~-~--~~~---~--~~ You received

Re: The thread ring problem

2009-05-29 Thread Sean Devlin
Would type hints help at all? On May 29, 11:40 am, Laurent PETIT laurent.pe...@gmail.com wrote: Hi, Here is my attempt, for the real benchmark test, it has an honorable result of 62 sec. (if there is no flaw in my algorithm, of course). ;; file shootout/ring.clj (ns shootout.ring  

Feedback on clipboard library

2009-06-01 Thread Sean Devlin
Hello Everyone, I've created a library for interacting with the clipboard. It's a wrapper for the AWT clipboard library.You can find it here: http://github.com/francoisdevlin/devlinsf-clojure-utils/tree/master *Note - I changed the location of my string library for anyone following that.

Re: feature request: docstring for defstruct

2009-06-02 Thread Sean Devlin
This would encourage documenting structs, so I think this is a good idea. Sean On Jun 2, 11:31 am, Stuart Halloway stuart.hallo...@gmail.com wrote: I would like to see defstruct take an optional docstring. Would such a   patch be welcome? Stu

Re: What's the function that checks if an object is sequence-able?

2009-06-03 Thread Sean Devlin
I don't know either, but you can use the following work around (defn my-seq[object] (instance? clojure.lang.Seqable object)) (my-seq []) =true (my-seq {}) =true (my-seq #{}) =true (my-seq '()) =true (my-seq :a) = false (my-seq 'a-symbol) = false Still, it would be nice to know the right way

Re: Macro Writing Helper?

2009-06-03 Thread Sean Devlin
Could you throw together some live examples and unit tests? On Jun 3, 1:10 pm, CuppoJava patrickli_2...@hotmail.com wrote: In case anybody else found defblockfn useful, here's the final version. The original didn't work when you used destructuring in the argument list of the function. (defn

Re: Where does the language end and the libraries begin?

2009-06-04 Thread Sean Devlin
There was this language wiritten in '58 that can do just that. It's called LISP. Here's Paul Grahams paper on eval: http://lib.store.yahoo.net/lib/paulgraham/jmc.ps Get to the part where he defines eval, and let your brain stay on that for a while. You'll see WHY macros work, and never ever

Re: defnk addition to c.c.def

2009-06-04 Thread Sean Devlin
Gut gemacht! Absolutely amazing Meikel. Now get some well earned sleep. Sean On Jun 4, 6:22 pm, Meikel Brandmeyer m...@kotka.de wrote: Hi again, Am 05.06.2009 um 00:06 schrieb Meikel Brandmeyer: The docstring is a bit contorted but I'm too sleepy now, to get that right... And of

Re: defnk addition to c.c.def

2009-06-05 Thread Sean Devlin
) nil) true (recur next-x (inc iter-count))) So it's paying off already! On Jun 4, 7:02 pm, Stephen C. Gilardi squee...@mac.com wrote: On Jun 4, 2009, at 6:54 PM, Sean Devlin wrote: Gut gemacht! Absolutely amazing Meikel.  Now get some well earned sleep. Sean I

Re: Where is group by?

2009-06-05 Thread Sean Devlin
Okay, found it. clojure.contrib.seq-utils On Jun 5, 10:15 am, Sean Devlin francoisdev...@gmail.com wrote: Okay, I may be going nuts here.  I can seem to find the group by function anymore.  Where is it? --~--~-~--~~~---~--~~ You received this message because

Re: Where is group by?

2009-06-05 Thread Sean Devlin
For those of you that may have the same problem in the future, check the index: http://code.google.com/p/clojure-contrib/wiki/ApiDocIndex Great work. On Jun 5, 10:25 am, Sean Devlin francoisdev...@gmail.com wrote: Okay, found it. clojure.contrib.seq-utils On Jun 5, 10:15 am, Sean Devlin

Re: Optimizing cross-product mappings

2009-06-05 Thread Sean Devlin
Try adding type hints. Assuming all-zips returns a list of strings: (defn all-zips-MD5 [] Returns a lazy list of all possible American zipcodes, as MD5 digests. (let [digester (java.security.MessageDigest/getInstance MD5)] (map (fn [#^java.util.String to-digest] (.update

Re: Optimizing cross-product mappings

2009-06-05 Thread Sean Devlin
On Jun 5, 11:14 am, Daniel Lyons fus...@storytotell.org wrote: On Jun 5, 2009, at 8:56 AM, Daniel Jomphe wrote: I need to generate a list of all possible American zipcodes, MD5- digested. Later on, I will need to do much more involving stuff, processor-wize, with this. But already,

Re: Optimizing cross-product mappings

2009-06-05 Thread Sean Devlin
Sounds like a candidate for the daily WTF... On Jun 5, 12:54 pm, Daniel Jomphe danieljom...@gmail.com wrote: You guessed mostly right, Daniel :) This guy hashed some fields of his client's database, replacing the original content with its hashed version. I don't know everything, but he at

Re: Threadring Benchmark

2009-06-06 Thread Sean Devlin
This problem came up on the mailing list recently: http://groups.google.com/group/clojure/browse_thread/thread/5e0c078d0ad8b8bc# You might want to compare your code to what was done here, but at a glance the implementations are similar. You provide relative speed comparisons (Such and such is

Spam in file section

2009-06-08 Thread Sean Devlin
Not quite sure what the right way to report this is. There seems to be some spam in the file report. The Mathis-Oberg- Insulating_Guide.pdf seems to be out of place. My apologies if this is a false positive. --~--~-~--~~~---~--~~ You received this message

Re: Thoughts on bags?

2009-06-08 Thread Sean Devlin
I think I know what you mean by a bag, but I'm not quite sure. How does a bag compare to a set, vector and/or list? On Jun 9, 1:31 am, Richard Newman holyg...@gmail.com wrote: The relational operations work on sets. That's often useful, but there   are situations in which preserving

Monad problem in c.c svn 926

2009-06-09 Thread Sean Devlin
I was trying to play with the monad facility in c.c. I'm using Aquamacs SLIME, and I ran into the following problem: user= (use 'clojure.contrib.monads) java.lang.Exception: Unable to resolve symbol: get-method in this context (accumulators.clj:60) I think this is a bug. Not sure, though.

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

2009-06-09 Thread Sean Devlin
You're writing an email and ;Rich Hickey is a no good... comment out a line instead of deleting it :) (Fortunately I caught this before I hit send) On Jun 4, 8:48 am, BrianS bstephen...@enclojure.org wrote: You see a license plate in front of you DEFN1A3F and you wonder what the function

Re: Monad problem in c.c svn 926

2009-06-10 Thread Sean Devlin
Hmmm... I just tested this in Enclojure. use works fine there. Still doesn't work on my Aquamacs/SLIME setup. I'll check my config. On Jun 10, 2:14 am, Konrad Hinsen konrad.hin...@laposte.net wrote: On 09.06.2009, at 23:48, Sean Devlin wrote: I was trying to play with the monad facility

Date Adapter Utility

2009-06-11 Thread Sean Devlin
Hey everyone, I'm looking for feedback on a date utility library I'm writing. It's still early in it's design, and I want to see if other people see anything. It's designed to create various forms of date objects. It's available on github here:

Re: Date Adapter Utility

2009-06-12 Thread Sean Devlin
12, 10:19 am, AndrewC. mr.bl...@gmail.com wrote: On Jun 12, 2:24 am, Sean Devlin francoisdev...@gmail.com wrote: Hey everyone, I'm looking for feedback on a date utility library I'm writing. Without wanting to seem down on your obvious care and hard work, the last time this came up

Universal Date utility

2009-06-15 Thread Sean Devlin
Hey everyone, There have been a couple of threads discussing date utilities in this group. http://groups.google.com/group/clojure/browse_thread/thread/d98e8efd8d5517b2# http://groups.google.com/group/clojure/browse_thread/thread/659503e698ede0b5/9dda25f36f102799?lnk=gstq=joda#9dda25f36f102799

Re: will clojure evolve to be able to do systems programming?

2009-06-16 Thread Sean Devlin
What exactly do you mean by systems programming? If you mean hardware stuff that's outside the scope of the JVM, then no, I doubt it. However, I am hard pressed to think of situations that you can code with Java SE (dunno about ME) that you can't handle with Clojure. Now that I think about it,

Re: No OO restrictions is good. why not still add dependency injection?

2009-06-16 Thread Sean Devlin
Hari, First, I'd recommend you watch Rich's videos on Clojure, both for Java programmers and LISP programmers. In it Rich explains why Clojure *isn't* OO. It's heresy to some who has written lots of Java, but once you see Clojure in action, everything starts to make sense. I know when I went

Re: Rebinding functions?

2009-06-16 Thread Sean Devlin
Yes, people have shown examples on this list where (+ a b) is dramatically faster than (+ a b c) On Jun 16, 1:42 pm, Paul Stadig p...@stadig.name wrote: On Tue, Jun 16, 2009 at 1:38 PM, Michel Salim michel.syl...@gmail.comwrote: It's currently not possible to dynamically rebind

Re: binding at the REPL

2009-06-16 Thread Sean Devlin
I use 1.0, btw. Tested both on OSX and Windows. On Jun 16, 2:19 pm, Mark Volkmann r.mark.volkm...@gmail.com wrote: On Tue, Jun 16, 2009 at 1:08 PM, Stuart Hallowaystuart.hallo...@gmail.com wrote: This surprised me. What part of my mental model needs to be adjusted? :-) user= (def

Re: accum

2009-06-17 Thread Sean Devlin
Wrexsoul, Your right, I was out of line. I'm sorry. I should go through the effort to explain myself rather than resort to personal attacks. Sean On Jun 17, 1:25 am, Wrexsoul d2387...@bsnow.net wrote: On Jun 17, 12:57 am, Sean Devlin francoisdev...@gmail.com wrote: Daniel, don't feed

Re: reasoning/logic programming from Clojure

2009-06-17 Thread Sean Devlin
Sounds awesome! Will you be able to post any material after the talk? You know, slides, videos, notes, etc? Sean On Jun 17, 5:35 am, Daniel Lyons fus...@storytotell.org wrote: Hi everyone, I'm doing a short talk on declarative/logic programming, reasoning and   expert systems for the

Re: Apply a function to some values in a map

2009-06-18 Thread Sean Devlin
Here's my solution to the problem. It's a bit long winded, so bear with me (or ignore it :)) I defined a function trans (defn trans [ params]...) Let me show an example: user= (def test-map {:a 0 :b B :c C}) #'user/test-map user= ((trans :count count) test-map) {:count 3, :a 0, :b B, :c C}

Re: Apply a function to some values in a map

2009-06-18 Thread Sean Devlin
the plain hash-map function? user= (= (list-to-map 1 2 3 4) (hash-map 1 2 3 4)) true On Jun 18, 11:19 pm, Sean Devlin francoisdev...@gmail.com wrote: Here's my solution to the problem.  It's a bit long winded, so bear with me (or ignore it :)) I defined a function trans (defn trans

Re: What are people using Clojure for?

2009-06-18 Thread Sean Devlin
I'm the report guy, which means a lot of speadsheet/database/erp/ html scraping/mind reading type work. I use Clojure for a lot of ad- hoc data processing. The following things make my job a lot easier: * Quick feedback from the REPL * Abstracting everything to a hash-map *

Re: Which map access is more idiomatic

2009-06-18 Thread Sean Devlin
I like the map-key pattern, especially inside a function. (fn [my-var] ({A 1 :b one} my-var)) In this example, the my-var works properly when passed a string. (fn [my-var] (my-var {A 1 :b one})) The second example breaks when passed a string. On Jun 18, 8:37 pm, kkw

Re: Dynamically accessing static fields

2009-06-22 Thread Sean Devlin
There's already a miglayout wrapper in contrib. It seemed usable when I looked at it. On Jun 22, 7:35 am, Laurent PETIT laurent.pe...@gmail.com wrote: Hi, BTW, if it can be an option for you, there's also the MigLayout layout manager (http://www.miglayout.com/) that allows to write

Moving Window Function

2009-06-23 Thread Sean Devlin
Hey all, Does anyone know of a moving window function? I'm curious if there are any tools like this for digital signals processing, 30-day moving averages, etc. Sean --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Re: Clojure and JAX-WS

2009-06-24 Thread Sean Devlin
How about a combination of the following tools instead of the Java API: c.c.prxml c.c.duck-streams compojure I haven't tried this, and I have never worked with SOAP, so take it with an appropriately sized grain of salt. On Jun 24, 1:09 pm, Richard Newman holyg...@gmail.com wrote: No

Re: Hash Consing

2009-06-29 Thread Sean Devlin
I'm pretty sure Clojure already does this, because of the built in equality by value. I'm pretty sure the hash keys work of off the value, too. Do you have any code you could post to github or something? That would help us determine if such a thing already exisits. I know this doesn't save

Apache POI wrapper????

2009-07-01 Thread Sean Devlin
Hey, Has anyone out there written an Apache POI wrapper yet? Sean --~--~-~--~~~---~--~~ 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

Re: Apache POI wrapper????

2009-07-01 Thread Sean Devlin
Hmmm... good to know POI still needs work. I guess I'll just stick with CSV tab delimited for now. Thanks! On Jul 1, 1:56 pm, Richard Newman holyg...@gmail.com wrote: Has anyone out there written an Apache POI wrapper yet? I started to (for Excel processing), only to abandon it in

Blog on the history of C++

2009-07-02 Thread Sean Devlin
Hey all, I found this blog entry on how C++ replaced C, and it made me think of how Clojure interacts with Java. Not a direct comparison, but I figure I'm not the only on who'll like it. http://ejohnson.blogs.com/software/2004/11/i_find_c_intere.html Hope someone enjoys it.

Flag spam in files?

2009-07-06 Thread Sean Devlin
Hey everyone, I've noticed on several occasions there's spam in the file section (like right now. e.g. SexyBabe.html). What's the preferred approach to handle this: 1. Ignore it 2. Mention it on this list 3. Use a system for tagging files as spam 4. Some other idea?

Re: Is this unquote dangerous?

2009-07-06 Thread Sean Devlin
I think your unquote is okay. ClojureQL does something similar. However, my gut says this should be in a doseq, not a for statement. Could be totally wrong, tough. My $.02 Sean On Jul 6, 2:39 pm, Mike cki...@gmail.com wrote: Newbie question here.  Probably answered in Stu's book, but I

Re: Questions / guidelines for adopting Clojure

2009-07-07 Thread Sean Devlin
Let me take a stab at you parametrization question * Parametrization of function groups * Lets say I have a bunch of functions that provide database operations (read, write, delete, ...). They all share information about the database the operate on. In an OO language, I would define these

Re: Newbie macro problems

2009-07-08 Thread Sean Devlin
This seems like a good use for a macro. A couple of thoughts: 1. Use arrays instead of lists In clojure, it is best practice to use arrays for data. So, your macro call should look like this. (match [1 2 3] [1 x] (+ x x) [1 x y] (+ x y)) 2. Could you post the source to

Re: Newbie macro problems

2009-07-08 Thread Sean Devlin
4. Is this example from SICP? On Jul 8, 12:12 pm, Sean Devlin francoisdev...@gmail.com wrote: This seems like a good use for a macro.  A couple of thoughts: 1.  Use arrays instead of lists In clojure, it is best practice to use arrays for data.  So, your macro call should look like

Re: Save current namespace like a Smalltalk image

2009-07-08 Thread Sean Devlin
Isn't this why you would use a doc string, and not a comment? On Jul 8, 12:14 pm, Daniel Lyons fus...@storytotell.org wrote: On Jul 8, 2009, at 5:46 AM, Robert Campbell wrote: It seems strange to me that Clojure doesn't support this concept   natively Comments are part of the problem.

Re: Newbie macro problems

2009-07-08 Thread Sean Devlin
Laurent, I don't quite understand your point. Could you please explain it a little more? Thanks On Jul 8, 12:16 pm, Laurent PETIT laurent.pe...@gmail.com wrote: 2009/7/8 Sean Devlin francoisdev...@gmail.com: This seems like a good use for a macro.  A couple of thoughts: 1.  Use

Re: Newbie macro problems

2009-07-08 Thread Sean Devlin
Good point. I'll be careful to use the term vector in the future, and array for java interop only. On Jul 8, 12:30 pm, Laurent PETIT laurent.pe...@gmail.com wrote: 2009/7/8 Sean Devlin francoisdev...@gmail.com: Laurent, I don't quite understand your point.  Could you please explain

Re: From Java to Clojure

2009-07-09 Thread Sean Devlin
One question on design intent before feedback. Is your intent to have this Clojure code called by Java code later? On Jul 9, 7:31 am, Patrik Fredriksson patri...@gmail.com wrote: Hi! I started to look closer at Clojure after Rich Hickey's presentation at QCon London in March, this is my

Re: From Java to Clojure

2009-07-09 Thread Sean Devlin
Okay, since you DO call the Clojure code from Java, I like what you did very much. If you're running edge Clojure, and not 1.0, I'd recommend writing the tests in Clojure next, using the clojure.test namespace. Sean On Jul 9, 10:16 am, Patrik Fredriksson patri...@gmail.com wrote: The idea is

Re: On laziness and with-open

2009-07-09 Thread Sean Devlin
That pages says the scopes system is already designed. To you have any preliminary design docs posted somewhere? On Jul 9, 2:59 pm, Stuart Sierra the.stuart.sie...@gmail.com wrote: On Jul 9, 6:10 am, Mike cki...@gmail.com wrote: Is there a pattern out there in Clojure for handling laziness

Re: From Java to Clojure

2009-07-10 Thread Sean Devlin
To quote Benjamin Stewart: ;; the body of this fn should probably be a macro that takes ;; any number of comparisons and or-chain them correctly such that ;; ties cascade to the next comparison and obviates the need for ;; explicit calls to false-if-zero. Does it already exist? This could be

Re: ArithmeticException with doubles

2009-07-10 Thread Sean Devlin
A quick java program: public static void main(String[] args) { System.out.println(1.0/0.0); } Infinity On Jul 10, 11:08 am, John Harrop jharrop...@gmail.com wrote: This is odd: user= (/ 1.0 0.0) #CompilerException java.lang.ArithmeticException: Divide by zero (NO_SOURCE_FILE:0)

Re: Clojure cheat sheet

2009-07-10 Thread Sean Devlin
Okay, I just printed the color version... Damn! This is awesome! I need to find some really heavy paper now, or a laminator machine, or both. Good job. On Jul 10, 10:27 am, Steve Tayon steve.ta...@googlemail.com wrote: Hi all, I uploaded a new revision. What's new? - filled tables with

Java based DocDB

2009-07-27 Thread Sean Devlin
Howdy everyone, I've got a project that needs a Doc DB. It will need to run on windows (and probably OS X), so I am looking for something that works with Java. I thought I'd ask for some help here before I re-invent the wheel. 1. Has anyone here worked with a Java based doc DB? 2. Does

Re: when should functions seq their arguments?

2009-07-27 Thread Sean Devlin
This is a cop out, but... A function should seq the argument when it is appropriate. I've written some functions that depends on the input NOT being a map (SQL IN clause generation, for example), and I wouldn't want this to work for a map. I think the way you documented rand-elt gives you an

REQUEST: Add seqable? to core

2009-07-27 Thread Sean Devlin
Rich, There have been a few times in this thread that people have tried to determine if a function was seqable, and used the following code (seq? a-collection) While this code is great for determining if a-collection is a sequence, it is sometimes not what people want. Often the following

Re: when should functions seq their arguments?

2009-07-27 Thread Sean Devlin
I'm not sure if it should change. I think this depend on the distinction between seq and collection. For example, I personally consider a string a seq, but not a collection. Is this a proper distinction? On Jul 27, 5:36 pm, eyeris drewpvo...@gmail.com wrote: The docstring should also be

Re: when should functions seq their arguments?

2009-07-28 Thread Sean Devlin
ideas? On Jul 28, 10:11 am, eyeris drewpvo...@gmail.com wrote: It calls nth and count, both of which except a collection, according to their docstrings. On Jul 27, 4:46 pm, Sean Devlin francoisdev...@gmail.com wrote: I'm not sure if it should change. I think this depend on the distinction

Re: java 1.4 class files

2009-07-30 Thread Sean Devlin
This is slightly unrelated, but... How much work would it be to run the old code on a Java 5/6 VM? I didn't get into Java until 5, so I'm not sure how much work is actually involved w/ upgrading a JVM installation. On Jul 30, 7:07 am, Frank Koenig frakoe.koe...@googlemail.com wrote: Thank you

c.c Assembla wiki

2009-07-31 Thread Sean Devlin
The move from Google code to github has been awesome. Rich, you the main contributors have done a kick ass job of getting everything in order. Thank you listening to the community, it has been a big help. I'd like to ask one small thing. The Clojure Contrib wiki doesn't exist on Assembla,

Re: c.c Assembla wiki

2009-07-31 Thread Sean Devlin
://richhickey.github.com/clojure-contrib/ Christophe On Fri, Jul 31, 2009 at 5:09 PM, Sean Devlin francoisdev...@gmail.comwrote: The move from Google code to github has been awesome.  Rich, you the main contributors have done a kick ass job of getting everything in order.  Thank you listening

REQUEST: Add apply-map to contrib.def (or core)

2009-07-31 Thread Sean Devlin
I've been using Meikel's defnk macro a fair bit in some of my code. I have several functions that have sensible defaults that only need to be overridden occasionally, so keyword arguments fit the bill nicely. Let's consider two (contrived) keyword fns. (use 'clojure.contrib.def) (defnk add

Re: Newbie question about anonymous functions

2009-08-02 Thread Sean Devlin
There are two other ways to write (fn [x] foo) 1. Use quote #(quote foo) 2. Use the constantly function (constantly foo) Both return a constant value. Sean On Aug 2, 7:47 am, Jarkko Oranen chous...@gmail.com wrote: Chad Harrington wrote: I have a newbie question about anonymous

Re: Transient Data Structures

2009-08-04 Thread Sean Devlin
Rich, First of all, thank you for informing the community about this before you push it into Clojure 1.1/2.0. Developers are people, and it takes time for us to adjust to change. Advance warning helps a lot. As for the changes themselves, I don't know yet. Now, I've only thought about this

Calling all children of the 80s

2009-08-04 Thread Sean Devlin
Okay, I saw this and it *screams* Clojure http://julian.togelius.com/mariocompetition2009/ It's a AI competition for playing Super Mario. The goal is to deliver a solution on the JVM. For me, this is an excuse for working through Norvig's classic text. I'd be interested in what other people

Re: Newbie question: Writing a GUI with clojure

2009-08-05 Thread Sean Devlin
If you really want to get into Swing I suggest taking a look at the following book: http://oreilly.com/catalog/9780596009076/ It's got tons of I didn't knnow you could do that... ideas On Aug 5, 9:01 am, John Harrop jharrop...@gmail.com wrote: On Tue, Aug 4, 2009 at 10:33 PM, Joe Van Dyk

  1   2   3   4   5   6   >