Re: Simple functional programming lexicon?

2010-03-18 Thread Konrad Hinsen
On 18.03.2010, at 04:50, Praki Prakash wrote: As others have mentioned, Haskell is heavy in its use of monads and many other algebraic structures. I don't know why the two languages feel so different with respect to the level of formalism you need to use them. But, Haskell is one of the

Re: Name suggestions

2010-03-18 Thread LauJensen
Hey Markus, Probably not what you want to hear, but I think great names are both memorable and descriptive. Leaning on those criterias clj-native is not bad at all. Lau On 17 Mar., 08:08, mac markus.gustavs...@gmail.com wrote: After just a little more test and polish I plan on calling

Re: help with infinite loop: break and examine stack? dynamic tracing? circular lists?

2010-03-18 Thread LauJensen
Hi Lee, Personally I think JSwat does the job right in that you can break the code and get a look at local variables. There has also been release a 'debug-repl' which allows you to halt execution and jump into a REPL, like so: http://georgejahad.com/clojure/debug-repl.html. There exists 2

Re: Simple functional programming lexicon?

2010-03-18 Thread LauJensen
Hi Ben, I think we often get the impression that functional programming is directly connected to monads, but in practical terms the important concepts are pure functions and persistent immutable datastructures. The learning curve when coming from an imperative language, lies (for me at least)

Re: Web Programming with clojure

2010-03-18 Thread LauJensen
Hey Tim, Welcome - I might be restating, but this should get you going quickly: Getting ready: http://www.bestinclass.dk/index.php/2009/12/clojure-101-getting-clojure-slime-installed/ Doing simple pages: http://www.bestinclass.dk/index.php/2009/12/beating-the-arc-challenge-in-clojure/

Re: web starting clojure apps without Java code

2010-03-18 Thread LauJensen
Eugen, Fantastic insight - I cant wait to work that into a blogpost :) Lau On 17 Mar., 15:56, Eugen Dück eu...@dueck.org wrote: All, Developing in clojure is a lot of fun, at least it was for me and a project of mine - except for one thing: Deploying the app as Java Web Start app, that

Re: Name suggestions

2010-03-18 Thread Joop Kiefte
What about Clonure? Wordplay on Clone and leaving out the j ;) 2010/3/17 mac markus.gustavs...@gmail.com: After just a little more test and polish I plan on calling clj-native 1.0. But clj-native is a *really* boring name so I want to change it before 1.0 and I don't have very good imagination

Re: Simple functional programming lexicon?

2010-03-18 Thread Michael Kohl
On Wed, Mar 17, 2010 at 1:28 PM, Ben Armstrong synerg...@gmail.com wrote: What I would like to have is some sort of lexicon to at least help explain the terminology in a way that doesn't require three years of academic exposure to functional programming to read.  Is there such a reference?  Or

Java method call irritation

2010-03-18 Thread alux
Hello, I just was to lazy to get my Javadoc, so I wanted to list the methods of an object from the 1.1-REPL. I got different results when mapping .getName or #(.getName %) over the seq I produced - I expected this to be the same. So seemingly my expectations are wrong. Would you please rectify?

Re: Java method call irritation

2010-03-18 Thread Meikel Brandmeyer
Hi, Java methods are not clojure functions. To treat them like first-class functions you have to wrap them in clojure functions as you did in your second example. For your actual task: you might want to look at clojure.contrib.repl- utils/show. Sincerely Meikel -- You received this message

Re: Java method call irritation

2010-03-18 Thread alux
Thank you Meikel. I just didnt encounter that information before ;-) I'm still in the process of learning the core lib, so while learning I sometimes avoid the contrib libraries, and try myself. Here this proved educating again ;-) (wouldn't do so for production ;-) Thank you and regards, alux

reload of REPL init file

