Re: A functional, efficient, convolution function. Is imperitive-style the answer?

2010-07-19 Thread gary ng
J(a language of the APL family) excels at this problem domain. It is functional and very efficient. conv =: +//@*/ It looks like line noise but that is the whole implementation (1 1 ) conv (1 1) = 1 2 1 http://www.jsoftware.com/ -- You received this message because you are subscribed to

Could not apply function with keyword

2010-07-19 Thread boyan
I have a question about apply function. For examle,create a hash map: user= (hash-map :a 1 :b 2) {:a 1, :b 2} It works fine,but if i want to use apply: user= (apply hash-map :a 1 :b 2) java.lang.IllegalArgumentException: Don't know how to create ISeq from: java.lang.Integer (NO_SOURCE_FILE:0)

Re: Could not apply function with keyword

2010-07-19 Thread Meikel Brandmeyer
Hi, On Jul 19, 8:56 am, boyan bo...@taobao.com wrote: I have a question about  apply function. For examle,create a hash map: user= (hash-map :a 1 :b 2) {:a 1, :b 2} It works fine,but if i want to use apply: user= (apply hash-map :a 1 :b 2) java.lang.IllegalArgumentException: Don't know

Re: Could not apply function with keyword

2010-07-19 Thread Michael Wood
On 19 July 2010 09:00, Meikel Brandmeyer m...@kotka.de wrote: Hi, On Jul 19, 8:56 am, boyan bo...@taobao.com wrote: I have a question about  apply function. For examle,create a hash map: user= (hash-map :a 1 :b 2) {:a 1, :b 2} It works fine,but if i want to use apply: user= (apply

Re: Cljr and user.clj

2010-07-19 Thread Rick Moynihan
On 16 July 2010 21:23, liebke lie...@gmail.com wrote: Rick, I think the problem is that additional classpaths are added, dynamically, after the user.clj file is evaluated. It does get evaluated if it's in ./ or ./src, which are added at launch in the cljr scripts. Ahhh, I hadn't realised

Re: clojure.string namespace missing from API page?

2010-07-19 Thread Btsai
Thank you Tom :) On Jul 18, 12:10 pm, Tom Faulhaber tomfaulha...@gmail.com wrote: The official doc for clojure and clojure-contrib have moved as well. They are now at: http://clojure.github.com/clojure/ and http://clojure.github.com/clojure-contrib/ I have not got them completely

Aleph and Conjure

2010-07-19 Thread Victor S
Can conjure be used to build web app over aleph? Or what does it take to build highly scalable web apps in clojure similar to node.js and express.js? -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to

Could Clojure be used to program on top of GPU's?

2010-07-19 Thread Victor S
Hi, Just a curiosity question, I'm not sure how far off the JVM is from running on your GPU, but I imagine that with the hundreds and even thousands of cores, a GPU might, theoretically show us just what Clojure can do... -- You received this message because you are subscribed to the Google

Finding vars from macros?

2010-07-19 Thread Ryan Twitchell
Hi all, First off, clojure is great. I've been playing with it off and on for a few months now, and am really impressed. While using debug-repl I noted a minor oddity. This is just an example; not having a real problem with that package itself. user= (require 'clojure.contrib.debug) nil user=

Compojure Conjure Aleph

2010-07-19 Thread Victor S
Hello, I'm Coming here view PHP to RoR ro Node.js to Clojure (still investigating) and am mostly interesting in building scalable web applications. I hear aleph being compared to node.js but how do the other two frameworks compare in performance to the their counterparts, such as express.js and

Re: Leiningen 1.2.0 released! -- bug?

2010-07-19 Thread LordGeoffrey
I did the upgrade. seemed okay. I a resumed doing the enlive tutorial, and now when i : user= (load tutorial/scrape1) nil nothing comes back. type returns, nothing. type (+ 1 1), and i get: user= 2 Odd. From then on works as expected. Even when (load scrape1) -- tutorial :

Re: Could not apply function with keyword

2010-07-19 Thread Sanel Zukan
Hi, (apply hash-map :a 1 [:b 2]) or (apply hash-map :a 1 :b 2 nil) ...or we could be more explicit and put: user= (apply hash-map :a 1 :b 2 {}) {:a 1, :b 2} Best. On Jul 19, 9:00 am, Meikel Brandmeyer m...@kotka.de wrote: Hi, On Jul 19, 8:56 am, boyan bo...@taobao.com wrote: I have a

