Hi all!
Trying to use clojure.tools.cli to help us parse command line arguments.
However we are having trouble understanding how to specify required
arguments.
The following example taken from the documentation (
https://github.com/clojure/tools.cli#quick-start) should give a required
argument
it yourself.
Haven't looked too hard at the source though, but any chance of
contributing a patch to something like that?
E.g.
[[-p --port PORT Port number
:mandatory true]]
Cheers,
Alf
On 22 January 2014 14:04, guns s...@sungpae.com wrote:
On Wed 22 Jan 2014 at 01:48:22PM +0100, Alf Kristian
Ok, thanks for the reply guys :)
Cheers,
Alf
On 22 January 2014 16:04, guns s...@sungpae.com wrote:
On Wed 22 Jan 2014 at 02:21:51PM +0100, Alf Kristian Støyle wrote:
Would be nice to be able to specify that an option must be specified
in every invocation though. I think it would lead
Hey everyone!
I am doing presentation on Clojure and immutability, and I am looking for a
quote. I think I remember Rich saying something along the lines of:
Try going immutable and see where it takes you.
Anyone remember where (or if at all), he said this? And of course, what the
exact quote
Hey Bill.
I am guessing the problem is that the rethrow macro is expanded and passed
to the reader/compiler before the handle-ex macro is. And at that point the
compiler sees catch as a standalone-symbol, not as part of the try
special form. Macro-experts, please correct me :)
Tried to quickly
Thanks guys. Exactly what I was looking for.
Cheers,
Alf
On 2 April 2013 01:28, Michael Ball m...@mhbtech.com wrote:
It might be his Clojure/West 2012 presentation on Datomic near the very
end.
Choose immutability and see where it takes you.
Reading the source, Ratios are actually represented as
java.math.BigIntegerobjects. (
https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang
/Ratio.java)
Asking for denominator and numerator returns these values directly.
user= (class (denominator (/ 1 2)))
java.math.BigInteger
user=
MC Andre, if you put hello.clj in the src folder you should be able to do
(load hello). (load-file file-name) should work for files not on the
classpath, so (load-file hello.clj) means look for hello.clj in the
current working dir.
Pretty easy to inspect the classpath in the repl, e.g: (filter
println works fine in this example at least:
Clojure 1.5.1
user= (defn meta-type
Gets the metadata type.
[o]
(when-let [m (meta o)]
(:type m)))
#'user/meta-type
user= (defn debug-switch
[o rest]
(println Received switch args : o , rest)
(meta-type o))
#'user/debug-switch
Hi guys. First off, love Clojure and it has been a hobby of mine for
several years. When first learning Clojure, one thing I didn't like,
was the ability to actually change a Var at any point in time. Either
through several def/defn's pointing to the same namespace/symbol or by
something like
Thanks Herwig, makes sense.
Cheers,
Alf
On Mar 29, 2012 1:37 PM, Herwig Hochleitner hhochleit...@gmail.com
wrote:
2012/3/29 Alf Kristian Støyle alf.krist...@gmail.com:
So, long story short, why are namespaces in Clojure mutable? What is
the rationale behind this?
It's for REPL development
Thanks for the feedback guys. I have submitted a jira issue for the bug:
http://dev.clojure.org/jira/browse/CLJ-944
By the way, tried this with Clojure 1.2.1, and there it works fine.
Cheers,
Alf
On Sat, Mar 3, 2012 at 16:11, Herwig Hochleitner hhochleit...@gmail.comwrote:
Looks like the
Hi guys, I am wondering why this does not work:
(.containsKey {:one 1} :one)
;= ClassCastException clojure.lang.PersistentArrayMap cannot be cast to
clojure.lang.PersistentHashMap
The map is a:
(class {:one 1})
;= clojure.lang.PersistentArrayMap
And a PersistentArrayMap does have a containsKey
Most of clojure.contrib.io was moved into Clojure itself, as
clojure.java.io. There is no future plan for functions from
clojure.contrib.io which have not already been copied into clojure.java.io.
Guess I should have noticed that :) We certainly had no problems
replacing clojure.contrib.io
Looks really good. However it does not seem to support asynchronous
calls, which was really what we were looking for. We thought
http-agent was a cool idea.
Guess it wouldn't be too much work to use agents to store results of
clj_http though, I will definitely give it a try!
Cheers,
Alf
On
Hi guys, not really sure if this is of any interest, since I am sure
you have plans for all the contrib libraries.
However I needed a version of clojure.contrib.io,
clojure.contrib.http.agent and clojure.contrib.http.connection for a
workshop that we are doing, and we really want to use 1.3, so I
Hi guys, playing around with different ways of creating primes. The
following implementation is probably not very efficient, but it does
seem to be correct. The problem is that when run it gives a
java.lang.StackOverflowError.
(defn primes[num]
(let [possible (range 2 num)]
(loop [current 2
Jup, that solved the problem. Lesson learned.
Thanks :)
Alf
On Thu, Sep 22, 2011 at 17:54, Meikel Brandmeyer (kotarak) m...@kotka.de
wrote:
Hi,
Am Donnerstag, 22. September 2011 17:43:30 UTC+2 schrieb Alf:
What am I doing wrong here, will filter/remove or something else give
if you just generate an infinite lazy
sequence that generates primes, I mean will be really more cool :)
---
Wilker Lúcio
http://about.me/wilkerlucio/bio
Kajabi Consultant
+55 81 82556600
On Thu, Sep 22, 2011 at 1:36 PM, Alf Kristian Støyle
alf.krist...@gmail.com wrote:
Jup, that solved
I think a function should generally return the same types for
different input. A seq and a Java array are two very different things
even though Clojure often lets us pass both to the same functions. It
seemed like a small fix, but I guess not everyone agrees.
Like a wrote, I think this is small
Thanks. Submitted an issue to Jira, and I guess I will just see how it goes.
http://dev.clojure.org/jira/browse/CLJ-828
Cheers
Alf
On Mon, Aug 15, 2011 at 16:26, Armando Blancas
armando_blan...@yahoo.com wrote:
I think a function should generally return the same types for
different input. A
I think I found a small bug in clojure.core/bases. Extending the
existing unit test reveals it:
(deftest test-bases
(are [x y] (= x y)
(bases java.lang.Math)
(list java.lang.Object)
(bases java.lang.Integer)
(list java.lang.Number java.lang.Comparable) )
(is
Hi guys. Experimenting a bit with code from The joy of Clojure, and
I ran into a little problem. Trying to run this in the REPL gives the
following error:
user= (import [java.util.concurrent Executors])
java.util.concurrent.Executors
user= (let [*pool* (Executors/newFixedThreadPool (+ 2
I am a newcomer to the language, and to lisps in general, and having
to interpret Clojure's stacktraces is really hard. It is one of those
things that made me not want to use the language at all. It also makes
it hard for me to recommend the language to others.
It is not just the stacktraces, but
Hi guys. If you google Clojure API, the first hit gets you the following page:
http://clojure.org/api
Which again leads to:
http://richhickey.github.com/clojure/
http://richhickey.github.com/clojure-contrib/
As I understand these pages are not the correct ones. I have finally
bookmarked the
25 matches
Mail list logo