Re: Moderately off-topic: installing emacs on OSX

2010-12-09 Thread Andy Fingerhut
Here is a list of steps that should get you to a working Emacs+Clojure SLIME on Mac OS X. I've also used it on Linux (without the MacPorts command, instead using its package manager to install a working GNU emacs). If you don't have many MacPorts programs installed, or don't mind reinsta

Re: Moderately off-topic: installing emacs on OSX

2010-12-09 Thread Ulises
> I would still like to see slime in action, however. I have two emacs > installed, GNU and Aquamacs. macports is still not able to do anything Sorry if this sounds silly but have you tried with carbon emacs? I heard from old time hardcore emacsers that that is the best emacs for OS X (I'm not one

Re: Google AI winner uses lisp

2010-12-09 Thread Ken Wesson
On Fri, Dec 10, 2010 at 12:43 AM, javajosh wrote: > It does beg the question, though: what is a reasonable bare minimum > function set that a real-life lisp would require? I think different people might give different answers to that. The academic computer scientist is likely to consider lambda,

Re: Google AI winner uses lisp

2010-12-09 Thread javajosh
On Dec 9, 9:16 pm, Ken Wesson wrote: > On Fri, Dec 10, 2010 at 12:13 AM, javajosh wrote: > > > On Dec 9, 9:07 pm, Ken Wesson wrote: > >> On Thu, Dec 9, 2010 at 11:55 PM, javajosh wrote: > >> > Common Lisp. > > >> It figures. :) > > > It's still a really exciting story - thanks Alec for sharing

Re: Moderately off-topic: installing emacs on OSX

2010-12-09 Thread javajosh
On Dec 9, 5:41 pm, Alec Battles wrote: > > On Dec 6, 9:16 pm, Phil Hagelberg wrote: > >> On Mon, Dec 6, 2010 at 9:00 PM, javajosh wrote: > >> > Sorry for asking here, but I think it's at least a little relevant to > >> > Clojure since I for one wouldn't be installing emacs if it wasn't for > >>

Re: Null-safe threading macro?

2010-12-09 Thread Alex Baranosky
Thanks, it is so hard to google symbols. On Fri, Dec 10, 2010 at 12:01 AM, Mark Rathwell wrote: > > it's in clojure.contrib > > On Thu, Dec 9, 2010 at 11:58 PM, Alex Baranosky < > alexander.barano...@gmail.com> wrote: > >> I could have sworn I had seen a clojure macro -?> which was just like -> >

Re: Google AI winner uses lisp

2010-12-09 Thread Ken Wesson
On Fri, Dec 10, 2010 at 12:13 AM, javajosh wrote: > > > On Dec 9, 9:07 pm, Ken Wesson wrote: >> On Thu, Dec 9, 2010 at 11:55 PM, javajosh wrote: >> > Common Lisp. >> >> It figures. :) > > It's still a really exciting story - thanks Alec for sharing it! I was > reading Gabor's post (http://quoten

Re: Google AI winner uses lisp

2010-12-09 Thread javajosh
On Dec 9, 9:07 pm, Ken Wesson wrote: > On Thu, Dec 9, 2010 at 11:55 PM, javajosh wrote: > > Common Lisp. > > It figures. :) It's still a really exciting story - thanks Alec for sharing it! I was reading Gabor's post (http://quotenil.com/Planet-Wars-Post- Mortem.html) and it sounds like somethi

Re: Getting strange behavior when stubbing

2010-12-09 Thread Ken Wesson
On Thu, Dec 9, 2010 at 11:35 PM, Alex Baranosky wrote: > Thanks Ken. You're welcome. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - pleas

Re: Google AI winner uses lisp

2010-12-09 Thread Ken Wesson
On Thu, Dec 9, 2010 at 11:55 PM, javajosh wrote: > Common Lisp. It figures. :) -- 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 p

Re: Null-safe threading macro?

2010-12-09 Thread Mark Rathwell
it's in clojure.contrib On Thu, Dec 9, 2010 at 11:58 PM, Alex Baranosky < alexander.barano...@gmail.com> wrote: > I could have sworn I had seen a clojure macro -?> which was just like -> > except that if it, at any point, evaluated to nil, then it would return nil, > instead of throwing a NullPoi

Null-safe threading macro?