Re: Could Clojure be used to program on top of GPU's?

2010-07-19 Thread Nicolas Oury
This is a moving area (GPUs and CPUs seems to be in a slow process of converging), but most GPUs are good at single instruction a lot of data. (Disclaimer: I have mostly looked at nvidia gpus of ~6months ago) Most architectures are made to execute a lot of times the same instruction on a

Re: Could not apply function with keyword

2010-07-19 Thread Meikel Brandmeyer
Hi, On Jul 19, 11:13 am, Sanel Zukan san...@gmail.com wrote: ...or we could be more explicit and put: user= (apply hash-map :a 1 :b 2 {}) {:a 1, :b 2} Which looks somehow self-explaining but is wrong in general. Note the difference for a non-empty map. user= (apply hash-map {:a 1 :b 2})

IDE agnostic question on user assistance (emacs/vimClojure users help appreciated too !)

2010-07-19 Thread Laurent PETIT
Hi, I'm currently thinking about the next step for better user-assistance in Eclipse/counterclockwise. But the questions I'm facing are general - enough so that they can be posted here. Preliminary info: user assistance (code completion, var documentation, etc.) is mainly obtained from a

Re: Finding vars from macros?

2010-07-19 Thread Meikel Brandmeyer
Hi, using proper syntax-quote, ie. the backtick, normally takes care of these problems. What you describe might happen if someone used normal quote, ie. the apostrophe, in the macro expansion. Since there is no clojure.contrib.debug and the debug-repl by George Jahad does the right thing, it's

Re: Could Clojure be used to program on top of GPU's?

2010-07-19 Thread ajuc
Look at Penumbra: http://github.com/ztellman/penumbra Greetings. -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your

Re: Compojure Conjure Aleph

2010-07-19 Thread David Nolen
On Sun, Jul 18, 2010 at 10:38 PM, Victor S victor.s...@gmail.com wrote: Hello, I'm Coming here view PHP to RoR ro Node.js to Clojure (still investigating) and am mostly interesting in building scalable web applications. I hear aleph being compared to node.js but how do the other two

Re: Could Clojure be used to program on top of GPU's?

2010-07-19 Thread Timothy Baldridge
Most architectures are made to execute a lot of times the same instruction on a different block of data. You can have if...then...else... in your GPU programs, but every processor will execute both branchs (with a tag saying wether or not it is *really* executing it or not) This is kindof

Patch to make leiningen at least try to be portable...

2010-07-19 Thread Mike Meyer
Ok, I submitted a patch to the leiningen issue tracker on github to make the lein.sh script work on systems that aren't GNU/Linux derivatives or imitators. Since I couldn't find a place to upload the patch I just added it to the comment, wherein github's markdown apparently mangled it, resulting

Re: Leiningen 1.2.0 released! -- bug?

2010-07-19 Thread Phil Hagelberg
On Sun, Jul 18, 2010 at 9:11 PM, LordGeoffrey lordgeoff...@optusnet.com.au wrote: I did the upgrade. seemed okay. I a resumed doing the enlive tutorial, and now when i : user= (load tutorial/scrape1) nil nothing comes back. type returns, nothing. type (+ 1 1), and i get: user= 2 There

Re: Why does using a dynamic binding make a function impure?

2010-07-19 Thread Paul Richards
On 17 July 2010 23:57, Laurent PETIT laurent.pe...@gmail.com wrote: Hi, 2010/7/17 Paul Richards paul.richa...@gmail.com The Programming Clojure book states: Functions that use dynamic bindings are not pure functions..  (P2.0, page 174). I do not understand why this must be the case, can

Re: Why does using a dynamic binding make a function impure?

2010-07-19 Thread Stuart Halloway
use = rely on In your example, func relies on a variable which is (presumably, based on its use in other-func) intended for dynamic binding. Therefore, func is impure. It is idiomatic to name such variables with earmuffs, e.g. *forty-two*. Stu On 17 July 2010 23:57, Laurent PETIT

