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 g
On Feb 4, 3:31 am, wlr 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 select*,
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 meaningf
On 4 February 2010 08:04, Wardrop wrote:
> (defn [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 such an obscure and gene
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 constrai
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 pos
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 sequenc
Hi,
On Feb 4, 3:08 pm, 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
Yep, see clojure.contrib.types/match.
I recently used it in an almost frivolous way in this thread, because
I thought it was pre
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
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
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 wrote:
> Hello,
>
> I was wondering if symbol resolution in local scope (in a let or
> function body) works the same way as it is in
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.
htt
Much like :main option in defproject, I would like to add Class-Path
entries to MANIFEST.MF
Here's my unsuccessful attempt
(defproject ashee/lein-test "1.0.0-SNAPSHOT"
:description "FIXME: write"
:dependencies [
[org.clojure/clojure "1.1.0"]
[org.
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 wrote:
> Hi
>
> Pulling off of GIT I got the following 4 errors in the unit tests:
>
> FA
Pattern matching
On Feb 4, 12:12 pm, Jon Harrop 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 matching or t
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
On Feb 4, 3:28 pm, Tayssir John Gabbour
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 Google
Groups "Clojure" gro
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 (
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)
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 wrote:
I'm in!
But on 11th. I cannot make it on 15th
On Wed, Feb 3, 2010 at 7:01 PM, Phil Hagelberg wrote:
Hello, clojurists of Seattle.
Let's meet
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 destru
On Thu, Feb 4, 2010 at 8:33 AM, Stuart Sierra
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 Perl/Bash/Ruby/Python, so
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 wo
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:
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 w
On 4 February 2010 17:24, Bryce 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 makes no sense to
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 al
* 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 'magic'
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
> 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
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:
>
>
> NameEmail
> <% (for-query-with-db db "SELECT * FROM people" %>
>
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 s
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
On 4 February 2010 20:47, Brenton 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 lines star
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
account
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 foll
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
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 mine)
On 25 January 2010 16:34, Sean Devlin 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 out. No more topi
> 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 w
> 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
>> 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
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 bec
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 tim
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
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
> (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
> 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 templati
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,
turn
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-impl
> 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
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 wrote:
> Hello, clojurists of Seattle.
>
> Let's meet! I'm thinking of getting folks together from 7pm to 9pm at Zok
> 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 wro
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 wrote:
> > He
On Feb 4, 9:54 pm, Seth 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 you to produce the
2010/2/5 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?
Hello,
there's this one I've realized very quickly (as a proof of concept
since it was my first screenc
I'm interested as well. Either the 11th or 15th works for me.
-- Tim.
On Feb 4, 5:57 pm, Howard Lewis Ship 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 7:01 PM, Phi
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 Hagel
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 wa
On Feb 4, 9:35 am, Phil Hagelberg wrote:
> On Thu, Feb 4, 2010 at 8:33 AM, Stuart Sierra
>
> 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
60 matches
Mail list logo