2010-03-18 Thread alux
Hello, is there a possibility to reload a clj-file that has been provided at the REPL-start via -i filename.clj ? (It doesn't have a name space.) This would save me to provide a namespace in the file an thus type (ns my-ns) after every REPL start. Thank you and greetings, alux -- You

Re: reload of REPL init file

2010-03-18 Thread Meikel Brandmeyer
Hi, On Mar 18, 12:06 pm, alux alu...@googlemail.com wrote: is there a possibility to reload a clj-file that has been provided at the REPL-start via -i filename.clj ? (It doesn't have a name space.) This would save me to provide a namespace in the file an thus type (ns my-ns) after every

Re: Name suggestions

2010-03-18 Thread Martin DeMello
C-Foam martin On Wed, Mar 17, 2010 at 12:38 PM, mac markus.gustavs...@gmail.com wrote: After just a little more test and polish I plan on calling clj-native 1.0. But clj-native is a *really* boring name so I want to change it before 1.0 and I don't have very good imagination when it comes to

Re: Name suggestions

2010-03-18 Thread Alexandre Patry
On Wed, Mar 17, 2010 at 3:08 AM, mac markus.gustavs...@gmail.com wrote: After just a little more test and polish I plan on calling clj-native 1.0. But clj-native is a *really* boring name so I want to change it before 1.0 and I don't have very good imagination when it comes to these

Re: Java method call irritation

2010-03-18 Thread Stuart Halloway
memfn is from the depths of time and should be deprecated -- it is idiomatic to write an anonymous fn around the method. Stu This seems like a potential usecase for (memfn): - clojure.core/memfn ([name args]) Macro Expands into code that creates a fn that expects

Re: Name suggestions

2010-03-18 Thread Edmund Jackson
I love the reference, but I dunno dude, the word itself sounds venereal ! On 18 Mar 2010, at 14:36, Alexandre Patry wrote: On Wed, Mar 17, 2010 at 3:08 AM, mac markus.gustavs...@gmail.com wrote: After just a little more test and polish I plan on calling clj-native 1.0. But clj-native

Re: reload of REPL init file

2010-03-18 Thread alux
Many thanks, all questions I had are answered. And some I didn't have but should! Greetings, alux On 18 Mrz., 14:25, Meikel Brandmeyer m...@kotka.de wrote: Hi, On Mar 18, 12:06 pm, alux alu...@googlemail.com wrote: is there a possibility to reload a clj-file that has been provided at the

Re: Java method call irritation

2010-03-18 Thread Per Vognsen
Is there any reason why a .method occurrence in non-operator position doesn't just do the closure wrapping automagically? -Per On Thu, Mar 18, 2010 at 9:50 PM, Stuart Halloway stuart.hallo...@gmail.com wrote: memfn is from the depths of time and should be deprecated -- it is idiomatic to write

Re: clj-native 0.8.1

2010-03-18 Thread eyeris
clj-segfault j/k :) Seriously though, thank you for working on this. I'm sure it will remove a serious barrier to entry for some people. On Mar 13, 1:14 pm, mac markus.gustavs...@gmail.com wrote: Hello all. I have had some time lately to work on my C FFI for Clojure and I think it's pretty

Re: Broken JSON API in clojure-contrib?

2010-03-18 Thread Timothy Washington
Too right. Thanks very much friend. Tim On Wed, Mar 17, 2010 at 3:25 PM, Michael Wood esiot...@gmail.com wrote: On 17 March 2010 21:18, Michael Wood esiot...@gmail.com wrote: [...] $ java -cp clojure-1.1.0.jar:clojure-contrib.jar clojure.mainClojure 1.1.0 [...] Whoops! Not sure what

Re: Java method call irritation

2010-03-18 Thread Seth
Would :deprecated be a reasonable thing to include in a function's metadata? Just the presence of it seems good enough, but I guess pairing it with some programmer friendly message (hey, use bar instead of foo) might be nice. Or... maybe 10,000 lines of XML as metadata! :-) On Mar 18, 10:50 am,

Clojure 101 - Slime installation

2010-03-18 Thread Tim Johnson
See http://vimeo.com/8398020 Great video! But, it would be great if I could capture the *text* of the video, (if available) that would be very helpful in referrencing Lau's instructions Anyone know how to do that? thanks -- Tim t...@johnsons-web.com http://www.akwebsoft.com -- You received

Re: Java method call irritation

2010-03-18 Thread Sean Devlin
And upgrade the doc macro accordingly? That would make entirely too much sense. +1 On Mar 18, 2:36 pm, Seth seth.schroe...@gmail.com wrote: Would :deprecated be a reasonable thing to include in a function's metadata? Just the presence of it seems good enough, but I guess pairing it with some

Re: Simple functional programming lexicon?

2010-03-18 Thread Ben Armstrong
On 18/03/10 06:57 AM, Michael Kohl wrote: There's a really nice article series on monads in Clojure: http://onclojure.com/2009/03/05/a-monad-tutorial-for-clojure-programmers-part-1/ Oh, wow! Lucidly written. And it gives me something, maybe-m, that I can't believe I got along without

Translation from Common Lisp 1

2010-03-18 Thread alux
Hello! I much enjoyed reading the tutorial http://www.lisperati.com/casting.html , mentioned by eyeris today. The most mind-extending thing (to me, having Java background) is the, admittedly non-idiomatic, use of symbols as data. But I have two translation problems, I want to pose before going

Translation from Common Lisp 2

2010-03-18 Thread alux
Again, from my translation of the http://www.lisperati.com/casting.html tutorial. I completely lost track at the macro generating macro (defspel game- action .. In short, Barski writes a very simple (and neat) text adventure. To avoid wrong assumtions he doesnt talk about macros but SPELs, using

Re: Translation from Common Lisp 1

2010-03-18 Thread Brian Schlining
But I have two translation problems, I want to pose before going to sleep (its pitch dark in Europe :). First the easy one: Common Lisp (defun describe-path (path) `(there is a ,(second path) going ,(first path) from here.)) My Clojure version, I use a map: (defn describe-path [path]

Re: Translation from Common Lisp 1

2010-03-18 Thread fons haffmans
I just did this : (defn describe-path [path] `(there is a ,(second path) going ,(first path) from here.)) which gives me : (describe-path (list left right)) (user/there user/is user/a (clojure.core/second user/path) user/going (clojure.core/first user/path) user/from here.) Sure, it prepends

Re: Translation from Common Lisp 1

2010-03-18 Thread alux
Yes, of course, thats what a sane person would do ;-) I mentioned in my later post, this usage of symbols as data is 1. non- idiomatic but 2. really illuminating for somebody with Java background. Well, and its what this tutorial does. Nevertheless thank you for the answer! Kind regards, alux