2010-12-09 Thread Alex Baranosky
I could have sworn I had seen a clojure macro -?> which was just like -> except that if it, at any point, evaluated to nil, then it would return nil, instead of throwing a NullPointerException. Is there such a thing out there, or am I misremembering? Best, Alex -- You received this message beca

Re: Google AI winner uses lisp

2010-12-09 Thread javajosh
Common Lisp. http://quotenil.com/ On Dec 9, 7:09 pm, Ken Wesson wrote: > On Thu, Dec 9, 2010 at 8:53 PM, Alec Battles wrote: > > I'm sure a few people have read this news already. It's been up for a > > week, though strangely ZDnet -- which, on principle, I refuse to link > > to > > Why? > > >

Re: Getting strange behavior when stubbing

2010-12-09 Thread Alex Baranosky
Thanks Ken. (doall) to the rescue! It worked! Makes perfect sense. It explains why sometimes it would seem to work if I put the result of the mapping into a let binding... it was calculating the value. -- You received this message because you are subscribed to the Google Groups "Clojure" gro

Re: Getting strange behavior when stubbing

2010-12-09 Thread Ken Wesson
On Thu, Dec 9, 2010 at 10:50 PM, Alex Baranosky wrote: >   (map (fn [dest] (dist-in-miles origin dest)) locations)) > It seems the stubbing is not happening when (distances "Boston,MA" > "Albany,NY" "LosAngeles,CA") is being evaluated.  But if I put print > statements in the function to see the

Getting strange behavior when stubbing

2010-12-09 Thread Alex Baranosky
I've been playing with Amit Rathore's simple mocking functions: http://s-expressions.com/2010/01/24/conjure-simple-mocking-and-stubbing-for-clojure-unit-tests/ I'm seeing the weirdest effect, and after banging my head on it for a couple hours I figure it's time to ask about it. Any ideas would be

Re: mapmap?

2010-12-09 Thread Ken Wesson
On Thu, Dec 9, 2010 at 8:43 PM, Steven E. Harris wrote: > Ken Wesson writes: > >> and to encapsulate as a function: >> >> (defn fmap [f m] >>   (into {} >>     (for [[k v] m] >>       [k (f v)]))) > > Here, "fmap" is a poor choice of name, if it's meant to be a reference > to Haskell's function o

Re: Google AI winner uses lisp

2010-12-09 Thread Ken Wesson
On Thu, Dec 9, 2010 at 8:53 PM, Alec Battles wrote: > I'm sure a few people have read this news already. It's been up for a > week, though strangely ZDnet -- which, on principle, I refuse to link > to Why? > -- is one of the only places to write it up. > > http://pr-usa.net/index.php?option=com_

Google AI winner uses lisp

2010-12-09 Thread Alec Battles
I'm sure a few people have read this news already. It's been up for a week, though strangely ZDnet -- which, on principle, I refuse to link to -- is one of the only places to write it up. http://pr-usa.net/index.php?option=com_content&task=view&id=560484&Itemid= Nice news to read before b

Re: Moderately off-topic: installing emacs on OSX

2010-12-09 Thread Alec Battles
> On Dec 6, 9:16 pm, Phil Hagelberg wrote: >> On Mon, Dec 6, 2010 at 9:00 PM, javajosh wrote: >> > Sorry for asking here, but I think it's at least a little relevant to >> > Clojure since I for one wouldn't be installing emacs if it wasn't for >> > Clojure and Slime. Getting prompts about what th

Re: mapmap?

2010-12-09 Thread Steven E. Harris
Ken Wesson writes: > and to encapsulate as a function: > > (defn fmap [f m] > (into {} > (for [[k v] m] > [k (f v)]))) Here, "fmap" is a poor choice of name, if it's meant to be a reference to Haskell's function of the same name. It's not obvious to me that mapping a function over a

Re: Recipe for using two databases with contrib.sql

2010-12-09 Thread Sean Corfield
Take a look at this for connection pooling: http://bitbucket.org/kumarshantanu/clj-dbcp/src On Thu, Dec 9, 2010 at 1:39 PM, Ghadi Shayban wrote: > I'm using contrib,sql to clean rows from one DB and insert them into > another. > > I was thinking something like (pseudo-code > > (sql/with-connecti

Re: Giving a 15 minute Clojure lightning talk. Any ideas?

2010-12-09 Thread Angel Java Lopez
Hi people! Recently, I used as final example in a short presentation: https://github.com/sfraser/MultithreadedGameOfLife http://www.youtube.com/watch?v=CFCYVfApPUc It shows: - Multithreading - persistence data, transactions - access to Java tech, as Swing My first minutes were dedicated to simpl