Re: Patch to make leiningen at least try to be portable...

2010-07-19 Thread Sean Devlin
This is be discussed in the lein group http://groups.google.com/group/leiningen On Jul 19, 10:39 am, Mike Meyer mwm-keyword-googlegroups. 620...@mired.org wrote: Ok, I submitted a patch to the leiningen issue tracker on github to make the lein.sh script work on systems that aren't GNU/Linux

Re: IDE agnostic question on user assistance (emacs/vimClojure users help appreciated too !)

2010-07-19 Thread Chas Emerick
Automatically reloading namespaces into a REPL that I'm actively using is a very bad idea -- I expect to control what happens within REPLs I start, and subverting that is decidedly impolite IMO. I can expect to see odd behaviour when that happens, insofar as I assume new code I've written

Re: IDE agnostic question on user assistance (emacs/vimClojure users help appreciated too !)

2010-07-19 Thread Meikel Brandmeyer
Hello Laurent, please let me explain my philosophy before I go into details how VimClojure handles the clojure connection. Vim is not an IDE like Eclipse or Netbeans. It is an editor which can be used with other tools to form an IDE, but on its own it is not. The tools should only do what the

Re: Why does using a dynamic binding make a function impure?

2010-07-19 Thread Laurent PETIT
2010/7/19 Stuart Halloway stuart.hallo...@gmail.com use = rely on In your example, func relies on a variable which is (presumably, based on its use in other-func) intended for dynamic binding. Therefore, func is impure. It is idiomatic to name such variables with earmuffs, e.g.

Re: IDE agnostic question on user assistance (emacs/vimClojure users help appreciated too !)

2010-07-19 Thread Laurent PETIT
That's interesting ! Thanks for the feedback. Please note that it's not impolite in the sense that there's a policy: the project is reloaded in the REPL when the file is saved - that's a kind of invitation made by the user :-). If you don't work from the files, but from the REPL, nothing will

Re: IDE agnostic question on user assistance (emacs/vimClojure users help appreciated too !)

2010-07-19 Thread Meikel Brandmeyer
Hi, Am 19.07.2010 um 20:50 schrieb Laurent PETIT: Please note that it's not impolite in the sense that there's a policy: the project is reloaded in the REPL when the file is saved - that's a kind of invitation made by the user :-). If you don't work from the files, but from the REPL,

Re: IDE agnostic question on user assistance (emacs/vimClojure users help appreciated too !)

2010-07-19 Thread Barry Dahlberg
As a Clojure newbie coming from Microsoft land I was surprised by the answers here. Eclipse / CCW is the IDE I've used most so far and I've always wondered why it didn't just open the REPL for me and have it always there. Having it up to date with my latest code files is great because I mostly

Re: Why does using a dynamic binding make a function impure?

2010-07-19 Thread Meikel Brandmeyer
Hi, Am 19.07.2010 um 20:41 schrieb Laurent PETIT: But the OP is somehow true: it is by convention that it is declared pure. Indeed, even func itself could have been rebound dynamically, thus making the content of the result theoretically unpredictable, given only the values of its

Re: Compojure Conjure Aleph

2010-07-19 Thread Stefan Tilkov
On 19.07.2010, at 04:38, Victor S wrote: Hello, I'm Coming here view PHP to RoR ro Node.js to Clojure (still investigating) and am mostly interesting in building scalable web applications. I hear aleph being compared to node.js but how do the other two frameworks compare in performance

Re: Why does using a dynamic binding make a function impure?

2010-07-19 Thread Paul Moore
On 19 July 2010 19:41, Laurent PETIT laurent.pe...@gmail.com wrote: 2010/7/19 Stuart Halloway stuart.hallo...@gmail.com use =  rely on In your example, func relies on a variable which is (presumably, based on its use in other-func) intended for dynamic binding. Therefore, func is impure.

Re: Why does using a dynamic binding make a function impure?

2010-07-19 Thread Brenton
Hi Paul, Pure functions have two properties: they cannot produce side effects and the return value is a function (in the mathematical sense) of its arguments and nothing else. There are two corresponding questions that you can ask when looking at a function to determine if it is pure. 1) When I

Re: Why does using a dynamic binding make a function impure?

