Are there plans to have a branch for Clojure in which Java 7 specific
functions will be developed and included and updated? For example spit
taking a java.nio.file.Path [1] as first arg. Or putting pvec using
the Fork/Join lib into core, on that specific feature branch.
[1]
On Aug 12, 6:41 pm, daly d...@axiom-developer.org wrote:
In AI this is often modeled as a self-modifying program.
The easiest way to see this would be a program that handles
a rubics cube problem. Initially it only knows some general
rules for manipulation, some measure of progress, and a
On Aug 12, 10:25 pm, daly d...@axiom-developer.org wrote:
Consing up a new function and using eval is certainly possible but
then you are essentially just working with an interpreter on the data.
This is the same in CL. When you have a GP system that constructs new
program trees then inside
On Aug 13, 12:16 am, Sergey Didenko sergey.dide...@gmail.com wrote:
BTW, Is there a case when AI self-modifying program is much more elegant
than AI just-data-modifying program?
I just can't figure out any example when there is a lot of sense to go the
self-modifying route.
They are all
On Aug 13, 11:14 pm, Ken Wesson kwess...@gmail.com wrote:
On Sat, Aug 13, 2011 at 1:36 PM, Lee Spector lspec...@hampshire.edu wrote:
On the one hand most people who work in genetic programming these days
write in non-Lisp languages but evolve Lisp-like programs that are
interpreted via
Hello Ken, thanks for your explanations. It seems that you basically
outlined a strategy that can be used to implement that feature.
Very good! :-)
Am 05.05.2011 02:21, schrieb Ken Wesson:
As for concerns that this kind of extension might mask common macro
errors, adding some *warn-on-foo*
Am 05.05.2011 02:01, schrieb Ken Wesson:
(There's an ugly workaround
involving explicitly calling intern; you create a dummy namespace with
a var holding the object, and then eval code that refers to that var
by fully-qualified name in order to retrieve the object.)
Yes, this is what I
Am 02.05.2011 23:14, schrieb David Nolen:
The relevant clojure-dev thread.
http://groups.google.com/group/clojure-dev/browse_thread/thread/f4907ebca8ef6e11
It's not clear whether the core team and the various contributors are
interested in supporting the behavior you want. It's also not clear
Am 02.05.2011 02:26, schrieb Alan:
You can't embed a function in code as a raw function object
Can anyone give explanations why this is so?
I understand that it may sound provocative, but this sounds to me like
a major bug.
- you need to return code that will result in that function. That
I am currently writing a neat logging lib and want it to support dynamic
and static logging. When I activate (static-logging!) then the log macro
(log :warn message) will check during macro expansion time which log
level is currently set and decides based on that if code will be
generated that
Am 03.01.2011 21:45, schrieb pavelludiq:
On Jan 3, 11:24 am, Jozef Wagnerjozef.wag...@gmail.com wrote:
Some of my arguments are:
- Clojure has no custom reader macros, makes it easier to read others code
- Protocols and the way clojure handles data helps to explicitly formulate
specifications
Am 31.12.2010 03:29, schrieb Alex Baranosky:
I've been playing with making a macro to encapsulate Stuart's post, like
this:
(defmacro defrecord-ifn [name args]
`(defrecord ~name ~...@args
clojure.lang.IFn
(invoke [this key] (get this key
(defrecord-ifn Foo [a b c])
(def foo
Am 14.11.2010 07:33, schrieb Eric Schulte:
Hi,
I find myself frequently using the `comp' and `partial' functions and
while I really enjoy being able to program in a point free style, the
length (in characters) of these command names often has the effect of
causing what should be a brief
Am 06.11.2010 12:57, schrieb philip schwarz:
Hi all,
be gentle please: I have only just started using clojure.
I run the following on an Intel Core 2 Duo CPU (starting clojure with
java -Xms1000m -Xmx1000m -jar clojure.jar):
user= (time (nth (doall (map inc (range 1000))) 999))
Am 07.11.2010 04:29, schrieb Ken Wesson:
On Sat, Nov 6, 2010 at 11:25 PM, André Thieme
Try
(time (count (map (fn [_] (Thread/sleep 1)) (range 1000
vs.
(time (count (pmap (fn [_] (Thread/sleep 1)) (range 1000
On my system this is 1002 msecs vs. 39 msecs.
Your system has TWENTY-FIVE
Am 03.10.2010 09:32, schrieb Alan:
I've got a collection of unique objects, and I need to partition them
into sets. That part's easy enough, but I need to have both of the
following be efficient, and preferably easy:
- Given an object, determine what set it's in
- List all the objects in a given
Am 30.09.2010 13:46, schrieb Nicolas Oury:
Note that you can't make readermacros yet. It's a supported in CL not
in Clojure but maybe in future versions how knows.
I meant, if you want to modify Clojure to allow a shorter notation for
partial application,
it is better to add a reader macro
Am 24.09.2010 17:09, schrieb Stuart Sierra:
I have deployed release 1.3.0-alpha1 of clojure-contrib.
This is the first public release of the modularized clojure-contrib.
If you just want one big JAR file, download it from
http://github.com/clojure/clojure-contrib/downloads
If you want JARs
On Jun 23, 5:17 pm, Michał Marczyk michal.marc...@gmail.com wrote:
Hi,
just noticed that
(defprotocol Foo (foo [self]))
(defrecord Bar [x] Foo (foo [self] x))
gives areflectionwarning-- call to contains can't be resolved.
My initial guess is that this is due to a missing hint on line 215
On 27 Nov., 04:33, pmf phil.fr...@gmx.de wrote:
On Nov 26, 7:39 pm, Richard Newman holyg...@gmail.com wrote:
Re consistency: I seem to recall Pascal Costanza working on
activation of layers, so you can swap a whole set of stuff across your
program. He spoke about it at ILC2009, but I'm
My web application needs updates from time to time.
When this happens I often have to stop the server and
shut down the JVM. Then the old (current) directories can
be replaced by the new ones, and I restart the server.
It's okay when there are several copies of the server
running behind a load
I watched http://www.infoq.com/presentations/Are-We-There-Yet-Rich-Hickey
and it is a very nice video. Rich mentioned around minute 9 to 10:05 a
big problem:
when some code gets handed data, can it be sure this thing is
immutable?
Clojure wants to help, because it encapsulates state in refs,
On 14 Nov., 20:22, John Harrop jharrop...@gmail.com wrote:
On Sat, Nov 14, 2009 at 2:11 PM, John Harrop jharrop...@gmail.com wrote:
On Sat, Nov 14, 2009 at 11:42 AM, André Thieme
splendidl...@googlemail.com wrote:
Dereferencing *persons* will result in:
{Tina #r...@7ae6d: {:name Tina
On 14 Nov., 20:32, Danny Woods dannywo...@gmail.com wrote:
André Thieme wrote:
How can we handle this situation?
Is it possible to implement a function “deep-deref” which works
as blindingly fast as deref does?
I find this very important, and this is of great practical relevance
On 27 Jul., 23:26, AndyF andy_finger...@alum.wustl.edu wrote:
Hello Andy, could you please update the following table?
| sbcl | perl | ghc | java | clj
-
mand- | wrong | out of | 32.7 | 28.6 | 340.4
elbrot |
On 4 Mai, 17:01, Emeka emekami...@gmail.com wrote:
Hello All,
I want to arrange objects in rows and also being able to manipulate them. By
manipulation I meant, I could move one object from one row and use it to
replace another object in another. Should I use Map or something else? I
need
On 9 Mai, 00:30, Chris Dean ctd...@sokitomi.com wrote:
How do folks launch their apps?
For building (and maybe deploying) it seems that most people use the
Java tools (ant, maven, ivy) or have a 10 line shell script. For pure
Clojure code you don't even necessarily have to have a build
On 8 Mai, 20:00, melipone labwor...@gmail.com wrote:
Hiya,
I understand that you can use Java libraries with Clojure but can you
use Common Lisp libraries for example CXML?
In principle you could run Clojure and ABCL inside the same VM.
http://common-lisp.net/project/armedbear/
That should
On 7 Mai, 02:34, Eric Tschetter eched...@gmail.com wrote:
Last I checked the various clojure libraries, it seemed like noone has
publicized a set of wrappers/clojure-native implementation of an http
client. I'm wonder if such a thing exists, or has everyone basically
just rolled their own
German readers might be interested to see that Heise published its
first news article about Clojure today:
http://www.heise.de/developer/Clojure-1-0-funktionale-Programmiersprache-fuer-die-Java-Virtual-Machine--/news/meldung/137231
So, I guess they will keep it on their radar. Let's work
On 3 Mai, 15:58, Mark Volkmann r.mark.volkm...@gmail.com wrote:
Is there a special variable that holds the name of the currently
running function so it can be output in a logging message?
I'm thinking of something like this:
(defn my-function []
(println entered *current-function*)
On 24 Apr., 15:27, al3xandr3 al3xan...@gmail.com wrote:
Hi guys, sharing here a little Clojure script i made that uses
Selenium.
In case someone finds it
useful:http://alexandrenotebook.blogspot.com/2009/04/clojure-and-selenium.html
Thanks for your article.
I find it interesting, however, I
On 22 Apr., 21:12, Phil Hagelberg p...@hagelb.org wrote:
I couldn't find an equivalent to rm -rf in the JDK, so I wrote these
functions:
(defn delete-file
Delete file f. Raise an exception if it fails.
[f]
(or (.delete (file f))
(throw (java.io.IOException. (str Couldn't
I suggest you to use Clojure.
There is no more risk involved than with anything else.
Clojure supports in its current version all of Java.
It has very nice libs, macros, cuncurrency engine, etc.
Those are fully production ready features. My company
uses Clojure for production, and it meets our
On 29 Mrz., 01:55, Glen Stampoultzis gst...@gmail.com wrote:
Hi, I've been really enjoying getting to know clojure. It's an awesome
language that has got me very interested in learning more. One thing that
hasn't left me impressed is the error reporting.
[...]
There are a few things wrong
On 16 Mrz., 20:45, David Nolen dnolen.li...@gmail.com wrote:
Should the REPL have an interactive mode where it won't fire an exception
on undefined symbols and instead issue compiler warnings? If compiler
warnings were issued this would be a nice hook for Emacs and other IDEs.
Yes, I was
On 16 Mrz., 19:43, Meikel Brandmeyer m...@kotka.de wrote:
Am 16.03.2009 um 12:26 schrieb Robert Pfeiffer:
Did you mean this:
http://wiki.jvmlangsummit.com/pdf/28_Siek_gradual.pdf
It was presented at the JVM Summit, so Rich may already have given a
thought to this.
Argh.. Gradual
On 16 Mrz., 23:36, Raoul Duke rao...@gmail.com wrote:
please, for those who aren't Erlang nerds, also see Dialyzer.
http://www.it.uu.se/research/group/hipe/dialyzer
Funny, I just wanted to post exactly that link.
It is very impressive what that tool did:
Dialyzer has been applied to large
On 16 Mrz., 22:41, Phil Hagelberg p...@hagelb.org wrote:
André Thieme splendidl...@googlemail.com writes:
But it also protects you from typos. And this can be even more
important. Imagine you have a complex program and accidently
made a typo, and this will go unnoticed for days and days
On 14 Mrz., 16:26, Stuart Sierra the.stuart.sie...@gmail.com wrote:
I've added a seek function to clojure.contrib.seq-utils:
(defn seek
Returns the first item of coll for which (pred item) returns
logical true.
Consumes sequences up to the first match, will consume the entire
sequence
On 13 Mrz., 14:19, David Sletten da...@bosatsu.net wrote:
Common Lisp uses a separate syntax for binary/octal/hex literals. Legal:
#b1011, #o377, #xDEADBEEF, #36rZZZ (Base 36 anyone?)
Illegal:
#b2, #o8, #xQUICKSAND
(Of course, #36rCLOJURE = 27432414842 :-) )
This is also available in
On 6 Mrz., 17:07, lprefonta...@softaddicts.ca wrote:
I know some business where HR and IT managers come back with this mantra
that they can find Java and .Net coders, anything else is too risky or
too scarce on the market.
Right. I am sure a lot of those managers really think that way.
If
On 6 Mrz., 19:21, Phil Hagelberg p...@hagelb.org wrote:
The only other thing I can think of is short-lived command-line tools
that need subsecond launch times.
The Lisp repl is the command-line. There is no starting time
of the JVM involved.
On 9 Mrz., 16:34, Stuart Sierra the.stuart.sie...@gmail.com wrote:
On Mar 8, 3:20 pm, André Thieme splendidl...@googlemail.com wrote:
I regularily stumble upon the (first (filter predicate coll)) pattern.
Maybe we can add a filter1 for that?
In the Clojure project itself I found this two
On 9 Mrz., 20:42, Raoul Duke rao...@gmail.com wrote:
ok oops that didn't work, sorry -- i mean to send this link:
http://www.ccs.neu.edu/home/samth/typed-scheme/manual/
That is not too far away of what I had in mind.
What I would like is if it were even a bit more optional.
Typed Scheme
On 12 Mrz., 07:48, tristan tristan.k...@gmail.com wrote:
my clojure version
http://github.com/tristan/project-euler-code/blob/4a17bc271b4b2743ee1...
Not about speed, but about readability:
(loop [c primes n #{}]
(let [r (loop [b primes n n]
(let [r (loop [a primes n n]
...)))
You
On 8 Mrz., 13:40, Mark Volkmann r.mark.volkm...@gmail.com wrote:
Is there a webpage or video that describes what Clojure transactions
do to avoid deadlocks? I'm not having a particular issue. I just want
to understand what is provided. Perhaps I just need to look at the
source starting from
On 7 Mrz., 18:38, Meikel Brandmeyer m...@kotka.de wrote:
Dear Clojurians,
I'd like to announce release of LazyMap v2.2.
New in this release are:
* compatibility with lazy-seq changes
* LazyMapSeq now inherits from ASeq
* 100% reflection free
The release maybe found at the usual
I regularily stumble upon the (first (filter predicate coll)) pattern.
Maybe we can add a filter1 for that?
In the Clojure project itself I found this two times, in core.clj for
the ns macro,
and in genclass.clj in find-field.
Also in the clojure-contrib project it shows up two times (again in
I like that Clojure is a dynamically typed language.
Even in dynamic languages it is possible to find out a lot more
about the code itself than one may think on a first glance.
Clojure already supports type hints that can make code run
faster. But what if we could add a soft layer of static
On 21 Feb., 18:24, Mark Volkmann r.mark.volkm...@gmail.com wrote:
Currently the dotimes macro requires its first argument to be a vector
for binding a variable to the number of times the body should be
executed. Inside the body, that variable is bound to the values from 0
to that number minus
On 2 Feb., 16:35, Gregory Petrosyan gregory.petros...@gmail.com
wrote:
Clojure rev. 1173:
user= (defn fac [#^Integer n] (reduce * (range 1 (+ 1 n
#'user/fac
user= (time (reduce + (map fac (range 1000
Elapsed time: 944.798019 msecs
Python 3.0: import timeit
On 31 Jan., 02:44, Daniel Renfer d...@kronkltd.net wrote:
user= (take 0 (lazy-cat [(println 10)] [(println 20)]))
10
nil
What you see here is not an issue with lazy-cat, but rather an issue
with take. The current implementation of take evaluates one more than
the n passed to it.
I don’t
On 31 Jan., 02:47, Jason Wolfe jawo...@berkeley.edu wrote:
I think this behavior is as-intended, although I agree that it is
confusing.
I am worried that you could be right.
That’s why I suggested to modify the doc string of lazy-cat.
In my opinion the real step that needs to be done is to go
Some minutes ago I found out that there is a mismatch between my
interpretation of lazy-cats docstring and the actual behaviour of that
macro.
Its docstring says:
Expands to code which yields a lazy sequence of the concatenation
of the supplied colls. Each coll expr is not evaluated until it
On 24 Jan., 16:50, wubbie sunj...@gmail.com wrote:
Hi,
I wonder why self-call(filter) is used in one place and
recur is used in the other.
(defn filter
Returns a lazy seq of the items in coll for which
(pred item) returns true. pred must be free of side-effects.
[pred coll]
(for [x (range 1 20) :when ( x 8) :while ( 0 (rem x 13))] x) ==
java.lang.Exception: Unsupported binding form: :while
But:
(for [x (range 1 20) :when ( x 8)] x) ==
(9 10 11 12 13 14 15 16 17 18 19)
And:
(for [x (range 1 20) :while ( 0 (rem x 13))] x) ==
(1 2 3 4 5 6 7 8 9 10 11 12)
Is it
On 30 Nov., 23:58, Mark Volkmann [EMAIL PROTECTED] wrote:
I think you misunderstood what I was suggesting. I was only referring
to expressions entered in a REPL, not expressions in a file of Clojure
code.
I understood that part and explained why this wouldn’t work.
Not in the REPL, not in a
On 30 Nov., 20:09, Stuart Sierra [EMAIL PROTECTED] wrote:
On Nov 28, 6:54 pm, Dmitri [EMAIL PROTECTED] wrote:
First of I'd like to say that I find Clojure to be an excellent
language, however I find the lack of infix operators makes reading
equations somewhat unnatural, eg:
Hi, Dmitri,
On 27 Nov., 13:06, Meikel Brandmeyer [EMAIL PROTECTED] wrote:
Hello.
Maybe I have a wrong understanding of closure, but
as far as I understand, every function definition in
Clojure - be it defn or #() - finally translates to (fn ...).
And fn creates a closure.
Well, from my experience I
On 28 Nov., 23:29, Meikel Brandmeyer [EMAIL PROTECTED] wrote:
Hi André,
Am 28.11.2008 um 22:56 schrieb André Thieme:
Maybe I have a wrong understanding of closure, but
as far as I understand, every function definition in
Clojure - be it defn or #() - finally translates to (fn
On 26 Nov., 21:26, Chouser [EMAIL PROTECTED] wrote:
On Wed, Nov 26, 2008 at 3:22 PM, Mark Volkmann
[EMAIL PROTECTED] wrote:
I'm curious about this syntax. I thought if #(function-name args)
creates a closure then I can put one in a variable and execute it
laterI entered this in a
On 14 Nov., 20:11, Jeff Rose [EMAIL PROTECTED] wrote:
Hi,
I'm working on a library where I'd like to be able to dispatch off of
whether the arguments are one of a number of different possible structs.
I've created a custom hierarchy and everything makes sense with derive
etc., but I
On 19 Nov., 22:16, Mark Volkmann [EMAIL PROTECTED] wrote:
I'm reading an excellent article on functional programming
athttp://www.defmacro.org/ramblings/fp.html. Toward the end there is a
section on pattern matching. They give the following example which
uses a fictional, Java-like syntax.
On 23 Nov., 01:23, Rich Hickey [EMAIL PROTECTED] wrote:
On Nov 22, 4:59 pm, [EMAIL PROTECTED] [EMAIL PROTECTED]
wrote:
I still don't understand your expectation here. If the filter does any
filtering, it won't return everything in the vector, so the new result
will have fewer items. Do you
On 8 Nov., 17:47, Phlex [EMAIL PROTECTED] wrote:
Robert Pfeiffer wrote:
Hello,
Is there a benefit in implementing this as a macro instead of a
function? The function version would be very simple:
(defn returning [returnval body]
returnval)
Well no, the forms are evaluated. It's
On 8 Nov., 18:32, Meikel Brandmeyer [EMAIL PROTECTED] wrote:
Hi,
Am 08.11.2008 um 17:58 schrieb Randall R Schulz:
Peasant? Or did you mean pedant?
In german there is the word Banause which translates
according the dictionary to peasant. It means something
like the following:
The german
On 8 Nov., 18:00, Meikel Brandmeyer [EMAIL PROTECTED] wrote:
Hi,
Am 08.11.2008 um 17:39 schrieb Meikel Brandmeyer:
(defn returning [returnval body]
returnval)
And another question, which a I got when I read the
mail of Phlex: Is the order of evaluation of function
arguments
On 1 Nov., 14:12, Rich Hickey [EMAIL PROTECTED] wrote:
On Oct 31, 1:20 pm, André Thieme [EMAIL PROTECTED] wrote:
Here is what I tried:
user (defn make-lyst [ items]
(proxy [clojure.lang.IPersistentList] []
(cons [obj] (cons obj this))
(count
In #Clojure Rich mentioned today that we can define our own data
structures on top of the existing ones.
Maybe someone wants/needs his own version of vectors that rearrange
automatically in some specific order or whatever.
If I now want to add something that works nearly like lists, but a
little
I get a funny result when I say (in-ns 'java), on the repl.
I can’t switch back, as in (in-ns 'user).
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
Clojure group.
To post to this group, send email to
Stuart Sierra schrieb:
On Oct 31, 1:20pm, André Thieme [EMAIL PROTECTED] wrote:
But unfortunately (make-lyst 1 2 3) ==
java.lang.ClassCastException: clojure.lang.Proxy__5307 cannot be cast
to clojure.lang.ISeq
Any ideas how this should be done so that it will work?
I think
On 26 Okt., 06:23, Matthew D. Swank [EMAIL PROTECTED]
wrote:
I am dubious of the curry proposal,
Hi Matt!
Could you please be more specific about what makes you dubious?
I understand that the #(..) reader macro can’t be used, but this won’t
keep us
from having some other instead. It could be
On 23 Okt., 15:12, Rich Hickey [EMAIL PROTECTED] wrote:
On Oct 22, 6:45 pm, André Thieme [EMAIL PROTECTED] wrote:
I think, in general, this proposal, while interesting, has the
difficulty that it reduces the power of #() to not much more than
currying, and has some presumptions that need
I would like to suggest to improve currying.
Right now Clojure already comes with a nice way to do something that
is
nearly as good as currying, but still not fully.
In a very functional programming style this makes sense to have good
currying support.
Here is my proposal for extending the #(...)
On 22 Okt., 23:24, André Thieme [EMAIL PROTECTED] wrote:
This version of replace-placeholders still misses the numbered
args %1, %2, .. as the reader would also steal those from me.
In the end the #(..) macro would do it, instead of §.
So what I just did was extending
On 16 Okt., 22:01, Stephen C. Gilardi [EMAIL PROTECTED] wrote:
#(identity %) is more compactly written as: identity.
This works:
user= (apply max (filter identity '(1 2 nil 4)))
4
In this case, number? is also a good predicate to use:
user= (apply max (filter
Germany here. I found Clojure just a few days ago and was quite happy
about that.
In fact, I felt euphoric from the beginning and still feel this way.
A cleaned up Lisp with a nice and talented dictator :-)
I like that it strongly asks for a functional programming style.
I am thinking about
78 matches
Mail list logo