About realizing the head of lazy seqs in with-meta:
On 5 November 2017 at 01:57, Didier wrote:
> > That said, metadata and its relationship to an object is immutable - an
>>> object with different metadata is a different object. One consequence of
>>> this is that applying metadata to a lazy seq
That's right. This happens is because collection classes' toString
implementations currently delegate to RT.printString, which in turn is
affected by the value of *print-readably*.
Filed https://dev.clojure.org/jira/browse/CLJ-2248 with a fix.
Cheers,
Michał
On 18 September 2017 at 03:08, Justi
I've run into a behaviour change that was actually already present in
alpha20 – with the CLJ-99 patch in place, {min,max}-key now return the
first argument with the minimum/maximum key, whereas previously they
returned the last such argument.
The new behaviour seems like the more natural one, but
: 2.956519 sec
Execution time std-deviation : 22.423970 ms
Execution time lower quantile : 2.930938 sec ( 2.5%)
Execution time upper quantile : 2.978283 sec (97.5%)
Overhead used : 21.423788 ns
On 22 November 2016 at 05:21, Michał Marczyk
wrote:
> Some furt
Some further optimizations for a factor of ~2.3 speed-up over nth5 as copy
& pasted from upthread (6.713742 ms → 2.897630 ms) in
(c/quick-bench (nth-shell 100 (point. 0 0)))
(1) java.util.HashSet has a ctor that takes initial capacity of the set as
an int. Passing in (* 4 (.size s1)) when const
Hi,
I am pleased to announce the initial release of maxiphobe, a meldable
priority queue library based on Okasaki's maxiphobic heaps (see
Okasaki, "Alternatives to Two Classic Data Structures"). Maxiphobic
heaps are a strikingly simple purely functional approach to
implementing priority queues tha
Hi,
I am pleased to announce the 0.0.2 release of psq.clj, a Clojure
priority search queue library based on Ralf Hinze's priority search
pennants (see Ralf Hinze, "A Simple Implementation Technique for
Priority Search Queues"):
https://github.com/michalmarczyk/psq.clj
https://clojars.org/psq
Only one quick bit of feedback – it's preferable to use test.check
facilities instead of (rand) because they're "repeatable": the seed emitted
in test.check output can be used to rerun the test with the same test.check
PRNG state (see the docstring on clojure.test.check/quick-check,
specifically th
Hi,
I am pleased to announce the 0.0.17 release of data.avl, a Clojure
Contrib library providing highly performant drop-in replacements for
Clojure(Script)'s built-in sorted maps and sets that support O(log n)
nth, rank-of, first-class submaps/subsets (like subseq, but preserving
collection type;
Hi,
data.avl 0.0.16 is now available with a bugfix to the "one-sided
subrange past end of collection" case of subrange partly fixed in
0.0.15.
[org.clojure/data.avl "0.0.16"]
org.clojure
data.avl
0.0.16
org.clojure:data.avl:0.0.16
Cheers,
Michał
--
You received this mes
Hi,
I am pleased to announce the 0.0.15 release of data.avl, a Clojure
Contrib library providing highly performant drop-in replacements for
Clojure(Script)'s built-in sorted maps and sets that support O(log n)
nth, rank-of, first-class submaps/subsets (like subseq, but preserving
collection type;
Esp on the reduce stuff - great to see that. Any reason you
> didn't go the IReduce path in Clojure too instead of CollReduce? Generally,
> I'd say that's preferred when you control the data structure.
>
>
> On Monday, August 22, 2016 at 7:43:51 PM UTC-5, Michał Marcz
Hi,
I am pleased to announce the 0.0.14 release of data.avl, a Clojure
Contrib library providing highly performant drop-in replacements for
Clojure(Script)'s built-in sorted maps and sets that support O(log n)
nth, rank-of, first-class submaps/subsets (like subseq, but preserving
collection type;
And just to add a pointer in case anybody's interested in opting in to this
behaviour in a custom type, it's possible to do so by implementing
clojure.core.protocols/IKVReduce (data.avl does this) or
clojure.lang.IKVReduce (the iface implemented by built-in maps;
clojure.core provides implementatio
FYI, you may want to have a look at the following commits:
commit 71930b6b6537a796cdf13c4ffa7cf93eb53b6235
Author: Rich Hickey
Date: Mon Feb 28 17:55:14 2011 -0500
improve startup time via lazy defn loading
commit c5681382da775e898915b17f3ab18b49c65359ec
Author: Rich Hickey
Date: Tue A
Just noticed that I forgot to include dependency info and links… Here they
are:
https://github.com/clojure/data.avl
[org.clojure/data.avl "0.0.13"]
org.clojure
data.avl
0.0.13
compile "org.clojure:data.avl:0.0.13"
Cheers,
Michał
On 9 December 2
Hi,
I am pleased to announce the 0.0.13 release of data.avl, a Clojure
Contrib library providing highly performant drop-in replacements for
Clojure(Script)'s built-in sorted maps and sets with the following
headline features:
0. performance often superior to the built-ins (owing to the smaller
Just noticed that I sent my previous email to clojure-dev only – reposting
to all groups involved:
On 13 April 2015 at 16:25, Michał Marczyk wrote:
> On 13 April 2015 at 15:48, Alex Miller wrote:
> To get the effect you want in this, using #_ *inside* the reader
conditional woul
It may be worth noting that while the return value of range is wrapped in
lazy-seq and thus isn't itself a clojure.lang.IChunkedSeq, what you get
when you realize it is indeed chunked:
(contains? (ancestors (class (seq (range 128 clojure.lang.IChunkedSeq)
true
It doesn't implement c.l.IReduce
(defn upd-vec [input-vector ids new-values]
(reduce-kv #(assoc %1 %3 (new-values %2)) input-vector ids))
(upd-vec [0 0 0 0 0] [1 3] [1.44 1.45])
;= [0 1.44 0 1.45 0]
On 30 March 2015 at 20:05, Alexandr wrote:
> Hello everybody,
>
> How can I update values in the vector given vector of id-s a
On 20 February 2015 at 20:09, David James wrote:
> Yes, exactly, you read my mind.
>
> (I'd also like to do this a sorted-map / PersistentTreeMap (nudge, nudge)
> -- all that is missing would be public 'left' and 'right' accessors. I
> don't n
PS. Well, I suppose you'd want to make sure that you're not getting a key
that lies past the right endpoint of the map when using the nearest-based
approach.
On 20 February 2015 at 16:39, Michał Marczyk
wrote:
> Do you mean you'd like to compress
>
> {0 :a 1 :a 2 :a
Do you mean you'd like to compress
{0 :a 1 :a 2 :a 3 :a 4 :b 5 :b 6 :c 7 :c 8 :c 9 :c}
to something like
{[0 1 2] :a [4 5] :b [6 7 8 9] :c}
while maintaining the ability to ask for the value at 0, 1, …, 9?
If so, you could represent the above as
{0 :a 2 :a 4 :b 5 :b 6 :c 9 :c}
(notice
gt;> If you don't want it soon, you could try persuading a few dozen people to
>> vote on CLJ-1008, and hope the Clojure developers also want this change.
>> No guarantees there.
>>
>> Andy
>>
>> On Thu, Feb 19, 2015 at 12:18 PM, David James wrote:
>
I created a ticket and posted a patch:
http://dev.clojure.org/jira/browse/CLJ-1613
On 12 December 2014 at 08:35, Michał Marczyk wrote:
> (let [foo 1
>bar 2
>{:keys [bar foo]
> :or {foo 3 bar (inc foo)}} {}]
> {:foo foo :bar bar})
> ;= {:foo 3, :bar
Quoting Michael's Gist:
(let [{:keys [bar foo]
:or {foo 1
bar (inc foo)}} {}]
(assert (= foo 1))
(assert (= bar 2)))
The main problem I see with this is that I'd expect the foo in :or to
refer to any foo in the enclosing scope. As things stand, whether it
does or not depend
Hi,
I am pleased to announce the immediate availability of version 0.0.2
of ctries.clj, a Clojure implementation of the Ctrie data structure
introduced by Prokopec, Bronson, Bagwell and Odersky.
This release includes some new tests, both single and multithreaded,
exercising a number of features,
On 8 December 2014 at 21:17, Fluid Dynamics wrote:
> On Monday, December 8, 2014 9:32:28 AM UTC-5, Las wrote:
>> […]
>> io/reader is not meant to be used solely as an input to edn/read.
>
>
> AFAICT, PushbackReader is substitutable anywhere a reader is expected, but
> apparently a plain unwrapped
On 8 December 2014 at 21:46, Fluid Dynamics wrote:
> [...]
> Which means it's locking or bust. You just get to either do the locking
> yourself or delegate :)
Sure, but isn't it nice when somebody else does your locking for you? :-)
Incidentally, there is a trade-off here between lockless reads
like
(fn [old-state]
(if (contains? old-state :foo)
(assoc old-state :foo (delay (foo)))
old-state))
I'd probably prefer a CHM for this purpose, though.
Michał
On 8 December 2014 at 21:33, Michał Marczyk wrote:
> On 8 December 2014 at 17:54, Andy L wrote:
>
On 8 December 2014 at 17:54, Andy L wrote:
>> But I'd personally just use a delay rather than "locking" for this
>> purpose.
>
>
> It is not that I like locking at all. However I still fail to see, how in a
> multithreaded context memoize/cache prevents executing a given function more
> than once
Hi,
I am pleased to announce the initial release of ctries.clj, a port of
the original Scala implementation of this fascinating data structure
with a Clojure API that allows usage scenarios such as this:
(def x (ct/concurrent-map :foo 1))
;; @ takes independently mutable snapshots;
;; persi
java.util.concurrent.ConcurrentHashMap has a putIfAbsent method that
could be used with delays to support this use case with a no
recomputation guarantee:
(def chm (java.util.concurrent.ConcurrentHashMap.))
;; this will work as expected whether chm has a value for :foo or not
(let [d (delay (+ 1
It seems hard to answer in a completely generic fashion. If there's a
certain collection of vectors which you'd like to share structure, it
may be possible to put a number on the degree of sharing achieved by
examining the internals of those vectors. That wouldn't address the
issue of intermediate
Use pr-str:
user=> (str (lazy-seq (list 1 2 3)))
"clojure.lang.LazySeq@7861"
user=> (pr-str (lazy-seq (list 1 2 3)))
"(1 2 3)"
Cheers,
Michał
On 15 May 2014 16:29, Phillip Lord wrote:
>
>
> I am trying to dump a representation of the contents of a list to file.
> I've recently changed how I ge
Sure, here's a possible approach:
user> (gen/sample (gen/fmap (partial apply concat) (gen/list (gen/fmap
#(repeat 3 %) gen/int
(()
()
(0 0 0)
(3 3 3 3 3 3 2 2 2)
(3 3 3 2 2 2 0 0 0 3 3 3)
(2 2 2)
(-4 -4 -4 -6 -6 -6)
(4 4 4 5 5 5)
(7 7 7 3 3 3)
(3 3 3 7 7 7 9 9 9 7 7 7 4 4 4 -4 -4 -4))
any case I kind
of like the separate isAlien.
On 13 May 2014 14:47, Michał Marczyk wrote:
> Unfortunately the Guava example means that this approach doesn't
> really solve the problem at hand... Thanks for pointing it out.
>
> The earlier version with the three-way tes
Unfortunately the Guava example means that this approach doesn't
really solve the problem at hand... Thanks for pointing it out.
The earlier version with the three-way test in place of the
"java.util." check should be semantically correct, at least.
On 13 May 2014 14:40, Michał
2014 14:20, Michał Marczyk wrote:
> It's not just to facilitate inlining, but also to limit the perf hit
> for hashing non-collections, some of which make completely reasonable
> map keys and set members. I've used the classes Alex Miller mentioned
> he was interested in for ben
; implementations, but push the "default" cases down into the bottom of that
> method.
>
>
> On Tuesday, May 13, 2014 12:38:54 AM UTC-4, Michał Marczyk wrote:
>>
>> I've posted a patch that makes java.util.{List,Map,Map.Entry,Set}
>> hashes consistent
I've posted a patch that makes java.util.{List,Map,Map.Entry,Set}
hashes consistent with those of appropriate Clojure collection types
on the ticket.
Performance of repeated hasheq lookups on a single PHM actually seems
to be slightly better with this patch applied. Adding the hasheqs of a
PHM, a
vec with a short array of objects is a special case in that it simply
puts the existing array in a PersistentVector wrapper:
user=> (def arr (object-array 16))
#'user/arr
user=> (doseq [i (range 16)] (aset arr i i))
nil
user=> (def v (vec arr))
#'user/v
user=> v
[0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
4 outliers in 60 samples (6.6667 %)
low-severe 4 (6.6667 %)
Variance from outliers : 1.6389 % Variance is slightly inflated by outliers
On 24 April 2014 08:51, Michał Marczyk wrote:
> Cheers Alex!
>
> See below for the results of yesterday's run of my benchmark suite for
> t
2.115402 ns
nil
On 23 April 2014 18:37, Alex Miller wrote:
> Great work as always!
>
> Are there any places where data.avl performs worse than the built-in sorted
> maps and sets?
>
>
> On Wednesday, April 23, 2014 7:59:59 AM UTC-5, Michał Marczyk wrote:
>>
>> Hi,
>&
Hi,
I am pleased to announce the 0.0.12 release of data.avl, a Clojure
Contrib library providing drop-in replacements for Clojure(Script)'s
built-in sorted maps and sets with additional functionality:
1. real (non-view) logarithmic-time slicing and splits;
2. logarithmic-time nearest neighbour
Hi,
I am pleased to announce the 0.0.11 release of core.rrb-vector, a
Clojure Contrib library extending the Clojure vector API with
logarithmic-time concatenation and slicing:
https://github.com/clojure/core.rrb-vector
[org.clojure/core.rrb-vector "0.0.11"]
org.clojure
core.rrb-v
The problem is that inner-lazy is a method of AProto which is
implemented for ARecord, but actually called (in trigger-fn) on a
vector of two ARecords. The exception thrown is an
IllegalArgumentException complaining about the missing method.
inner-lazy2 works, because it's just a regular function.
Hi,
I am pleased to announce the 0.0.12-alpha1 release of data.avl, a
Clojure Contrib library providing drop-in replacements for
Clojure(Script)'s built-in sorted maps and sets with additional
functionality including support for real (non-view) logarithmic-time
slicing, splits, nearest neighbour l
On 22 March 2014 00:47, Stefan Kamphausen wrote:
> On Saturday, March 22, 2014 12:41:55 AM UTC+1, Andy Fingerhut wrote:
>> That is odd. This is a shot in the dark, and probably unhelpful because I
>> do not know a good way to verify whether my guess is true, but perhaps the
>> seqFrom method went
We're vulnerable to this problem anyway as long as hashing is
deterministic, which is why I think it would be cool to use some
universal-hashing-like scheme...
I think Murmur3 actually uses a seed that could be randomized? Not
really "safe" in the cryptographic sense of the word, but would make
th
On 19 March 2014 21:14, Alex Miller wrote:
> Rich just pushed a change to the String hashing to address this. We're
> going to grab the string hashcode (which is cached after first call) and
> murmur the result of that. This gives us constant time hashcode after first
> call with better distribut
Hashes are cached for Clojure collections, keywords and symbols, but
not for strings.
I wonder if people who report these perf regressions use long string
keys in their maps... For this to explain the regression they'd have
to be looking up the same String objects a lot, of course (else
hashCode c
that is O(log n) worst case (if
> using Red-Black trees) or O(1) average case (hashing)
>
> * (get { ... } key) does not have integer/string limitation
>
> Therefore: why are we not "compiling down to get" ? Are the big-Oh
> constants enormous?
>
> On Tue,
.clojure.org/jira/browse/CLJS-713.
>
> David
>
>
> On Tue, Feb 18, 2014 at 4:35 PM, t x wrote:
>>
>> Looking at
>> https://github.com/clojure/clojurescript/blob/r2156/src/clj/cljs/core.clj#L1144-L1147
>> , you win. :-)
>>
>> On Tue, Feb 18, 2014
On 18 February 2014 22:31, Michał Marczyk wrote:
> Actually in ClojureScript case dispatch is O(n), since it's
> implemented as a macro expanding to cond.
As of release 2156:
https://github.com/clojure/clojurescript/blob/r2156/src/clj/cljs/core.clj#L1119
--
You received this mess
On 18 February 2014 22:15, t x wrote:
> I've picked case over cond/condp because I want a O(1) dispatch
> rather than linear execution since there are many patterns [though I'm
> probably guilty of premature optimization here].
Actually in ClojureScript case dispatch is O(n), since it's
impleme
On 18 February 2014 02:14, t x wrote:
> Does this mean:
> (a) the reported behavior is normal (and my bug report is invalid) or
> (b) this error happens in both cljs + clojure ?
I'd say (b).
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To p
Just to be clear, the above is a version of t x's bug-report modified
to use a StringWriter instead of console.log.
Cheers,
Michał
On 18 February 2014 01:25, Michał Marczyk wrote:
> The same thing happens in Clojure:
>
> (defmacro silly [object pat1 body1 pat2 body2]
> `(c
The same thing happens in Clojure:
(defmacro silly [object pat1 body1 pat2 body2]
`(case (:tag ~object)
~pat1 ~body1
~body2))
(def out (java.io.StringWriter.))
(defn log [& args]
(doseq [arg args]
(.write out (str arg))
(.write out "\n")))
(defn init []
(silly {:tag :dog
It is now, thanks for the report!
Ticket with patch:
http://dev.clojure.org/jira/browse/CLJS-765
On 16 February 2014 17:48, Sunil S Nandihalli
wrote:
> Hi Everybody,
>
> I get the following error when I do a rseq on a subvec in clojurescript
> Uncaught Error: No protocol method IReversible.-rs
str is much faster with apply than with reduce; in fact, with reduce
it is O(n^2), whereas with apply it is O(n). (The constants are better
with apply too.)
In general, (apply foo ...) takes advantage of any optimizations the
author of foo might be aware of for speeding up its operation when
given
The Contrib library algo.generic provides a function fmap which does
preserve the type of its input.
As for the idea that clojure.core/map should preserve type, it's worth
remembering that in order to map a function over a set and return a
set, we must do two things: (1) apply the function to each
This returns
(.getTotalPhysicalMemorySize
(java.lang.management.ManagementFactory/getOperatingSystemMXBean))
You could use this in your project.clj, perhaps by including
~(str "-Xms" (quot (.getTotalPhysicalMemorySize ...) appropriate-number))
in :jvm-opts.
Also, you can absolutely use your ow
source-fn is a private Var in the clojure.repl namespace; you can
still use source to display its definition, but you'll have to use the
fully qualified name:
user=> (source clojure.repl/source-fn)
(defn source-fn
"Returns a string of the source code for the given symbol, if it can
find it. T
Oh, sorry, for some reason Gmail didn't alert me to some of the recent
messages coming in while I was viewing this thread.
On 2 February 2014 05:32, Michał Marczyk wrote:
> I'd expect
>
> (persistent!
> (reduce-kv (fn [acc k v] (assoc! acc k (inc v)))
> (tran
eySeq defines first/next, but never
>> explicitly walks the seq.
>>
>> That's left to the user of the KeySeq.
>>
>> Thanks,
>> Ambrose
>>
>>
>> On Sun, Feb 2, 2014 at 12:18 PM, Michał Marczyk wrote:
>>
>> On 2 February 2014 05:1
That doesn't mean that we're not walking the seq twice, however. keys and
vals work off of separate calls to seq on the map, which of necessity
produce distinct seq objects (otherwise traversing a seq over a map would
permanently increase its memory consumption).
On 2 February 2014 05:
On 2 February 2014 05:14, Justin Smith wrote:
> Pardon my ignorance but if this is producing a lazy result, how is it
> doing so?
>
> https://github.com/clojure/clojure/blob/dff9600387b962f16fc78e6477e10e34651fd366/src/jvm/clojure/lang/APersistentMap.java#L134
>
APersistentMap's KeySeq.create an
On 2 February 2014 04:54, Ambrose Bonnaire-Sergeant <
abonnaireserge...@gmail.com> wrote:
> zipmap could also potentially use transients (which would be a nice
> addition).
>
My patch for this has been waiting in JIRA since end of May 2012:
http://dev.clojure.org/jira/browse/CLJ-1005
Cheers,
Mi
If the application is structured in such a way that messages from the
other side of the client/server divide are put on channels upon
arrival, which seems to be a reasonable idea, why not encapsulate the
connection-handling logic in a black box exposing a (bunch of)
channel(s)?
On 26 January 2014
Not addressing the main problem, but require takes multiple libspecs,
so you can write
(ns foo
(:require [foo.bar :as bar]
[foo.quux :as quux]))
to avoid repeating the keyword, at least. :require in ns expands to a
call to require-the-function, so the latter supports multiple
lt! / alts! approach works satisfactorily, or if another
approach based on the available public primitives does, I'd definitely
avoid implementing new funky stuff.
Fun problem to think about, though.
On 14 January 2014 09:47, Michał Marczyk wrote:
> A sketch of a different approach:
>
> a
f the timing is that close, the end result is no different
to what would happen had we arrived at a slightly later time.
On 14 January 2014 09:37, Michał Marczyk wrote:
> Ah, of course, the mutex is not reentrant.
>
> So, one possible way to fix the situation would be to close the own
t; *
> https://github.com/clojure/core.async/blob/master/src/main/clojure/clojure/core/async/impl/channels.clj#L55
>
> isn't this a deadlock by acquiring the mutex while holding the mutex?
>
>
> On Mon, Jan 13, 2014 at 10:27 PM, Michał Marczyk
> wrote:
>>
>> Instead of ac
Instead of actually implementing a new channel type, you could use the
regular MTMCs, but with your own factory function, custom buffers and
a sprinkle of mutability:
(defprotocol PBufferThatMightCloseAChannel
(this-is-your-channel! [this c]
"Informs the buffer that c is the channel it might
Hi,
I am pleased to announce that version 0.0.11 of data.avl, a Clojure
Contrib library implementing drop-in replacements for
Clojure(Script)'s core sorted collections, is now available from Maven
Central. See below for more information.
Changes in this release:
* two bugs squashed in the Cloju
On 6 January 2014 00:33, Brandon Bloom wrote:
> Michał: This is awesome. Thanks for the continued awesome work on data
> structures!
>
>>
>> ;; if the key is not present in the collection, -1 is returned:
>> (avl/rank-of (avl/sorted-set 3 4 5) 0)
>> ;= -1
>
>
> Curious: Why not return nil in
Hi,
I am pleased to announce the initial Clojure Contrib release of
data.avl (previously known as avl.clj), a library implementing drop-in
replacements for Clojure(Script)'s sorted maps and sets with faster
lookups, support for the transient API (leading to unambiguously
improved performance for m
Hi,
I am pleased to announce the immediate availability of version 0.0.10
of core.rrb-vector, a Clojure Contrib library enabling
logarithmic-time concatenation and slicing of Clojure(Script) vectors.
Leiningen:
[org.clojure/core.rrb-vector "0.0.10"]
Maven:
org.clojure
core.rrb-vec
No worries.
Incidentally, akhudek's fast-zip seems to have the same issue. Here's
a PR fixing it:
https://github.com/akhudek/fast-zip/pull/3
Cheers,
Michał
On 1 January 2014 02:12, Lee Spector wrote:
>
> On Dec 31, 2013, at 6:53 PM, Michał Marczyk wrote:
>
>> Ticket
s fixing, but I
think the current behaviour makes sense; perhaps the docstring should
be adjusted, though.
Cheers,
Michał
On 1 January 2014 00:53, Michał Marczyk wrote:
> Ticket with patch at
>
> http://dev.clojure.org/jira/browse/CLJ-1317
>
> The problem is that seq-zip uses
Ticket with patch at
http://dev.clojure.org/jira/browse/CLJ-1317
The problem is that seq-zip uses clojure.core/identity as the
"children" argument to zipper. Applied to (), this returns (), but
clojure.zip expects the "children" function to return nil when there
are no children. The patch attache
On 24 December 2013 07:35, Michał Marczyk wrote:
> ;; persistent maps only
> (instance? clojure.lang.IPersistentMap %)
Additionally, this one's better written
(map? %)
(map? is in fact defined as instance? IPM.)
Cheers,
M.
>
> ;; all Java maps
> (instance? java.util.Map %
;; persistent maps only
(instance? clojure.lang.IPersistentMap %)
;; all Java maps
(instance? java.util.Map %)
On 24 December 2013 04:28, larry google groups
wrote:
> I find this surprising. I do this:
>
> (supers %)
>
> inside of my :post condition, and I get:
>
> java.lang.ClassCastException:
t;> timeout channels in two different alts, and if the timeout channels are
>> aliased, then perhaps only one of the alts would actually get notified.
>>
>>
>> On Wed, Nov 20, 2013 at 5:05 AM, Michał Marczyk
>> wrote:
>>>
>>> The reason = considers
le bug into the library? One could use "two different"
> timeout channels in two different alts, and if the timeout channels are
> aliased, then perhaps only one of the alts would actually get notified.
>
>
> On Wed, Nov 20, 2013 at 5:05 AM, Michał Marczyk
> wrote:
&
The reason = considers you timeout channels to be equal is that they
are, in fact, the same object. In fact, they may end up being the same
object even with different timeout values:
(identical? (timeout 1) (timeout 2))
;= true
Except I got a false just now with a fresh REPL and same timeout
valu
g o
>> (dec x
>>
>> foo' is fast, but foo'' is slow. So something about wrapping the locking
>> clause in a let makes it fast. Still no idea why.
>>
>> On Sunday, November 3, 2013 9:30:45 AM UTC-8, Michał Marczyk wrote:
>>>
>>>
2 is printed
NB. this could also happen with alter-var-root or set! to a Var with a
thread-local binding.
Cheers,
Michał
On 3 November 2013 18:30, Michał Marczyk wrote:
> You have a typo in foo -- monitor-exit's argument is 0 (zero) rather
> than o (the sentinel object).
>
> Bes
You have a typo in foo -- monitor-exit's argument is 0 (zero) rather
than o (the sentinel object).
Besides that, in foo both monitor-enter and monitor-exit get their
arguments from a Var. Rewriting to use locking, which first puts the
object whose monitor will be used in a local (that is, (let [lo
trange, thank you
> very much!
> (def with-meta (fn ^:static with-meta [^clojure.lang.IObj x m]
> (. x (withMeta m
>
>
> On Saturday, September 21, 2013 3:30:30 PM UTC+8, Michał Marczyk wrote:
>>
>> Actually with-meta's definitio
Actually with-meta's definition does not refer to with-meta. Rather,
it calls withMeta, a method in the clojure.lang.IObj interface which
the first argument to with-meta is supposed to implement.
Cheers,
Michał
On 21 September 2013 09:01, wrote:
> Hi,
> I read the source about with-meta, and
hmark results to clojure-dev; I'll post a similar
message here once I'm ready to cut an 0.1.0 release (which basically
needs more tests for added confidence, a test suite on the
ClojureScript side and such).
Cheers,
Michał
On 21 September 2013 04:28, Michał Marczyk wrote:
> On 21 Se
On 21 September 2013 02:42, Michał Marczyk wrote:
> [avl.clj "0.0.1"]
>
>
> avl.clj
> avl.clj
> 0.0.1
>
Make that
[avl.clj "0.0.2"]
and
avl.clj
avl.clj
0.0.2
Cheers,
Michał
--
--
Hi,
I have just released avl.clj, a library implementing drop-in
replacements for Clojure(Script)'s sorted maps and sets which
additionally support the transients API and logarithmic time rank
queries via clojure.core/nth:
(require '[avl.clj :as avl])
(nth (apply avl/sorted-set (range 10
On 10 August 2013 08:39, Michael Klishin wrote:
> I personally think there should be a fallback location for the jar that does
> not use SSL.
As long as it isn't used automatically or after flashing a y/n prompt.
(Offering a flag like --no-ssl and mentioning it to the user when
appropriate would
Also, ^foo-style hints are "soft hints" in the following sense:
(let [^ints xs [1 2 3]] xs) ; no complaint from compiler or RTE
In contrast, ints & Co. demand that the casts be correct:
(let [xs (ints [1 2 3])] xs) ; ClassCastException
On 20 July 2013 11:29, Michał Marczyk
)]
(aget xs 0))
(let [^ints xs (get-some-ints)]
(aget xs 0))
Cheers,
Michał
On 20 July 2013 11:25, Michał Marczyk wrote:
> I think it's more about clojure.core/{ints,longs,...}. These are
> basically tools for removing reflection:
>
> (let [xs (ints (get-some-ints))]
>
I think it's more about clojure.core/{ints,longs,...}. These are
basically tools for removing reflection:
(let [xs (ints (get-some-ints))]
(aget xs 0)) ; no reflection here thanks to the cast
Cheers,
Michał
On 20 July 2013 10:47, Mikera wrote:
> Do you mean something like (int-array [1 2 3
On 19 July 2013 10:24, Daniel Dinnyes wrote:
> Why don't we have a "candidate" name-space, a separate library, like the
> contrib before, which most people who prefer to be on the cutting edge just
> include automatically. That would give reasonable feedback on how much
> traction new stuff like t
1 - 100 of 430 matches
Mail list logo