2010-07-19 Thread Meikel Brandmeyer
Laurent, Am 19.07.2010 um 21:31 schrieb Meikel Brandmeyer: I would say it is pure „by implementation detail.“ Given the direct link feature which was in place for clojure.core for a while it would be pure. Because then you can't rebind things anymore. Please ignore me. Of course dynamic

Re: Finding vars from macros?

2010-07-19 Thread Ryan Twitchell
Cloning from http://github.com/GeorgeJahad/debug-repl.git, I see the same behavior (but a different namespace). The (overloaded, no arg) expansion of the debug-repl macro returns a form by using a normal quote. The difference being between normal quote and syntax quote does mostly answer my

Re: Finding vars from macros?

2010-07-19 Thread Meikel Brandmeyer
Hi, Am 19.07.2010 um 21:47 schrieb Ryan Twitchell: Cloning from http://github.com/GeorgeJahad/debug-repl.git, I see the same behavior (but a different namespace). The (overloaded, no arg) expansion of the debug-repl macro returns a form by using a normal quote. Yes. I think this is a

Re: IDE agnostic question on user assistance (emacs/vimClojure users help appreciated too !)

2010-07-19 Thread Peter Schuller
Users of Emacs / swank, vimClojure (etc.), please speak ! Share with us your workflows, why you think the goal I'm trying to achieve is good or not, so that we could think of better workflows to provide to IDE users if it seems appropriate. To the limited extent that I've developed with Slime

Re: Could Clojure be used to program on top of GPU's?

2010-07-19 Thread Zach Tellman
Hi Victor, I've written Penumbra (http://github.com/ztellman/penumbra), which is a wrapper for OpenGL that allows for some limited general purpose computation. I've also written Calx (http://github.com/ztellman/calx) which is a wrapper for OpenCL, and it's designed for general purpose

Re: IDE agnostic question on user assistance (emacs/vimClojure users help appreciated too !)

2010-07-19 Thread Meikel Brandmeyer
Hi, Am 19.07.2010 um 21:56 schrieb Peter Schuller: To the limited extent that I've developed with Slime (and this goes for both Common Lisp and clojure), one annoyance I have perceived is de-normalization of the image/running repl. While having a running live repl is great in many ways, when

Re: IDE agnostic question on user assistance (emacs/vimClojure users help appreciated too !)

2010-07-19 Thread Mark Rathwell
:reload reloads the specified namespace There is also :reload-all, which reloads the specified namespace as well as all namespaces import'ed, use'd, and require'd in the specified namespace. ex: (require '[some.ns.foo :as foo] :reload-all) On Mon, Jul 19, 2010 at 4:09 PM, Meikel Brandmeyer

Re: IDE agnostic question on user assistance (emacs/vimClojure users help appreciated too !)

2010-07-19 Thread Peter Schuller
I haven't tested what happens to the deftest stuff, but the „moving function“ could be addressed. Cool. I had not yet run into the moving function case with clojure (I did several times with Common Lisp), so that might be a non-issue. I was just presuming that no magic was going on. -- /

Re: IDE agnostic question on user assistance (emacs/vimClojure users help appreciated too !)

2010-07-19 Thread Meikel Brandmeyer
Hi, Am 19.07.2010 um 22:20 schrieb Peter Schuller: I haven't tested what happens to the deftest stuff, but the „moving function“ could be addressed. Cool. I had not yet run into the moving function case with clojure (I did several times with Common Lisp), so that might be a non-issue. I

Re: IDE agnostic question on user assistance (emacs/vimClojure users help appreciated too !)

2010-07-19 Thread Laurent PETIT
2010/7/19 Meikel Brandmeyer m...@kotka.de Hello Laurent, please let me explain my philosophy before I go into details how VimClojure handles the clojure connection. 1. Vim is *not* an IDE like Eclipse or Netbeans. It is an editor which can be used with other tools to form an IDE,

Re: IDE agnostic question on user assistance (emacs/vimClojure users help appreciated too !)

2010-07-19 Thread Mark Rathwell
In my stupidity I chose prn as function name, which removed from the namespace on reload, because clojure.core/prn „overwrites“ the Var again. Maybe such a functionality could be also implemented for normal reload? But then what happens to other namespaces which refer to this Var? I admit, this is