Re: Giving a 15 minute Clojure lightning talk. Any ideas?

2010-12-09 Thread Alex Baranosky
Thanks, for all of your thoughts, guys. I'm letting all the ideas boucne around. I'll be sure to let you all know how it goes after the talk. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.c

Re: Giving a 15 minute Clojure lightning talk. Any ideas?

2010-12-09 Thread Laurent PETIT
2010/12/10 Ken Wesson > On Thu, Dec 9, 2010 at 6:23 PM, javajosh wrote: > > Of course, it could also be a GUI app, too. But, for some reason Lispy > > programmers don't seem to be very good at making things look pretty. > > Watch this space for me proving that statement wrong sometime soon. :) >

Re: Giving a 15 minute Clojure lightning talk. Any ideas?

2010-12-09 Thread Ken Wesson
On Thu, Dec 9, 2010 at 6:23 PM, javajosh wrote: > Of course, it could also be a GUI app, too. But, for some reason Lispy > programmers don't seem to be very good at making things look pretty. Watch this space for me proving that statement wrong sometime soon. :) -- You received this message bec

Re: Giving a 15 minute Clojure lightning talk. Any ideas?

2010-12-09 Thread Laurent PETIT
2010/12/10 javajosh > On Dec 9, 7:08 am, Laurent PETIT wrote: > > If the audience is Java / Ruby, my guess is that they don't want to know > > about emacs, for one. > > I agree - learning clojure, I don't want to know about emacs either > (especially since installing clojure support has been uns

Re: Giving a 15 minute Clojure lightning talk. Any ideas?

2010-12-09 Thread javajosh
On Dec 9, 7:08 am, Laurent PETIT wrote: > If the audience is Java / Ruby, my guess is that they don't want to know > about emacs, for one. I agree - learning clojure, I don't want to know about emacs either (especially since installing clojure support has been unsuccessful so far). Eclipse has a

Re: String-friendly first/rest?

2010-12-09 Thread Stuart Sierra
On Dec 9, 12:52 pm, Alan wrote: > rest). However, my understanding is that c.c.string is going away in > 1.3, and many of its features will be removed rather than moved, so I Yes, it is replaced by clojure.string. c.c.string is deprecated in 1.2 and removed in 1.3 -S -- You received this mes

Recipe for using two databases with contrib.sql

2010-12-09 Thread Ghadi Shayban
I'm using contrib,sql to clean rows from one DB and insert them into another. I was thinking something like (pseudo-code (sql/with-connection db1 . (doseq [x (map rs)] (insert-into-other x))) (defn insert-into-other [r] (sql/with-connection db2 ...)) But this obviously will open/close

Re: String-friendly first/rest?

2010-12-09 Thread Alan
clojure.contrib.string has take and drop, which do what you want (though you have to ask for exactly one character to emulate first/ rest). However, my understanding is that c.c.string is going away in 1.3, and many of its features will be removed rather than moved, so I don't think you're supposed

Re: Giving a 15 minute Clojure lightning talk. Any ideas?

2010-12-09 Thread Laurent PETIT
If the audience is Java / Ruby, my guess is that they don't want to know about emacs, for one. My guess is also that it's not in 15 minute that you'll make them comfortable with the IDE of using a LISP "syntax". Of course, maybe they already know about clojure. If so, either they will learn nothin

Re: Giving a 15 minute Clojure lightning talk. Any ideas?

2010-12-09 Thread David Andrews
You're not going to convey much useful information in 15 minutes, but you can do something inspiring. A couple of years ago I saw a video - probably by Marco Berringer - that showed a CL/emacs expert solving a nontrivial problem. I was purely amazed at the amount of code that appeared on the scre

clojure@googlegroups.com

2010-12-09 Thread Stuart Sierra
You can get lots of information out of &env and &form, with a bit of effort. See https://github.com/stuartsierra/lazytest/blob/86a75572e81625b09f9ed15981fb9efd670e00a9/modules/lazytest/src/main/clojure/lazytest/expect.clj#L39 for an example. -S On Dec 9, 4:20 am, Sunil S Nandihalli wrote: > Hel

Re: "batch" could be fun in clojure

