Hi,
you can still use a defrecord. Just don't implement the protocol inline.
Clojure
user= (ns foo.bar (:refer-clojure :exclude [get]))
nil
foo.bar= (defprotocol FooBar (get [this]))
FooBar
foo.bar= (ns foo.baz)
nil
foo.baz= (alias 'fb 'foo.bar) ; this is due to working only in the repl.
lein deps?
Am Mittwoch, 6. Februar 2013 12:41:03 UTC+1 schrieb Maris:
Is there dependencies plugin for leiningen ?
I need to download all dependencies so I can copy my project to a server.
( I can't run leiningen on server ).
mvn dependency:copy-dependencies
--
--
You received this
Hi,
how about simply doing this:
(defn foo-accessor
([] foo-vector)
([n] (subvec foo-vector 0 (min n (count foo-vector)
I wouldn't worry too much about subvectors. Unless you identify them as a
bottleneck with the profiler.
Kind regards
Meikel
Durch MOTOBLUR™ verbunden
For completeness sake...
Am Dienstag, 29. Januar 2013 10:31:18 UTC+1 schrieb lpetit:
Rationale for b): you have an existing map, but the key may or may not
be present. Note that you can also use the version which returns
default value if there's no key in the map: (map key default-value)
Hi,
Am Mittwoch, 30. Januar 2013 07:54:36 UTC+1 schrieb Alan Malloy:
`lein deps :tree` will show you the tree of dependencies, and you can see
which of your dependencies has a bad dependency specification overriding
the one in your project.clj. Typically it turns out a dependency is saying
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Hi,
you have to add a (:require com.rycole.bukkit-plugin.listeners) before
you import the class. And you have to replace dashes with underscores
on import.
Kind regards
Meikel
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)
Hi,
quick guess: Pull buildscript out of the subproject.
Meikel
Durch MOTOBLUR™ verbunden
-Ursprüngliche Nachricht-
Von: john john.vie...@gmail.com
An: clojure@googlegroups.com
Gesendet: Fr, 25 Jan 2013, 14:20:14 MEZ
Betreff: When using gradle with the clojuresque plugin I'm getting
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
And since you can't have enough ways to go to Rome…
(defn update-values
[m f args]
(reduce #(update-in %1 [%2] f args) m (keys m)))
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.18 (Darwin)
Comment: GPGTools - http://gpgtools.org
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Oops. Add a apply in front of update-in.
Am 21.01.13 22:23, schrieb Meikel Brandmeyer:
And since you can't have enough ways to go to Rome…
(defn update-values [m f args] (reduce #(update-in %1 [%2] f
args) m (keys m)))
-BEGIN PGP
Hi,
I based a recent presentation in a local user group on the bank account
example: two accounts, deposit, withdrawal, transfer. Starting with maps.
Building the code. Noticing that no locks are required. Replacing maps with
records w/o changes to underlying code. Easily testing pure
Hi,
Am Dienstag, 8. Januar 2013 08:50:05 UTC+1 schrieb Eric MacAdie:
Is there a common unit testing framework for Clojure? I did some googling,
put all the results were a couple of years old.
clojure.test ships with clojure proper. And midje is also very popular.
Kind regards
Meikel
--
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Hi,
Am 30.12.12 07:14, schrieb Laurent PETIT:
`when` provides an implicit `do`, so I generally try to only use
it when I want side-effects. (Other side-effecty forms include
`do`, `doseq`, `dotimes` and `when-not`.)
On the other end, using when
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Hi,
Am 24.12.12 04:20, schrieb Andrew Care:
Why can I use (repeat 9) and not (repeat number)?
Because you call zero? on nil, which doesn't work. Instead of (zero?
(some #{0} ...)) use (some zero? ...).
Kind regards
Meikel
-BEGIN PGP
Hi,
Am 22.12.12 00:37, schrieb Lee Spector:
;; this is defined elsewhere, and I want push-states to have fields for each
push-type that's defined here
(def push-types '(:exec :integer :float :code :boolean :string :zip
:tag :auxiliary :return :environment)
(defn
Hi,
Am Freitag, 14. Dezember 2012 09:04:32 UTC+1 schrieb puzzler:
Has the situation improved? (Specifically, are you speaking from
experience with splitting files up in this way, or is this just a
theoretical idea? If you have done this and had a good experience, what
tools were you
Hi,
playing devil's advocate:
Am Freitag, 14. Dezember 2012 06:51:43 UTC+1 schrieb puzzler:
It's interesting that most of the solutions presented here involve
something along the lines of immigrate / potemkin / redefine (in your
piplin code). With so many people reinventing the same
at the issue in detail, I suspect the toplevel form
compile issue. You probably need to transform this into a do with a macro.
(defmacro compile-when
[test body]
(when (eval test)
`(do ~@body)))
Kind regards
Meikel Brandmeyer
--
You received this message because you are subscribed to the Google
Hi,
may I suggest a different solution? Create a meta project, which just
depends on all the contrib libraries and specify this as a dependency in
your project. In other parts of the world this is called a BOM - a bill
of material.
Kind regards
Meikel
--
You received this message because
Am 28.11.12 23:10, schrieb Vladimir Tsichevski:
Is it possible?
See exposes-methods in documentation for gen-class.
http://clojure.github.com/clojure/clojure.core-api.html#clojure.core/gen-class
Kind regards
Meikel
--
You received this message because you are subscribed to the Google
Groups
Hi,
Am 12.11.2012 um 22:01 schrieb JvJ:
Metadata is a really useful feature, and it's been helping me a lot. It
seems like a flash of genius on the part of Mr. Hickey. I'm wondering if
similar concepts exist in other programming languages that inspired it, or if
it's unique to Clojure.
Hi Dave,
Am 07.11.2012 um 20:09 schrieb Dave Ray:
There aren't any problems with with-open/doseq/line-seq. The issue is
with with-open/line-seq. For example, it's instinctive (at least for
me anyway) to want to write a function like this:
(defn get-records [file-name]
(with-open [r
Hi,
I get the following results using criterium[1]:
user= (bench (naive-into #{} (range 1e5)))
Evaluation count : 900 in 60 samples of 15 calls.
Execution time mean : 70,659330 ms
Execution time std-deviation : 2,605840 ms
Execution time lower quantile : 67,538775 ms ( 2,5%)
Am Montag, 5. November 2012 15:04:12 UTC+1 schrieb Ambrose
Bonnaire-Sergeant:
Dave Ray's VimClojure page is fantastic. Thank you to all involved.
Indeed. The best introduction so far, IMHO*.*
*
*
Meikel
(thankful VimClojure author)
--
You received this message because you are subscribed to
Hi,
Am Freitag, 2. November 2012 08:23:00 UTC+1 schrieb Satoru Logic:
Hi, all.
Every time I type `*lein repl*`, several line of log get printed out:
Could not find artifact org.clojure:clojure:pom:1.+ in central (
http://repo1.maven.org/maven2)
Could not find artifact
Hi,
Am Freitag, 2. November 2012 08:50:09 UTC+1 schrieb Satoru Logic:
My ~/.lein/profiles.clj contains one line only:
{:user {:plugins [[lein-minnow 0.1.4]]}}
Is it the case that this plugin requiring something that can't be find?
Minnow uses seesaw 1.3.0 which depends on j18n 1.0.0.
Hi,
you have to pass an instance of INotificationHandler, not the class itself.
(.registerNotificationHandler myClient 123 (MyClass.))
or with proxy
(let [handler (proxy [INotificationHandler] []
(handle [notification] here))]
(.registerNotificationHandler myClient 123
Hi,
Am Mittwoch, 31. Oktober 2012 01:29:11 UTC+1 schrieb Ryan T.:
user= (doseq [[id item] my-hash
key (:a-key item)]
(println key))
[:value a value]
[:value a value]
nil
The next step in the doseq also introduces a seq traversal. So your
Hi,
I'm not sure what you are refering to in the provided link. If it's eg.
about :warehouses, then the difference is, that :warehouses contains a
vector in the example in the link. So you basically walk the warehouse
vector one warehouse at a time. But here you of only a single item (the
Hi,
Am Dienstag, 30. Oktober 2012 08:14:22 UTC+1 schrieb Nikita Beloglazov:
Hi. I have a java class that has 2 methods with same but different arities
(one take no arguments, other takes 1 argument). I create a proxy that
overrides both this methods. The problem is that if no-arg method is
Hi,
Am Montag, 29. Oktober 2012 02:20:42 UTC+1 schrieb Vinod Kurup:
On Sunday, October 28, 2012 6:16:12 PM UTC-4, raschedh wrote:
...
If you do not come back, you do not want it enough.
...
Then a few extra clicks on the homepage shouldn't deter you.
Sorry, couldn't resist :-)
Hi,
Am Mittwoch, 10. Oktober 2012 16:27:37 UTC+2 schrieb Rich Hickey:
I released a little app today that imports Git repos into Datomic. My hope
is that it can be used as the underpinnings of some interesting Clojure
tooling.
More info here:
http://blog.datomic.com/2012/10/codeq.html
Hi,
Am Freitag, 5. Oktober 2012 10:58:05 UTC+2 schrieb Karsten Schmidt:
I've also seen the checks for RandomAccess and Sequential and by simply
moving them to the top (after the null check) of the long if-then cascade
in RT.nthFrom(), the old performance is restored. I will open a ticket
Hi,
you should probably add some dorun somewhere.
Kind regards
Meikel
--
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 members are moderated - please be patient
Hi,
Am Donnerstag, 27. September 2012 12:16:41 UTC+2 schrieb arekanderu:
I am new to clojure and I have two questions about do and the way it should
be used.
*Question 1: Which of the following two functions is more idiomatic and
why? Both functions produce the same result.*
code
(defn
Hi,
Am 29.08.2012 um 23:38 schrieb dmirylenka:
Although, code working with maps shouldn't use conj anyway.
Why?
Kind regards
Meikel
signature.asc
Description: Message signed with OpenPGP using GPGMail
And service should not be a string.
Am Dienstag, 28. August 2012 13:49:54 UTC+2 schrieb Fogus:
The ctor call for ServerSocket should be (ServerSocket. port localhost).
--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send
Hi,
in case you really want only nils filtered out:
(filter (complement nil?) coll)
or
(remove nil? coll)
Kind regards
Meikel
-Ursprüngliche Nachricht-
Von: Bill Caputo logos...@gmail.com
An: Tamreen Khan histor...@gmail.com
Cc: clojure@googlegroups.com
Gesendet: So, 12 Aug 2012,
Hi,
pay attention:
(or (:a {:a false}) 0)
(:a {:a false} 0)
Same holds in case false is nil.
Using these transformations can easily introduce bugs, depending on the
context.
Kind regards
Meikel
-Ursprüngliche Nachricht-
Von: Takahiro Hozumi fat...@googlemail.com
An:
Hi,
Am Donnerstag, 9. August 2012 14:10:55 UTC+2 schrieb Jim foo.bar:
1. First of all, my lein repl hangs each time I reload a namespace
that uses seesaw.core. Not when I first load it (load-file blah...blah),
but when I reload it after some changes...this is really a problem
Hi,
Am Donnerstag, 9. August 2012 14:43:57 UTC+2 schrieb Jim foo.bar:
are you 'using' or 'requiring' seesaw.core in your projects?
I usually do (require '[seesaw.core :as swing]).
the same thing happens (repl hangs) when i cose my frame and try to open
up a new one! this is weird yes?
Hi,
why recommending a specific version at all?
Just point to search.maven.org or mvnrepository.com and let the user choose
one?
Kind regards
Meikel
--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to
Hi,
Am Mittwoch, 8. August 2012 12:06:36 UTC+2 schrieb Michael Klishin:
Because users do not want to choose?
Just give her a version to install, asking people to go through
maven search results figuring out how to determine what's the most recent
version is at least not
very friendly.
Hi,
Am 08.08.2012 um 20:48 schrieb Sean Corfield:
On Wed, Aug 8, 2012 at 11:46 AM, Sean Corfield seancorfi...@gmail.com wrote:
On Wed, Aug 8, 2012 at 2:52 AM, Meikel Brandmeyer (kotarak) m...@kotka.de
wrote:
why recommending a specific version at all?
Just point to search.maven.org
Hi,
I agree with the previous posters. Concurrency in Clojure is neither free
nor automatic. You have to put quite a bit of thought in to get things
right. I'm always reminded of the classic memoize
discussionhttp://kotka.de/blog/2010/03/memoize_done_right.html.
Things like futures or
Hi,
Am Mittwoch, 1. August 2012 14:21:22 UTC+2 schrieb Vinay D.E:
Just curious, but if I chained a large number of such lazy constructs,
isn't there danger of a big unpredictable spike in CPU / Memory if
something deeply nested is accessed ?
Is there someplace where this is discussed in
Hi,
Am Mittwoch, 1. August 2012 14:21:22 UTC+2 schrieb Vinay D.E:
Just curious, but if I chained a large number of such lazy constructs,
isn't there danger of a big unpredictable spike in CPU / Memory if
something deeply nested is accessed ?
You may run into a stackoverflow, though. This
Hi,
you should choose a fixed width font. Then you can line up sentences
without problems using spaces. Inconvenient, but doable.
Kind regards
Meikel
--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to
Hi,
Am Mittwoch, 18. Juli 2012 00:57:13 UTC+2 schrieb Warren Lynn:
I have a hard time understanding why there is a need to retry when doing
swap! on an atom. Why does not Clojure just lock the atom up-front and do
the update? I have this question because I don't see any benefit of the
Hi,
the correct syntax is
(defmacro aTest
[]
`(defn ~'aFun [~(with-meta 'b {:tag 'long})]))
; (meta (first (nth (macroexpand-1 '(aTest)) 2))) = {:tag long}
The 'long might also be a `long. I'm not sure about that one.
Kind regards
Meikel
PS: Shameless self-promotion:
Hi,
I think you don't handle the switching of streams correctly. You have to
keep track with atoms. But then you run into thread-safety issues.
(defn concat-input-stream
Gets one or many input streams and returns a new input stream that
concatenates the given streams.
[is streams]
(let
Hi again,
talking about thread safety.
Am Freitag, 13. Juli 2012 16:13:54 UTC+2 schrieb Meikel Brandmeyer
(kotarak):
(close
[]
(when @is
(.close @is)
(doseq [s @streams] (.close s
(close
[]
(locking this
(when @is
(.close
Hi,
Am 13.07.2012 um 19:25 schrieb Alan Malloy:
(defn coll-enumeration [coll]
(clojure.lang.SeqEnumeration. coll))
Ah. I knew there must be something. But it doesn't seem to be official, public
API.
Meikel
signature.asc
Description: Message signed with OpenPGP using GPGMail
Hi,
Am 13.07.2012 um 23:48 schrieb Kevin Downey:
thank you for responding personally to me, but I sent my message to
clojure google group.
given the thread has the subject Concatenating InputStreams and I
linked javadocs for a standard part of java.io that does exactly that,
I am
Hi,
and more errata: reading is not thread-safe when the result is -1. Then an
unintended switch! might happen. There things have to be packed into a locking
together with a second read to verify it's still −1. Details! Details!
Kind regards
Meikel
signature.asc
Description: Message signed
Hi,
I'm not sure I understand your problem. As soon as you talk about loop
there is no laziness involved anymore. Then just use a vector. If you need
laziness then use the usual lazy-seq approach with recursion (or if
possible use higher-level sequence functions).
Kind regards
Meikel
--
You
Hi,
in the first example the recursion happens immediately. That is when you
call my-map you get start the recursion immediately all the way down. Hence
you get the overflow. With lazy-seq basically nothing is done when calling
my-map. The computation is deferred. Only when accessed the
Hi,
(defn example
[ args]
(let [[opts args] (let [opts? (first args)]
(if (map? opts?)
[opts? (next args)]
[nil args]))]
(reduce str args)))
Kind regards
Meikel
--
You received this message because you are subscribed
Hi,
Am 28.06.2012 um 20:52 schrieb Tassilo Horn:
And yes, there are some counter examples like `count` and `last`...
last is not a counterexample. last is a sequence function, which acts on seqs.
It just calls seq on its argument so you may pass in a vector (or anything
seqable). The vector
Hi,
Am Freitag, 29. Juni 2012 05:26:07 UTC+2 schrieb tbc++:
For instance, one such function I wrote tonight is called every-other
(returns '(1 3 5) if you hand it (1 2 3 4 5))
user= (take-nth 2 [1 2 3 4 5])
(1 3 5)
Kind regards
Meikel
--
You received this message because you are
Hi,
maybe lazymap might help you:
https://clojars.org/de.kotka/lazymap
http://bitbucket.org/kotarak/lazymap
Kind regards
Meikel
--
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
Hi,
you can use destructuring to provide defaults. And you can easily curry in
options when passing things through.
(defn general-descend
[xy ys
{:keys [gradient-fn cost-fn yield-fn alpha iterations thetas]
:or {cost-fncost
yield-fn println
alpha
Hi,
the exception probably stems from the fact that you do the database
interaction inside a dosync transaction.
Kind regards
Meikel
--
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
Hi,
Am 14.06.2012 um 22:33 schrieb dmirylenka:
Could you please explain a bit more?
I don't have any dosync in my code.
transaction* contains an io! form which throws such an exception when called in
a dosync. How does the code look like, which does not work?
Kind regards
Meikel
--
You
Hi,
Am Dienstag, 12. Juni 2012 12:10:08 UTC+2 schrieb Chris Ford:
While first and next need to be supported to make maps and sets sequable,
I don't think that conceptually the elements are ordered.
Take care! Neither maps nor sets (nor vectors for that matter) support
first and next! These
Hi,
Am Dienstag, 12. Juni 2012 10:24:31 UTC+2 schrieb Baishampayan Ghose:
While I agree that one could use a record in place of a struct, I
don't think structs are obsolete, at least not officially.
From http://clojure.org/datatypes:
Overall, records will be better than structmaps for
Hi,
Am Dienstag, 12. Juni 2012 14:28:21 UTC+2 schrieb Jim foo.bar:
Of course, I Just noticed that type-hinting 'p' renders the precondition
useless...an extra performance bonus!
If update-position is a protocol function just call it without the dot.
Just like a normal function. Then any
Hi,
Am Montag, 11. Juni 2012 10:04:59 UTC+2 schrieb Tassilo Horn:
The main difference is that I build up a new vector of functions instead
of a list of functions in order not to have to reverse it.
You should probably inline comp for your purposes. Note the reverse call
there.
Hi,
I propose to use criterium to do benchmarking. https://clojars.org/criterium
The restart of the JVM should not be necessary. You normally need just
enough warm-up rounds. criterium (mostly) takes care of such details.
Kind regards
Meikel
--
You received this message because you are
Hi,
Beware the personal opinion!
map applies a function to each element of a sequence and returns a sequence of
the results.
If you call the function just for side-effects, but not the return value,
then the semantics of map don't apply.
Kind regards
Meikel
-Ursprüngliche Nachricht-
Hi,
the doseq has the additional benefit of its ugliness which makes side-effects
stand out. ;)
Kind regards
Meikel
-Ursprüngliche Nachricht-
Von: Sean Corfield seancorfi...@gmail.com
An: clojure@googlegroups.com
Gesendet: Sa, 09 Jun 2012, 04:50:53 MESZ
Betreff: Re: Doseq, map-style
Hi,
this will be simplified tremenduously when there is a Seqable protocol. Then
satisfies? will do the job.
I'm still thinking when I ever needed seqable?, though.
Kind regards
Meikel
-Ursprüngliche Nachricht-
Von: Ambrose Bonnaire-Sergeant abonnaireserge...@gmail.com
An:
Hi,
because the first element is taken verbatim and the function is not applied
to it. In this case it is the zero.
(iterate f x) = (x (f x) (f (f x)) ...)
So the pluses you see are for the 1 and the 2.
Kind regards
Meikel
--
You received this message because you are subscribed to the
Hi,
Am Mittwoch, 6. Juni 2012 12:13:56 UTC+2 schrieb Jim foo.bar:
Your f is NOT free of side-effects...Nonetheless, I would expect (0 +1
+2) instead of (+0 +1 2)!
Can anyone shine some light on this?
When printing the sequence the tail is realized before the current item is
printed.
And a completely different approach:
(into {} (map-indexed #(vector (inc %1) %2) [a b c]))
Kind regards
Meikel
--
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
Or simply: #(vector 1 % 3)
Literals are not the only way to create data structures.
Kind regards
Meikel
--
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 members are
Hi,
Am 04.06.2012 um 23:36 schrieb Jay Fields:
I have some code that checks for a key as part of a cond statement. If I use
a map everything works fine, but if I ever pass in a sorted-map things fail.
I boiled down the issue to this:
user= (contains? (sorted-map 1 2 3 4) :a)
Hi,
Am Dienstag, 22. Mai 2012 00:08:52 UTC+2 schrieb puzzler:
Mergeable maps are a good idea, but the current way of doing things
steers people away from that solution and requires too much
forethought to actively plan for reuse.
I wonder why the current way of doing things “steers away”
Hi,
Am Dienstag, 22. Mai 2012 09:01:31 UTC+2 schrieb Nicolas Oury:
I think the whole thread is about the trade-off: some people complains
that deftype lacks features.
It's not about trade-offs. It's about deftype seemingly lacking features.
Another problem with extend is that you
Hi,
because in the repl you probably call (fact 1) while running the same from the
commandline passes a string: (fact 1). You should get the same error when
calling the fact functions with a string at the repl.
Kind regards
Meikel
--
You received this message because you are subscribed to
Hi,
you have to use AOT compilation to generate the class with gen-class.
Additionally you have to compile the clojure source before you compile the
java code since otherwise the class is missing. I don't know how to do this
with maven. I can tell you only for gradle.
Kind regards
Meikel
--
Hi,
you are sure that your AOT compiled class files are on the classpath before
compiling the Java side?
Kind regards
Meikel
--
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
Hi,
Am Mittwoch, 9. Mai 2012 08:08:10 UTC+2 schrieb Alex Baranosky:
3) read through core.clj, like a fine classic novel. You'll get all sorts
of good stuff through this process. I can't express deeply enough how
important this is. Just DO IT.
I throw in a warning here. core.clj
Hi,
Am Montag, 7. Mai 2012 16:15:44 UTC+2 schrieb dgrnbrg:
I haven't been able to figure out how to consistently repro it--it
happens when I evaluate it with VimClojure, and sometimes from the
lein repl, but I don't have a clear repro case :(. Here's the
repository that the code lives
Hi again,
Am Montag, 7. Mai 2012 16:26:48 UTC+2 schrieb Meikel Brandmeyer (kotarak):
(ns piplin.test.math
(:refer-clojure :exclude [not=])
(:use ...)
(:import ...))
You should do the same in piplin.math, btw.
Kind regards
Meikel
--
You received this message because you
Hi,
Am 03.05.2012 um 18:43 schrieb Frank Siebenlist:
user= (pprint #'clojure.core/*print-length*)
#Var@5d2aea3e: nil
nil
user= (clj-ns-browser.utils/pprint-str #'clojure.core/*print-length*)
#Var@5d2aea3e: 32\n
user= (with-out-str (binding [*print-length* 32 *print-level* 6] (pprint
Hi again,
Am 03.05.2012 um 18:59 schrieb Meikel Brandmeyer:
user= (def f nil)
#'user/f
user= (binding [*print-length* 32] (clojure.pprint/pprint f))
nil
Of course I should have printed the Var.
user= (binding [*print-length* 32] (clojure.pprint/pprint #'f))
#Var@4a3a6e5c: nil
Kind regards
Hi,
Am Dienstag, 1. Mai 2012 20:17:21 UTC+2 schrieb Chris Perkins:
I wouldn't put too much stock in what it says at clojure.org/reader - it
hasn't been updated in a long time. The implementation is probably a more
definitive definition of what characters are allowed.
In the past, Rich
Hi,
(defn fix2 [f x] (let [v (f x)] ({x x} v (recur f v
recur is not in the tail position. The call to the map is the tail call.
So the result is as expected.
Kind regards,
Meikel
--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this
Hi,
your comparison is not fair. The map example merely assoc's a new value,
while in the record case you create a complete fresh value with a different
type. Here some more comparisons:
user= (defrecord Foo [a b])
user.Foo
user= (defrecord Bar [a b c])
user.Bar
user= (let [x (-Foo 10 20)]
Hi,
it does not automatically deref the Var. Instead the Var delegates being
called like a function to the value it's holding. If Clojure was
automatically to dereffing a Var upon access, you wouldn't be able to use
it as a value, because you'd always get its contents.
Kind regards
Meikel
--
Hi,
I think this is a bug. This is the expansion without any :as clause:
(let*
[map__4496
{:a 10, :b 20, :c {:a 30, :b 40}}
map__4496
(if (clojure.core/seq? map__4496)
(clojure.core/apply clojure.core/hash-map map__4496)
map__4496)
map__4497
(clojure.core/get map__4496
Hi,
yes, I think so. The destructuring should not depend on the presence or
absence of a (for a given key) unrelated option. So no matter what I do
with :as the :a, :b, etc. keys should be correctly destructured, even in
nested maps as in your example.
Kind regards
Meikel
--
You received
Hi,
Am 13.04.2012 um 21:45 schrieb Andy Fingerhut:
One little nit that confuses me.
Boolean/FALSE is documented as being of type Boolean in Java documentation,
yet it is treated by Clojure the same as primitive boolean false:
user= (clojure-version)
1.3.0
user= (if Boolean/FALSE
Hi,
for hygienic reasons. ` qualifies symbols, while ' does not. So `or might
result in clojure.core/or, while 'or is always or. This is important. Consider
the following example.
(ns foo.bar)
(defmacro foo-or
[ body]
`(or ~@body))
(ns frob.nicate
(:refer-clojure :exclude [or])
(:use
Hi,
Am 11.04.2012 um 10:46 schrieb Alexander Shabanov:
Oh, I see it. Well, it complicates the matters but at least it is not a bug :)
In fact it makes things less complicated. You rarely want a quoted symbol in
Clojure. Most of the time you'd use a keyword in such cases.
Kind regards
Meikel
Hi,
Am 07.04.2012 um 18:10 schrieb Steven Obua:
Thx, I am using (boolean ...) now to normalize my load-store function.
ObjectInputStream and ObjectOutputStream have .readBoolean resp. .writeBoolean
methods which do the right thing.
Kind regards
Meikel
--
You received this message because
Hi Luc,
Am Donnerstag, 5. April 2012 01:51:25 UTC+2 schrieb Luc:
Agree, I still wonder about the downsides of AOT, comments ?
Main downside - especially for an arbitrary library: it locks you down on
the specific clojure version you used for compiling, also the using
project. For a library
Hi Marco,
would you add me to the mix? I want to build up a users group for Frankfurt
am Main (Germany). However, at the moment it has only one semi-active
member, myself. Nevertheless I'd like to take part in the meet the group
event - should it happen - to exchange experiences a bit for
Hi,
Am Montag, 19. März 2012 11:56:28 UTC+1 schrieb Narvius:
1) Compare the old and new value - doesn't seem very efficient.
Just return the very same world state object? You can easily and insanely
fast decide whether it was changed by virtue of identical?. Then you
don't need any special
Hi,
there is no 6th element in your example. That's why you get nil.
Clojure 1.3.0
user= ((fn [[f r] n] (if (zero? n) f (recur r (dec n [4 5 6 7 8 9] 2)
6
Sincerely
Meikel
--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group,
101 - 200 of 1905 matches
Mail list logo