Re: IDE agnostic question on user assistance (emacs/vimClojure users help appreciated too !)

2010-07-19 Thread Laurent PETIT
2010/7/19 Barry Dahlberg barry.dahlb...@gmail.com As a Clojure newbie coming from Microsoft land I was surprised by the answers here. Eclipse / CCW is the IDE I've used most so far and I've always wondered why it didn't just open the REPL for me and have it always there. Several reasons.

Re: IDE agnostic question on user assistance (emacs/vimClojure users help appreciated too !)

2010-07-19 Thread Laurent PETIT
2010/7/19 Peter Schuller peter.schul...@infidyne.com Users of Emacs / swank, vimClojure (etc.), please speak ! Share with us your workflows, why you think the goal I'm trying to achieve is good or not, so that we could think of better workflows to provide to IDE users if it seems

Re: IDE agnostic question on user assistance (emacs/vimClojure users help appreciated too !)

2010-07-19 Thread Meikel Brandmeyer
Hi, Am 19.07.2010 um 23:01 schrieb Mark Rathwell: Notice, the removed function in foo1 still exists, because it was not overwritten by anything. This is true if the function name is not used in anything the namespace refers to. Take eg. my first example with prn. There the reload overwrites

Re: IDE agnostic question on user assistance (emacs/vimClojure users help appreciated too !)

2010-07-19 Thread Meikel Brandmeyer
Laurent, Am 19.07.2010 um 23:16 schrieb Laurent PETIT: Well, by activating the automatic builder feature of an IDE, I /suppose/ users typically think this is a way to tell the IDE to do automatic rebuilds. rebuild here meaning AOT compilation of the strict necessary files, and reload of

Re: Leiningen 1.2.0 released!

2010-07-19 Thread Daniel Gagnon
Impressive list of new features! By the way, what's left to do for the Windows support to stop being experimental? -- 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: IDE agnostic question on user assistance (emacs/vimClojure users help appreciated too !)

2010-07-19 Thread Mark Rathwell
Also, notice that we specified :reload-all for foo1, which then reloads foo2 in the context of foo1, so when calling a function in foo1 that calls foo2, we get the updated output. But, when calling foo2 functions directly, we get the old functions. No. This is wrong. There is only one

Re: IDE agnostic question on user assistance (emacs/vimClojure users help appreciated too !)

2010-07-19 Thread j-g-faustus
I haven't tried CCW, but I am happy with Enclojure 6.8. (In 6.9 the file navigator which lists the functions and vars in the file doesn't work yet, and the navigator is perhaps 50% of the value I derive from an IDE.) Am 19.07.2010 um 20:50 schrieb Laurent PETIT: If you work from the files,

Re: IDE agnostic question on user assistance (emacs/vimClojure users help appreciated too !)

2010-07-19 Thread Lee Spector
I'm using Eclipse/Counterclockwise these days but one of the first things I did was to figure out how to turn off the automatic build-on-save behavior. I save all of the time -- usually every complete thought which may be as little as a symbol or a line or a small expression -- and when I do

Re: IDE agnostic question on user assistance (emacs/vimClojure users help appreciated too !)

2010-07-19 Thread Lee Spector
On Jul 19, 2010, at 5:22 PM, Laurent PETIT wrote: Some people have reported that they launch several REPLs when the first one is busy for a long time. What they really do, though, is that they launch a new java environment with the project files and dependencies. When we have a proper REPL

Re: IDE agnostic question on user assistance (emacs/vimClojure users help appreciated too !)

2010-07-19 Thread Lee Spector
On sketching-in-nonlinear-order, that's definitely how I write too, both code and prose (and email!). This has implications not only for the automatic build behavior we were discussing but also for the structure-based editing discussion from a week or two ago. If you piece together your code

Re: IDE agnostic question on user assistance (emacs/vimClojure users help appreciated too !)

2010-07-19 Thread Rick Moynihan
On 19 July 2010 22:25, Laurent PETIT laurent.pe...@gmail.com wrote: 2010/7/19 Peter Schuller peter.schul...@infidyne.com I also sympathize and agree that it can be hugely problematic if an environment stomps on your carefully prepared REPL in ways you don't expect. I'm not sure how to best

