-XX:PermSize=512m prevents performance degradation over time

2010-02-04 Thread Albert Cardona
Hi all, I wanted to share a JVM setting that is improving clojure performance (for me) in long running processes: MaxPermSize and PermSize, which define the size of the permanent generation in the garbage collector. I am doing heavy image processing, with many long-lived objects. Performance is

Re: set/select vs. other set functions: argument order and -

2010-02-04 Thread Tayssir John Gabbour
On Feb 4, 3:31 am, wlr geeked...@gmail.com wrote: (- #{{:a 1, :b 1, :c 1} {:a 2, :b 2, :c 2} {:a 3, :b 3, :c 3}} (- (select #(= (:a %) 1))) (project [:b :c])) = #{{:c 1, :b 1}} Ahhh.. what a tricky language. ;) This saves me from writing reverse- args or

Re: Naming Functions...

2010-02-04 Thread Laurent PETIT
I would do as you do, finding a name, hopefully good enough to prevent an imperative need to jump to the function definition when re-reading the code 6 months later. Anyway, would you have written this particular function as a method of a class, would the problem of giving it a short but

Re: Naming Functions...

2010-02-04 Thread Michał Marczyk
On 4 February 2010 08:04, Wardrop t...@tomwardrop.com wrote: (defn insert-name-here [n base]  (loop [n n count 0]    (if ( n base)      {:val n :count count}      (recur (float (/ n base)) (inc count) [ ... ] I mean, what the hell would you name this function, or would you not create

Re: Proposal: New fn assoc-in-with

2010-02-04 Thread Sean Devlin
Some Thinking out loud here... My last concern with assoc-in arrays has to do with how it is currently used for maps. The way it creates elegant nested structures is nice, and it requires very little understanding of the current structure of the map. However, assoc-in has a few more

Pattern Matching

2010-02-04 Thread Sean Devlin
Do we have a concise way of doing this? Is it actually useful? http://www.artima.com/weblogs/viewpost.jsp?thread=281160 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

Re: set/select vs. other set functions: argument order and -

2010-02-04 Thread wlr
Well, I think you've exposed an inconsistency in the signature of clojure.set/select vis-a-vis the collection first, sequence last principles here: http://groups.google.com/group/clojure/msg/a8866d34b601ff43 It seems that the collection function clojure.set/select is patterned after the sequence

Re: Pattern Matching

2010-02-04 Thread Tayssir John Gabbour
Hi, On Feb 4, 3:08 pm, Sean Devlin francoisdev...@gmail.com wrote: Do we have a concise way of doing this? Is it actually useful? http://www.artima.com/weblogs/viewpost.jsp?thread=281160 Yep, see clojure.contrib.types/match. I recently used it in an almost frivolous way in this thread,

Closures and environments

2010-02-04 Thread Ludovic Kuty
Hello, I was wondering if symbol resolution in local scope (in a let or function body) works the same way as it is in Scheme. I would like to know some internals of Clojure when it comes to that. I thought about explaining how closures work to my students using that analogy (is it just an analogy

Re: Proposal: New fn assoc-in-with

2010-02-04 Thread ajuc
Maybe sth like that (defn assoc-in-maybe-creating [coll keys creator-fns value] ...) so it can be used: (assoc-in-maybe-creating [ {:a (sorted-map :X 1, :Y 2, :Z 3) :c (sorted-map :X 1, :Z 3)} {:b (sorted-map :X 1, :Y 2, :Z 3)} {:f (sorted-map :X 1, :Y 2)}] [0 :b :X] [vector

Re: Closures and environments

2010-02-04 Thread Sean Devlin
You can take a look at the IFn, AFn Fn files in the clojure.lang package to get a better understanding of what is going on. Sean On Feb 4, 8:33 am, Ludovic Kuty ludovic.k...@gmail.com wrote: Hello, I was wondering if symbol resolution in local scope (in a let or function body) works the

Re: Pattern Matching

2010-02-04 Thread Jon Harrop
On Thursday 04 February 2010 14:08:44 Sean Devlin wrote: Do we have a concise way of doing this? Is it actually useful? http://www.artima.com/weblogs/viewpost.jsp?thread=281160 Are you talking about the pattern matching or the for loop? -- Dr Jon Harrop, Flying Frog Consultancy Ltd.

lein - how to add Class-Path entries to uberjar MANIFEST.MF

2010-02-04 Thread Amitava
Much like :main option in defproject, I would like to add Class-Path entries to MANIFEST.MF Here's my unsuccessful attempt pre (defproject ashee/lein-test 1.0.0-SNAPSHOT :description FIXME: write :dependencies [ [org.clojure/clojure 1.1.0]

Re: Coljure-contrib maven build fail

2010-02-04 Thread Stuart Sierra
This has been reported before. It's a bug that shows up on Windows. Please make an Assembla ticket. In the mean time, build with -Dmaven.test.skip=true to ignore the failure. -SS On Feb 3, 5:49 pm, Base basselh...@gmail.com wrote: Hi Pulling off of GIT I got the following 4 errors in the

Re: Pattern Matching

2010-02-04 Thread Sean Devlin
Pattern matching On Feb 4, 12:12 pm, Jon Harrop j...@ffconsultancy.com wrote: On Thursday 04 February 2010 14:08:44 Sean Devlin wrote: Do we have a concise way of doing this?  Is it actually useful? http://www.artima.com/weblogs/viewpost.jsp?thread=281160 Are you talking about the pattern

Re: Clojure for system administration

2010-02-04 Thread Stuart Sierra
Clojure can certainly do these things; clojure-contrib contains many file and io-related utilities. But remember that Clojure, like any Java program, takes more time to start up than scripting languages like Perl/Bash/Ruby/Python, so it may be less suitable for programs that you intend to run at

Re: Pattern Matching

2010-02-04 Thread Tayssir John Gabbour
On Feb 4, 3:28 pm, Tayssir John Gabbour tayssir.j...@googlemail.com wrote: I can't say I haven't used pattern matching as much as I probably should, Excuse me, I mean that I haven't used it much though I keep hearing about it... -- You received this message because you are subscribed to the

Re: Closures and environments

2010-02-04 Thread Stuart Sierra
Hi, The functionality of closures in Clojure is more or less the same as Scheme. But the implementation may be quite different. I seem to recall that some Schemes treat lexical environments as first-class objects. Clojure does not (at present). Here's what happens in Clojure: When you write

Run expression, with particular functions replaced

2010-02-04 Thread Bryce
I want to create a macro that takes an expression, and runs it against a collection after replacing a bunch of function calls via the replace function. Something like this: (def a {'+ '*}) (def b '(+ a b)) (defmacro substituteFuncs [replacelist expresn target] (#((replace replacelist expresn)

Re: Seattle Clojure meeting

2010-02-04 Thread Stan Dyck
I can do the 11th as well. StanD. Kevin Downey wrote: the 11th at Zokas is good for me On Wed, Feb 3, 2010 at 10:07 PM, ajay gopalakrishnan ajgop...@gmail.com wrote: I'm in! But on 11th. I cannot make it on 15th On Wed, Feb 3, 2010 at 7:01 PM, Phil Hagelberg p...@hagelb.org wrote: Hello,

Re: Pattern Matching

2010-02-04 Thread Jon Harrop
On Thursday 04 February 2010 16:32:36 Sean Devlin wrote: Pattern matching Ok. Pattern matching is a core construct from the ML family of languages and, consequently, is now ubiquitous in F#, OCaml, Standard ML and Haskell as well as Scala. In the MLs, pattern matching is the only way to

Re: Clojure for system administration

2010-02-04 Thread Phil Hagelberg
On Thu, Feb 4, 2010 at 8:33 AM, Stuart Sierra the.stuart.sie...@gmail.com wrote: Clojure can certainly do these things; clojure-contrib contains many file and io-related utilities.  But remember that Clojure, like any Java program, takes more time to start up than scripting languages like

Re: Clojure for system administration

2010-02-04 Thread Richard Newman
in a bash (or other language) script anyway to handle the classpath, The classpath is a perpetual source of frustration. It drives me nuts every time I have to restart swank to work on a different project with a different classpath. It certainly means that something like a Clojure shell

Re: Is this possible in Clojure?

2010-02-04 Thread Greg
Thanks Meikel, if I may reply to your points and your function as it's slightly different from what I wanted: * It's a function, not macro. I need it to be a macro because it's more usable for my purposes that way. The newLISP function is being used to generate templates php-style:

Re: Is this possible in Clojure?

2010-02-04 Thread Greg
Whoops, I need to correct this statement: There's nothing forcing you to use it as a literal, the newLISP version can be used with a let statement just as your example did. Indeed in the original newlisp version I gave you wouldn't be able to use it with the let form, but that's because I

Re: Run expression, with particular functions replaced

2010-02-04 Thread Michał Marczyk
On 4 February 2010 17:24, Bryce fiat.mo...@gmail.com wrote: I'm sure I'm messing up something fairly basic; any idea what I'm doing wrong? 1. At the time the code inside your macro definition executes, the a you pass in as the first argument in your example is just a symbol. Ditto for b. It

Re: Clojure for system administration

2010-02-04 Thread Brenton
I have created a clj command on my system (using Ruby, http://gist.github.com/247899) that will run a Clojure script or launch the REPL. For example: clj script.clj or just clj script will run as script. You may also pass args to the Clojure script like this clj script arg1 arg2. You may also

Re: Is this possible in Clojure?

2010-02-04 Thread Richard Newman
* You don't have to fiddle with magic names. The user can choose himself. These aren't magic names, they're just like you keywords, except they're symbols, and they're not magic because they're defined by the columns of the table. Or, I may be misunderstanding your use of the term

Re: Naming Functions...

2010-02-04 Thread Erik Price
What kind of naming convention is appropriate for a function that operates on a sequence, and, as one of its return values, returns a new head for (or in other words a subsequence within) that sequence? For example, a function that consumes some portion of a stream. Or is it not conventional for a

Re: Run expression, with particular functions replaced

2010-02-04 Thread Bryce
3. Making your example work would necessitate discovering which of the symbols in the (+ a b) form are to be treated as formal arguments. In this case, the answer would be a (to be bound to 3) and b (to be bound to 4). In general, that's very nearly impossible, as any symbol not in your

Re: Is this possible in Clojure?

2010-02-04 Thread Meikel Brandmeyer
Hi, Am 04.02.2010 um 18:55 schrieb Greg: I need it to be a macro because it's more usable for my purposes that way. The newLISP function is being used to generate templates php-style: table trtdName/tdtdEmail/td/tr % (for-query-with-db db SELECT * FROM

Re: Naming Functions...

2010-02-04 Thread Meikel Brandmeyer
Hi, Am 04.02.2010 um 20:00 schrieb Erik Price: What kind of naming convention is appropriate for a function that operates on a sequence, and, as one of its return values, returns a new head for (or in other words a subsequence within) that sequence? For example, a function that consumes some

Re: Full Disclojure - I Need Topics!

2010-02-04 Thread Alex Stoddard
Suggestion: meta-data in clojure, what it is, how to work with it, idiomatic uses. Thanks for the great series, Alex -- 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

Re: Clojure for system administration

2010-02-04 Thread Michael Wood
On 4 February 2010 20:47, Brenton bashw...@gmail.com wrote: I have created a clj command on my system (using Ruby, http://gist.github.com/247899) that will run a Clojure script or launch the REPL. For example: clj script.clj or just clj script will run as script. [...] Clojure also ignores

Re: clojure box 1.0 failed to connect to emacs server

2010-02-04 Thread Rollo
Hello, Sorry for the late reply on this. Haven't got that much time lately to experiment. So actually I got it working in any of the versions (1.0, 1.1RC1, 1.1.0-1). The trick is simply to right-click and 'Run as admin'. Somehow, on Windows 7, emacs won't start when using a non-privileged

Clojure Jobs in White Plains, NY

2010-02-04 Thread Eric Thorsen
ThorTech Solutions is seeking exceptional developers to join our team. The work will be primarily on a new product, predominantly written in Clojure. If you are a passionate individual who is self directed but thrives in a team environment and team results, has experience with several of the

Re: Is this possible in Clojure?

2010-02-04 Thread Greg
On Feb 4, 2010, at 1:51 PM, Richard Newman wrote: * You don't have to fiddle with magic names. The user can choose himself. These aren't magic names, they're just like you keywords, except they're symbols, and they're not magic because they're defined by the columns of the table. Or, I

Re: Is this possible in Clojure?

2010-02-04 Thread Richard Newman
OK, I hope you can see the difference though between that and what I showed. Of course I can; I'm just illustrating a point by exaggeration. They are not the same; in your example: - It's not clear what the magic symbols are - The user does not specify the magic symbols (as they did in

Re: Full Disclojure - I Need Topics!

2010-02-04 Thread Glen Stampoultzis
On 25 January 2010 16:34, Sean Devlin francoisdev...@gmail.com wrote: Hello everyone, I'm having a blast making the Full Disclojure series. It's one the best projects I've had a chance to work on. However, there's going to be a problem soon. I only have a few more topics left before I run

Re: Is this possible in Clojure?

2010-02-04 Thread Greg
It's not clear in the case of multiple packages or namespaces. (In which package does name get interned? It depends on *when* the string is interned, because that decides the enclosing scope. Or does newLISP not have packages?) NAME (not name) may be interned in the sense that it will

Re: Is this possible in Clojure?

2010-02-04 Thread Greg
I don't see why a macro should be of more use here. With a macro the db query is always done, when the page is compiled. I don't see how this would an advantage. With a function it could be compiled once at startup and when the page is accessed you just fire off a clojure function which

Re: Is this possible in Clojure?

2010-02-04 Thread Greg
It's not clear in the case of multiple packages or namespaces. (In which package does name get interned? It depends on *when* the string is interned, because that decides the enclosing scope. Or does newLISP not have packages?) NAME (not name) may be interned in the sense that it will

Re: Pattern Matching

2010-02-04 Thread Tom Faulhaber
Also, check out Tim Lopez's work here: http://www.brool.com/index.php/pattern-matching-in-clojure He has a nice version that can be used for both Lisp-y and Haskell-y stuff, though it's not quite as full featured as what you'd see in traditional AI systems. Tom -- You received this message

Re: Pattern Matching

2010-02-04 Thread Base
Hi John - Thanks for a very intersting response. Do you have any real experience in F#? I am really interested in hearing your opinion/thoughts on it relative to other functional languages (you appear to be quite well versed). It looks very interesting, but I am frankly having a hard enough

Re: Is this possible in Clojure?

2010-02-04 Thread Richard Newman
NAME (not name) may be interned in the sense that it will exist somewhere in the symbol tree, but that doesn't matter—at all. At least in newLISP. In Clojure it may have some consequences and if so, that would be a valid argument to make, I'd be interested to know what they are if that is

Re: Is this possible in Clojure?

2010-02-04 Thread Richard Newman
Enlive has to reconstruct HTML from its data structures. This, on the other hand, mostly just prints already rendered strings, and calls any clojure functions/macros along the way. Most CL/Clojure HTML output systems, like clj-html or CL-WHO, produce optimal output by processing the macro

Re: Is this possible in Clojure?

2010-02-04 Thread Greg
(let [keys Chubb] (println (clojure.core/keys {:foo :bar}))) Yes, I really like this aspect of Clojure. What does newLISP do for a query like SELECT p1.name, p2.name from people p1 JOIN people p2; newLISP doesn't do anything, but sqlite3 will tell you that there are 2 columns for

Re: Is this possible in Clojure?

2010-02-04 Thread Greg
Templating does not require eval. I don't recall saying it did. I think you misunderstood what I said. I was musing about implementing PHP-style templating in Clojure, and I was wondering whether it was possible to avoid calling eval on each render. Someone has implemented PHP-style

Re: Is this possible in Clojure?

2010-02-04 Thread Richard Newman
And he does have some eval's in there: http://github.com/brool/gulliver/blob/master/template-servlet.clj But my Clojure knowledge isn't yet good enough to tell me whether he's using eval only once or on every render? It uses eval at runtime, but only once: that code slurps a template,

Re: Naming Functions...

2010-02-04 Thread Wardrop
Hi Michael, Thanks for the implementation suggestion. I left school 2 years only so missed out on some of the more advanced mathematics, hence I was unaware of the function and purpose of log. Since reading your post, I've done a little bit of research on log as to educate myself. I've now

Re: Is this possible in Clojure?

2010-02-04 Thread Greg
It uses eval at runtime, but only once: that code slurps a template, turns it into s-expressions, then uses eval to define a function named `render` in the appropriate namespace. Pretty nice. Awesome, yes that'll do then. Good to know this is possible in Clojure. I much prefer this style of

Re: Seattle Clojure meeting

2010-02-04 Thread Howard Lewis Ship
I might drive up on the 15th, or take the train. I'm just getting back from London on the 14th though, so maybe next meeting for me. On Wed, Feb 3, 2010 at 7:01 PM, Phil Hagelberg p...@hagelb.org wrote: Hello, clojurists of Seattle. Let's meet! I'm thinking of getting folks together from 7pm

Re: Full Disclojure - I Need Topics!

2010-02-04 Thread Greg
Here's a challenge for you - Monads. If you can clearly explain monads you'll be my hero. :-) Seconded. Plus the existing Clojure docs I'm able to find on monads seem to be totally out of date, the example code fails to run as well. - Greg On Feb 4, 2010, at 5:55 PM, Glen Stampoultzis

Re: Full Disclojure - I Need Topics!

2010-02-04 Thread Seth
Sean, The new installation videos look great -- I have linked to them from my company's intranet. Any plans for an installation video for Counterclockwise for Eclipse? It's neat of you to produce these videos in your spare time -- they are much appreciated! On Feb 4, 9:35 pm, Greg

Re: Full Disclojure - I Need Topics!

2010-02-04 Thread Sean Devlin
On Feb 4, 9:54 pm, Seth seth.schroe...@gmail.com wrote: Sean, The new installation videos look great -- I have linked to them from my company's intranet. Any plans for an installation video for Counterclockwise for Eclipse? Eclipse is on the to-do list. Keep your eyes open. It's neat of

Re: Seattle Clojure meeting

2010-02-04 Thread Tim Clemons
I'm interested as well. Either the 11th or 15th works for me. -- Tim. On Feb 4, 5:57 pm, Howard Lewis Ship hls...@gmail.com wrote: I might drive up on the 15th, or take the train.  I'm just getting back from London on the 14th though, so maybe next meeting for me. On Wed, Feb 3, 2010 at

Re: Clojure for system administration

2010-02-04 Thread Tim Clemons
Perhaps the solution is to have a *nix shell implemented in Clojure. That would limit the start-up issue to a single initial instance. Then the user can proceed to use regular command-line functionality interspersed with Clojure scripts. Think of it as a hybrid REPL. On Feb 4, 9:35 am, Phil

Re: Clojure for system administration

2010-02-04 Thread Greg
A much easier solution is to go with a lisp designed for exactly the task of scripting. I whole-heartedly recommend newLISP for this: http://www.newlisp.org/ Clojure is excellent when you need a powerhouse LISP capable of great feats, but newLISP is far better suited for scripting tasks, it

Re: Clojure for system administration

2010-02-04 Thread ataggart
On Feb 4, 9:35 am, Phil Hagelberg p...@hagelb.org wrote: On Thu, Feb 4, 2010 at 8:33 AM, Stuart Sierra the.stuart.sie...@gmail.com wrote: Clojure can certainly do these things; clojure-contrib contains many file and io-related utilities.  But remember that Clojure, like any Java