Re: Translation from Common Lisp 1

2010-03-18 Thread alux
Hello Fons, (my former answer was to Brian) I tried this one, actually. But the result is really used as output of the adventure 'game' here. So the namespace prefix must not be there. Thank you for the answer, alux On 18 Mrz., 21:50, fons haffmans fons.haffm...@gmail.com wrote: I just did

Re: Broken JSON API in clojure-contrib?

2010-03-18 Thread Michael Wood
On 18 March 2010 20:31, Timothy Washington twash...@gmail.com wrote: Too right. Thanks very much friend. No problem :) On Wed, Mar 17, 2010 at 3:25 PM, Michael Wood esiot...@gmail.com wrote: On 17 March 2010 21:18, Michael Wood esiot...@gmail.com wrote: [...] $ java -cp

Re: Translation from Common Lisp 1

2010-03-18 Thread David Nolen
On Thu, Mar 18, 2010 at 4:25 PM, alux alu...@googlemail.com wrote: Hello! I much enjoyed reading the tutorial http://www.lisperati.com/casting.html , mentioned by eyeris today. The most mind-extending thing (to me, having Java background) is the, admittedly non-idiomatic, use of symbols as

Re: Java method call irritation

2010-03-18 Thread Michael Gardner
On Mar 18, 2010, at 10:55 AM, Per Vognsen wrote: Is there any reason why a .method occurrence in non-operator position doesn't just do the closure wrapping automagically? I'd like to know this as well. Smooth Java interop is one of Clojure's selling points, but having to wrap Java methods in

Re: Translation from Common Lisp 2

2010-03-18 Thread Michael Wood
On 18 March 2010 22:38, alux alu...@googlemail.com wrote: Again, from my translation of the http://www.lisperati.com/casting.html tutorial. I completely lost track at the macro generating macro (defspel game- action .. In short, Barski writes a very simple (and neat) text adventure. To

Re: Montreal Clojure User Group

