Stuart Halloway stuart.hallo...@gmail.com writes:
If you care about Clojure 1.5 compatibility for your codebase, please
test it against RC 16 as soon as possible.
My code using tons of protocols, some deftypes, and the new reducers
here and there still compiles, runs, and all tests pass. That
I know that using a bare :use in the ns macro is generally frowned upon
as it provides no hints about what is actually being used...
However, I 've got 2 namespaces 'abstractions.clj' and
'concretions.clj'...concretions.clj will eventually use all the
protocols defined in
Hi All,
I want to turn a clojure sequence into an 'EventStream' java interface in
clojure
(see
http://opennlp.apache.org/documentation/1.5.2-incubating/apidocs/opennlp-maxent/index.html).
Basically this is an object that implements next() and hasNext() methods.
I know this can be done with
Hi there,
I might join if the event takes place in Ghent.
grtz
Op maandag 11 februari 2013 23:11:36 UTC+1 schreef Thomas Goossens het
volgende:
*With some fellow Belgian clojurians (Frederik De
Bleserhttp://www.enigmeta.com/ Wim De Clerq) I’m planning to organise a
Clojure meetup in
I don't like :use because I can't tell where things come from.
require :refer [...]
is good is you don't want the prefix.
On Friday, 15 February 2013 00:26:50 UTC+11, Jim foo.bar wrote:
I know that using a bare :use in the ns macro is generally frowned upon
as it provides no hints about
How about having your methods access an atom provided in a closure like
it's done here:
http://kotka.de/blog/2010/03/proxy_gen-class_little_brother.html
U
On 14 February 2013 13:58, Joachim De Beule joachim.de.be...@gmail.comwrote:
Hi All,
I want to turn a clojure sequence into an
Thanks! So you mean like this (assuming some function elt-event):
(defn seq-event-stream [input-seq]
(let [remaining (atom input-seq)]
(proxy [EventStream] []
(next [] (let [current (first @remaining)]
(swap! remaining rest)
(elt-event
Without testing or anything that looks reasonable enough. I'm sure that
there are plenty caveats around infinite seqs, etc. though.
On 14 February 2013 14:22, Joachim De Beule joachim.de.be...@gmail.comwrote:
Thanks! So you mean like this (assuming some function elt-event):
(defn
Hi All,
I know how to call static java methods such as the ones defined here:
http://grepcode.com/file/repo1.maven.org/maven2/org.apache.opennlp/opennlp-maxent/3.0.2-incubating/opennlp/maxent/GIS.java,
e.g. trainModel(...).
However, before I call this method I want to change the value of
Haven't looked at the code, but `set!` should work. ~BG
Sent from phone. Please excuse brevity.
On 14 Feb 2013 21:30, Joachim De Beule joachim.de.be...@gmail.com wrote:
Hi All,
I know how to call static java methods such as the ones defined here:
@Feng
It doesn't clean up the way John is looking to clean some code like this:
(defun func1 [a b c d] (func5 (let [f (func3 c)] (func2 a b f)) (let
[e 5] (func4 c d e
On Tue, Feb 12, 2013 at 9:11 AM, Feng Shen shen...@gmail.com wrote:
(defun indent-buffer ()
(interactive)
C-u M-x indent-pp-sexp
On Thu, Feb 14, 2013 at 6:06 PM, Mayank Jain firesof...@gmail.com wrote:
@Feng
It doesn't clean up the way John is looking to clean some code like this:
(defun func1 [a b c d] (func5 (let [f (func3 c)] (func2 a b f)) (let
[e 5] (func4 c d e
On Tue, Feb 12,
Hello, all,
It's official: Google Summer of Code 2013 is on.
Last year, Clojure was able to get four students who worked on projects
like Typed Clojure, Clojure on Android, Clojure and Lua, and Overtone, and
I'd love to see Clojure be a mentoring organisation again this year.
I have created
Let's say I want to override clojure.core/sorted?
(ns random.learning.clojure.overridex
(:refer-clojure :exclude [sorted?]))
(defn sorted? [coll]
{:pre [ (coll? coll)]}
(clojure.core/sorted? coll))
I'm using Eclipse+counterclockwise, so loading this namespace(Ctrl+Alt+L)
first time gives
WOOT!
I'm of course more than happy to mentor any projects around ClojureScript,
core.logic, and core.match.
David
On Thu, Feb 14, 2013 at 1:03 PM, Daniel Solano Gómez cloj...@sattvik.comwrote:
Hello, all,
It's official: Google Summer of Code 2013 is on.
Last year, Clojure was able to
Also It looks like you could use reify instead of proxy here, it would
improve performance.
http://clojuredocs.org/clojure_core/clojure.core/reify
- Max
On Thursday, February 14, 2013 3:26:02 PM UTC+1, Ulises wrote:
Without testing or anything that looks reasonable enough. I'm sure that
Having studied Lisp decades ago I like the look of Clojure a lot. But as a
complete newbie when it comes to modern software development, I'm
exasperated by what strikes me as a very difficult and primitive set of
tools to get started. I keep seeing Leinigen, Leinigen, and the Leinigen
homepage
The problem is that your first namespace defines 'sorted?' and your second
namespace just uses the namespace, thus overriding 'sorted?'. You have two
options here. Your biggest project is that you're using ':use'. Use
':require' instead. Something like `(:require
Can you explain a bit more? What do you find difficult about Leinigen?
Thanks,
Timothy
On Thu, Feb 14, 2013 at 11:42 AM, BJG145 benmagicf...@gmail.com wrote:
Having studied Lisp decades ago I like the look of Clojure a lot. But as a
complete newbie when it comes to modern software
Thanks for the replies. I'm not the owner of what the official namespace
should be, so perhaps I'll just clj-xxx and I can always stop using that
and change with a major release milestone. Clearly too much thought has
gone into this already, and there doesn't appear to be a problem with
people
Thanks for the tip Max, so you mean like this?
(defn cases-event-stream [cases features-extractor labeler]
(let [remaining (atom cases)]
(reify opennlp.model.EventStream
(next [this] (let [current (first @remaining)]
(swap! remaining rest)
Thank you for replying.
I see that using :require like (:require [random.learning.clojure.overridex
:as o])
also means I have to use sorted? as o/sorted? else the
clojure.core/sorted? is used
or using (:require [random.learning.clojure.overridex]) means I've to use
Leonardo Borges writes:
Could it be related to new relic? That's the only external service -
besides downloading jars - that the app tries to reach upon starting
up.
If your app is downloading jars on startup that's a bad sign; all your
dependencies should be downloaded during git push. If
What I find exasperating about Leinigen is that I've got a degree in
computer science, decades of experience in IT support, and I still haven't
been able to get it working yet. :-(
Package Manager? Curl? What?
OK, look, I'm not very bright. It took me years to get my head round OOP
because
I think I have an idea of where your coming from. Leiningen does lots of
wonderful and important things but coming from the outside (or at least from
certain outsides) it's not even clear why you'd want to do a lot of those
things, and it doesn't do some of the things that seem most essential
let me explain with an example:
;;in some namespace x
(defprotocol IStemmable
(stem [this token] [this token lang])
(getRoot [this token dictionary]))
(defprotocol IDistance
(getDistance [this s1 s2] [this s1 s2 m-weight]))
;;in some namespace y that refers all vars from x
(extend-type
The easiest, when anything becomes a road block, is simply tryclj.comcombined
with
4clojure.com.
Those two alone can give you enough to work with and chew on while you
become more familiar with clojure and setup a proper environment (including
Leiningen).
Another simplification is to use
The goal is to can write this form:
= *(let [a java.lang.RuntimeException]
(new a)
)*
CompilerException java.lang.IllegalArgumentException: Unable to resolve
classname: a, compiling:(NO_SOURCE_PATH:2:3)
attempt with macro:
=* (defmacro mew [cls restt]
`(new ~(eval cls) ~@restt)
Thanks for the suggestions - this really isn't an anti-Leiningen thread,
I'm just impatient that I don't understand it yet. But I'll give it another
crack and post some more coherent queries when I get stuck...:-)
--
--
You received this message because you are subscribed to the Google
Just throwing ideas. Feel free to shoot it down if you folks think its not
worth it :).
Also, I'm a student, and would actually be participating in GSOC, so this
is more of a shoutout for possible mentors, if you guys think the project
makes sense.
The Problem:
1. cljs doesn't yet have a
On Feb 14, 2013, at 1:27 PM, AtKaaZ wrote:
The goal is to can write this form:
= (let [a java.lang.RuntimeException]
(new a)
)
CompilerException java.lang.IllegalArgumentException: Unable to resolve
classname: a, compiling:(NO_SOURCE_PATH:2:3)
attempt with macro:
=
thanks for the reply,
= *(defmacro mew [cls args]
`(new ~cls ~@args))*
#'runtime.q/mew
=* (let [a java.lang.RuntimeException]
(mew a)
)*
CompilerException java.lang.IllegalArgumentException: Unable to resolve
classname: a, compiling:(NO_SOURCE_PATH:2:3)
that would be the
I figure since new is expecting a class at compiletime, we can never pass
it a class that we evaluate at runtime(those locals), ergo = impossible to
macro around new like that
like this = impossible:
*(let [a java.lang.RuntimeException]
(macro-that-eventually-calls-new a))*
maybe
ok looks like it's not impossible:
= *(defmacro mew [cls restt]
(let [c a]
`(eval (new ~a ~@restt))
)
)*
#'runtime.q/mew
= *(let [a java.lang.RuntimeException]
(mew a)
)*
#RuntimeException java.lang.RuntimeException
On Thu, Feb 14, 2013 at 10:53 PM, AtKaaZ
and I forgot to mention that I already had another a defined
= a
java.lang.RuntimeException
hence why it worked
On Thu, Feb 14, 2013 at 11:01 PM, AtKaaZ atk...@gmail.com wrote:
ah I tricked myself... I used ~a inside the macro instead of ~c or
~cls
so back to still impossible
= (defmacro
Yes, since this is runtime you should use reflection.
(let [a java.lang.RuntimeException]
(.newInstance a))
Alternatively, you can use eval:
(let [a java.lang.RuntimeException]
(eval (list 'new a)))
On Thu, Feb 14, 2013 at 4:53 PM, AtKaaZ atk...@gmail.com wrote:
I figure since new is
This might help:
1. create a new project in the current directory lein new
2. Edit project.clj and add this plugin [lein-idea: 1.0.1]
3. run this to create idea project files lein idea
4. Open the project in intellij
Josh
On Fri, Feb 15, 2013 at 12:29 AM, BJG145
Clojure has compojure ... which is a sinatra like web framework and
you can create a new project usinglein new compojure and start
creating your request handler functions from there ... Just like in
express. If you want a jade equivalent... you can use hiccup .
Josh.
On Fri, Feb 15,
On Feb 14, 2013, at 3:50 PM, Alex Walker wrote:
The easiest, when anything becomes a road block, is simply tryclj.com
combined with 4clojure.com.
Those two alone can give you enough to work with and chew on while you become
more familiar with clojure and setup a proper environment
But compojure isn't in cljs, so you have to use the jvm. A wrapper around
express would mean you could run it on node.
On Thu, Feb 14, 2013 at 5:35 PM, Josh Kamau joshnet2...@gmail.com wrote:
Clojure has compojure ... which is a sinatra like web framework and
you can create a new project
First of all, I must say I'm new to testing in Clojure. My current workflow
is pretty simple:
* Edit + save the tests (which use clojure.test - I hear Midje is better
though) in emacs
* Run `lein test` in the terminal
* recur
But then the printed values (triggered when e.g. an `are` case
I started to learn Clojure a couple of days ago. I was trying with some
Aleph TCP echo server examples but I can not get the server to bind to a
tcp v4 port. The server only binds to a tcp v6 port by default.
Here my project file:
(defproject clj-echo-server 0.1.0-SNAPSHOT
:description
You are certainly not alone. Learning the language and concepts is very
easy for me, but the sysadmin stuff to get set up is so much harder.
Believe it or not, I had much more trouble with installing core.logic than
understanding it. It doesn't end either, you bump into more problems once
you
I have a loop over a function that is accumulating a list of database keys
for later use. But it is primarily doing other processing and returning a
collection of processed/filtered records. I'd normally just PUSH the ids
and records onto a list in Common Lisp, or even LOOP... COLLECT into 2
I responded to Omer on Twitter, it's probably worth looking into existing
projects like Bodil Stokke's Dog Fort first -
https://github.com/bodil/dogfort
David
On Thu, Feb 14, 2013 at 5:48 PM, Tamreen Khan histor...@gmail.com wrote:
But compojure isn't in cljs, so you have to use the jvm. A
I never tried out core.logic. This is how I just got it installed in less
than a minute. Really no magic here:
lein new foo; cd foo
# google core.logic, grab the dependencies vector ([org.clojure/core.logic
0.7.5]), attach it to your project.clj
lein repl
(use 'clojure.core.logic)(run* [q]
Sure, but you have assumed that you have a perfectly working clojure
environment set up. *That* is the hard part.
On Friday, February 15, 2013 12:19:34 AM UTC+1, vemv wrote:
I never tried out core.logic. This is how I just got it installed in
less than a minute. Really no magic here:
lein
If this does not work for you, you can help everyone by opening an issue at
the Leiningen bug tracker:
Make sure java and curl are correctly installed
Run the corresponding (unix or Windows) lein install script
Now you should be able to run lein repl, lein new, etc
On Friday, February 15, 2013
You want either `reduce` or `loop` as the control flow construct, and
`conj` for appending items to a collection (without resorting to
mutability). Have a look at them, they're pretty well covered in the
available books, tutorials etc.
Hope it helps - Victor
On Friday, February 15, 2013
A little library to score poker hands:
https://github.com/jamesmacaulay/poker-hands
Feedback would be great!
--
--
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
Hi BJG145,
I absolutely see where you're coming from. And in fairness, it did take a
me a long and arduous time to get a really proficient development
environment. I happen to really like expressive power. So when I came from
a Java / OO development paradigm, it didn't bother me that I had to
Look at the first example here:
http://clojuredocs.org/clojure_core/clojure.core/transient
It should inspire you.
Transient structures make this kind of loop run faster but as you lay out
your first iteration just toss this aside (and the xxx! version of conj and
cie).
Luc P.
I have a loop
On Feb 14, 2013 6:11 PM, Jonathon McKitrick jmckitr...@gmail.com wrote:
I have a loop over a function that is accumulating a list of database
keys for later use. But it is primarily doing other processing and
returning a collection of processed/filtered records.
As you come from Common Lisp,
I would love to improve upon core.match
On Thursday, February 14, 2013 1:10:29 PM UTC-5, David Nolen wrote:
WOOT!
I'm of course more than happy to mentor any projects around ClojureScript,
core.logic, and core.match.
David
On Thu, Feb 14, 2013 at 1:03 PM, Daniel Solano Gómez
FWIW, I've been using Clojure seriously for a couple of years now and never
really used Leiningen.
I've found that Eclipse with the awesome Counterclockwise plugin does
everything that I need. This is also pretty easy for newcomers (assuming
they know Eclipse) - just install the
Hi Victor,
I've developed something I use on my own projects to compare pretty printed
test failure output. The final piece for it would be to incorporate its
test failure report diffing into a leiningen plugin that wrapped lein test.
https://github.com/AlexBaranosky/gui-diff
On Thu, Feb 14,
vemv, here is a file describing my Clojure install
experience: https://www.dropbox.com/s/ln2ek5f5n47qnl1/clojureinstall.odp
How should I continue? And where would a beginner find that information?
Hopefully this is taken in good humor, this is meant as an illustration
from a beginners' point
You might, BJG145, also profit by taking a look at clojurewiki.org - I'm
listing there all resources I can find.
Good luck!
2013/2/15 Jules julesjac...@gmail.com
vemv, here is a file describing my Clojure install experience:
https://www.dropbox.com/s/ln2ek5f5n47qnl1/clojureinstall.odp
How
On Thu, Feb 14, 2013 at 6:56 PM, Jules julesjac...@gmail.com wrote:
vemv, here is a file describing my Clojure install experience:
https://www.dropbox.com/s/ln2ek5f5n47qnl1/clojureinstall.odp
How should I continue? And where would a beginner find that information?
The problem is the Clojure
2013/2/15 Konrad Scorciapino scorciap...@gmail.com
You might, BJG145, also profit by taking a look at clojurewiki.org - I'm
listing there all resources I can find.
You may want to add clojure-doc.org, which is the most complete,
contributor friendly
source of documentation guides (including
It looks as if https://github.com/jonase/kibit/ is a lint/check style tool
that only reads the source code, this limits its utilization:
Kibit
readshttp://clojure.github.com/clojure/clojure.core-api.html#clojure.core/read
source
code without any macro expansion or evaluation. A macro can
On Friday, February 15, 2013 6:19:00 AM UTC+2, ronen wrote:
It looks as if https://github.com/jonase/kibit/ is a lint/check style
tool that only reads the source code, this limits its utilization:
Kibit
readshttp://clojure.github.com/clojure/clojure.core-api.html#clojure.core/read
On Thu, Feb 14, 2013 at 3:06 PM, vemv v...@vemv.net wrote:
But then the printed values (triggered when e.g. an `are` case fails) are
fairly illegible, especially when big.
Can I get the test runner to pprint its output? Is my workflow improvable
anyway?
I use lein-difftest for this:
You'll find your workflow greatly improved by using nrepl (or
slime/swank) and running tests directly from Emacs - and that applies
whether you're using bare clojure.test, midje or expectations.
I use expectations for testing and expectations-mode in Emacs. I can
run an individual namespace's
Hi Jim:
I think the problem is that you are actually calling the *getDistance *protocol
function with only 2 arguments in the line in bold below:
(defrecord LevenshteinDistance []
IDistance
(getDistance [_ s1 s2]
*(getDistance s1 s2)) ;; - Calling a getDistance function with 2
I feel your pain BJG145, when I started learning Clojure I used
Cloojhttps://github.com/arthuredelstein/clooj to
be able start playing with the language, it provides the basics, a REPL, a
text area for the code and a tree of files and folder for the current
project. It's simple and get's you
Well the first thing you assume is that project pages should be giant
download buttons, and therefore the exposed content in those pages is not
worth reading/understanding. For instance you can find the answer to the
question posed in the slide 19 in slide 7.
Just imagine if every single open
Jonas already has another project which uses analyze
https://github.com/jonase/eastwood
On Fri, Feb 15, 2013 at 12:19 PM, ronen nark...@gmail.com wrote:
It looks as if https://github.com/jonase/kibit/ is a lint/check style
tool that only reads the source code, this limits its utilization:
68 matches
Mail list logo