Re: Aleph and Conjure

2010-07-19 Thread Matt
I don't have any experience with aleph, node.js, or express.js. But assuming you can use those technologies with Ring, then you should be able to do it with Conjure. -Matt Courtney On Jul 18, 8:26 pm, Victor S victor.s...@gmail.com wrote: Can conjure be used to build web app over aleph? Or what

Haskell?

2010-07-19 Thread Jared
I am curious; for the people with Haskell experience why did you decide to use Clojure? I am asking this because Haskell and Clojure seem to solve similar types of problems. When would you want to use Haskell instead of Clojure and visa-versa? -- You received this message because you are

Re: Haskell?

2010-07-19 Thread Raoul Duke
On Mon, Jul 19, 2010 at 4:34 PM, Jared tri...@gmail.com wrote: I am curious; for the people with Haskell experience why did you decide to use Clojure? I am asking this because Haskell and Clojure seem to solve similar types of problems. When would you want to use Haskell instead of Clojure and

Re: Haskell?

2010-07-19 Thread Wilson MacGyver
1 word. JVM. the amount of java libs to be tapped is amazing. My experience with haskell libs has been mixed bag. In the case of clojure, XML parsing, database connection, kicking up a web server, natural language parsing. There is a Jar for that OTH, there are situations where we can't use

Re: Haskell?

2010-07-19 Thread Mark Engelberg
On Mon, Jul 19, 2010 at 4:34 PM, Jared tri...@gmail.com wrote: I am curious; for the people with Haskell experience why did you decide to use Clojure? I am asking this because Haskell and Clojure seem to solve similar types of problems. When would you want to use Haskell instead of Clojure and

Re: Haskell?

2010-07-19 Thread Sean Corfield
On Mon, Jul 19, 2010 at 4:34 PM, Jared tri...@gmail.com wrote: I am curious; for the people with Haskell experience why did you decide to use Clojure? I am asking this because Haskell and Clojure seem to solve similar types of problems. When would you want to use Haskell instead of Clojure and

Re: IDE agnostic question on user assistance (emacs/vimClojure users help appreciated too !)

2010-07-19 Thread Chas Emerick
Saving a file is not an invitation to do anything with the REPLs that I started -- it's an invitation to save the file! :-D And no, I write a lot of code in the REPL at all. I *load* a lot of code into REPLs, yes, multiple active REPLs, all the time. Actually writing code in what is

Re: IDE agnostic question on user assistance (emacs/vimClojure users help appreciated too !)

2010-07-19 Thread Chas Emerick
Forgot one thing: On Jul 19, 2010, at 2:50 PM, Laurent PETIT wrote: Anyway, I didn't expect you reaction to be soo opinionated, and it's refreshing to hear others thoughts. Strong opinions, weakly held, 24/7. ;-) - Chas -- You received this message because you are subscribed to the

Re: terracotta?

2010-07-19 Thread Chas Emerick
I can't respond to that, but presumably these issues are irrelevant if one were using terracotta to coordinate asynchronous independent computation, e.g. using agents heavily? - Chas On Jul 16, 2010, at 8:00 AM, peter veentjer wrote: To repeat myself again: The big problem with a MVCC

Re: Haskell?

2010-07-19 Thread Rayne
Because monads make me cry, and I like the JVM. On Jul 19, 6:34 pm, Jared tri...@gmail.com wrote: I am curious; for the people with Haskell experience why did you decide to use Clojure? I am asking this because Haskell and Clojure seem to solve similar types of problems. When would you want to

Re: Haskell?

2010-07-19 Thread Laurent PETIT
Because I saw Haskell as a good language to shape my mind, and then I found Clojure a 2010/7/20 Jared tri...@gmail.com I am curious; for the people with Haskell experience why did you decide to use Clojure? I am asking this because Haskell and Clojure seem to solve similar types of problems.

Re: Haskell?

2010-07-19 Thread Laurent PETIT
2010/7/20 Laurent PETIT laurent.pe...@gmail.com Because I saw Haskell as a good language to shape my mind, and then I found Clojure a ... and then I found Clojure, a good language to shape my mind, have things done, and (eventually I hope), help pay the bills. (yeah, the short answer is JVM