2010-12-09 Thread László Török
The idea is interesting, it is an application of the principle: move the computation where the data resides, rather than shovel data between remote locations there is quite an interesting implementation in scala http://lambda-the-ultimate.org/node/3626 ps sorry if a bit off-topic Las 2010/12/9

clojure@googlegroups.com

2010-12-09 Thread Sunil S Nandihalli
Thanks Alex. That helps. Sunil. On Thu, Dec 9, 2010 at 4:28 PM, Alex Osborne wrote: > Sunil S Nandihalli writes: > > > I would like to know what meta info does &form that get passed to > > your macro.. actually contain? I am able to only get the line > > number.. Is there a way to get the file

clojure@googlegroups.com

2010-12-09 Thread Ken Wesson
On Thu, Dec 9, 2010 at 5:58 AM, Alex Osborne wrote: > Sunil S Nandihalli writes: > >> I would like to know what meta info does &form that get passed to >> your macro.. actually contain? I am able to only get the line >> number.. Is there a way to get the file name aswell? > > The currently evalua

clojure@googlegroups.com

2010-12-09 Thread Alex Osborne
Sunil S Nandihalli writes: > I would like to know what meta info does &form that get passed to > your macro.. actually contain? I am able to only get the line > number.. Is there a way to get the file name aswell? The currently evaluating/compiling file (if it is a file and not the REPL or some

clojure@googlegroups.com

2010-12-09 Thread Ken Wesson
On Thu, Dec 9, 2010 at 5:18 AM, Shantanu Kumar wrote: > It might be possible to get other info (such as var-name, var-body > etc), but it's mostly subjective (depending on the form being passed): > > https://bitbucket.org/kumarshantanu/clj-miscutil/src/e16432dc0b6c/src/main/clj/org/bituf/clj_miscu

clojure@googlegroups.com

2010-12-09 Thread Shantanu Kumar
It might be possible to get other info (such as var-name, var-body etc), but it's mostly subjective (depending on the form being passed): https://bitbucket.org/kumarshantanu/clj-miscutil/src/e16432dc0b6c/src/main/clj/org/bituf/clj_miscutil.clj#cl-251 Regards, Shantanu On Dec 9, 3:04 pm, Ken Wess

clojure@googlegroups.com

2010-12-09 Thread Ken Wesson
On Thu, Dec 9, 2010 at 4:48 AM, Sunil S Nandihalli wrote: > hmm.. so how do we get the file name inside our macro?? I guess we ask nicely for it to be added to the &form metadata in 1.3. :) Interestingly, extracting the correct line number in cases of multi-line forms is already handled: (ns fa

clojure@googlegroups.com

2010-12-09 Thread Sunil S Nandihalli
hmm.. so how do we get the file name inside our macro?? Sunil. On Thu, Dec 9, 2010 at 2:57 PM, Ken Wesson wrote: > On Thu, Dec 9, 2010 at 4:20 AM, Sunil S Nandihalli > wrote: > > Hello everybody, > > I would like to know what meta info does &form that get passed to your > > macro.. actually co

clojure@googlegroups.com

2010-12-09 Thread Ken Wesson
On Thu, Dec 9, 2010 at 4:20 AM, Sunil S Nandihalli wrote: > Hello everybody, >  I would like to know what meta info does &form that get passed to your > macro.. actually contain? I am able to only get the line number.. Is there a > way to get the file name aswell? user=> (defmacro foo [x] `(quote

clojure@googlegroups.com

2010-12-09 Thread Sunil S Nandihalli
Hello everybody, I would like to know what meta info does &form that get passed to your macro.. actually contain? I am able to only get the line number.. Is there a way to get the file name aswell? Thanks, Sunil. -- You received this message because you are subscribed to the Google Groups "Cloju

Re: "batch" could be fun in clojure

2010-12-09 Thread Saul Hazledine
On Dec 8, 11:12 pm, Raoul Duke wrote: > another take on rpc/queries/services: > >    www.odbms.org/download/2010-09-Batches-ICOODB.pdf > > apparently very preliminary, i can't find the java implementation > referred to in the slides. I liked the idea but was sceptical since most remote work is do

Re: a macro to debug the let form

2010-12-09 Thread Sunil S Nandihalli
Thanks Alan, I have in fact realized the mistake after I posted it .. and I had posted another message which has it the way you mentioned. Sunil. On Tue, Dec 7, 2010 at 11:55 PM, Alan wrote: > I see you have defined a print-and-return macro; you might prefer my > and-print: > > (defmacro and-pr