2010-03-18 Thread Michael Kohl
Don't want to start my own thread, so here goes: we are starting a functional programming user group in Vienna that - judging by the people who showed interest so far - will probably be quite heavy on all things Lisp, so it'd be nice if you could include that too:

Re: Translation from Common Lisp 1

2010-03-18 Thread Michael Gardner
On Mar 18, 2010, at 4:17 PM, David Nolen wrote: On Thu, Mar 18, 2010 at 4:25 PM, alux alu...@googlemail.com wrote: Hello! I much enjoyed reading the tutorial http://www.lisperati.com/casting.html , mentioned by eyeris today. The most mind-extending thing (to me, having Java background) is

Re: Translation from Common Lisp 2

2010-03-18 Thread Dave M
... (game-action weld chain bucket attic          (if ((and (have 'bucket) (alter-var-root (var *chain-welded*) (fn ^ Your if-condition is nested one form too deeply; try (if (and (have 'bucket) ...) ...) I haven't tried it, so there might be other problems. -Dave -- You

Re: Translation from Common Lisp 2

2010-03-18 Thread Michael Wood
On 18 March 2010 23:40, Dave M damncan...@gmail.com wrote: ... (game-action weld chain bucket attic          (if ((and (have 'bucket) (alter-var-root (var *chain-welded*) (fn                ^ Your if-condition is nested one form too deeply; try (if (and (have 'bucket) ...) ...) I haven't

Re: Translation from Common Lisp 1

2010-03-18 Thread Michael Wood
On 18 March 2010 23:40, Michael Gardner gardne...@gmail.com wrote: On Mar 18, 2010, at 4:17 PM, David Nolen wrote: On Thu, Mar 18, 2010 at 4:25 PM, alux alu...@googlemail.com wrote: Hello! I much enjoyed reading the tutorial http://www.lisperati.com/casting.html , mentioned by eyeris today.

Re: Translation from Common Lisp 1

2010-03-18 Thread Richard Newman
But using symbols for something like this is a bit contrived anyway. Maybe, but I've seen it in other Common Lisp books/tutorials before. e.g. I'm sure PAIP was one of them. Part of the motivation is that CL symbols always compare with EQ and EQL, whilst strings are not required to do so:

Re: Web Programming with clojure

2010-03-18 Thread Tim Johnson
* LauJensen lau.jen...@bestinclass.dk [100318 00:26]: Hey Tim, Welcome - I might be restating, but this should get you going quickly: Oh that's great Lau! I have been looking at your videos and was wondering where I could find text instructions (see my posting subject: Clojure 101 -

Re: Name suggestions

2010-03-18 Thread Zach Tellman
how about 'patois' or 'creole' On Mar 17, 12:08 am, mac markus.gustavs...@gmail.com wrote: After just a little more test and polish I plan on calling clj-native 1.0. But clj-native is a *really* boring name so I want to change it before 1.0 and I don't have very good imagination when it comes

Re: Java method call irritation

2010-03-18 Thread Per Vognsen
My experience as a newcomer to Clojure is that one of the most surprising things is the dichotomy between the Clojure and JVM world. I was reading one of Lau's blog posts on converting images to ASCII art: http://www.bestinclass.dk/index.php/2010/02/my-tribute-to-steve-ballmer His

type hint puzzler

2010-03-18 Thread cageface
I'm trying to eliminate some reflection overhead in little SQL utility I'm working on and can't seem to get the type hint right for this code: (import 'java.sql.ResultSet) (set! *warn-on-reflection* true) (defn rs-get-row [#^ResultSet rs] (if (.next rs) (let [cols (.. rs getMetaData

Re: type hint puzzler

2010-03-18 Thread Per Vognsen
My guess from looking at the API documentation for ResultSet is that it doesn't know which of the several one-parameter overloads of getObject to choose. Presumably you want the integer one, so try (.getObject rs (int i)). -Per On Fri, Mar 19, 2010 at 12:08 PM, cageface milese...@gmail.com

scoped local memoize

2010-03-18 Thread Greg Fodor
Hi there -- I am looking for a solution to a particular memoization pattern. I have a function foo that is the entry point of a caller that makes many thousands of calls to a function bar. In calling foo, bar will be called with many different args but there are many repeated calls to bar with the