nnotations they carry in common parlance. I can see how my choice of
wording here can be taken as a personal attack. And so for that, I do
apologize, Brian. In the future I will attempt to use less loaded verbiage.
Timothy Baldridge
On Thu, Aug 25, 2016 at 10:33 AM, Timothy Baldridge
wrote:
&
I'm not sure I've ever addressed this publicly, so I assume now's as good a
time as ever.
The reason the go block stops at function boundaries, is that changing a
function to be "async" changes it return type. With code transforms like
these a function that performs a parking take on a channel no
Another option is to use Clojure's built-in socket server (requires Clojure
1.8) it is really nothing more than a TCP socket attached to a normal
Clojure repl, so you'll be loading no extra middleware or really anything
at all that could slow it down.
http://clojure.org/reference/repl_and_main#_lau
I've worked with a model much like this, and as an experience report: it
resulted in a lot of pain. Atoms inside atoms, or really more than one atom
for the entire state of your app results in to many sources of mutability.
On top of that, you have the problem of async updates: some part of your
st
Also consider map-indexed if you just need to count how many things go
through a lazy seq. It works like map, but takes a (fn [idx itm] ...) where
idx is the index of the item in the overall seq.
On Mon, Sep 12, 2016 at 3:10 PM, Gary Johnson
wrote:
> Almost right. The iterate function is an infi
Two things: a) I don't think the "..." need to be there. I think that was
probably placeholder text from a tutorial? b) I'd suggest using defprotocol
(http://clojure.org/reference/protocols) protocols have a number of
benefits over interfaces.
Timothy
On Fri, Sep 23, 2016 at 1:21 PM, Jeff Murphy
Why not submit a PR against Lighttable as that's where the real bug is?
On Fri, Sep 23, 2016 at 2:08 PM, Boris V. Schmid
wrote:
> lighttable has some trouble with the newer alpha's, in that it throws this
> error:
>
>
>> Call to clojure.core/ns did not conform to spec: ... ((require
>> [clojure.
Almost all of Clojure's reader macros are prefix driven. For example, 'foo
quotes the symbol "foo", a string "foo" starts with a prefix quote and
terminates with another string. Same for lists (prefixed with a
parentheses), vectors, maps, etc. Even var literals #'my-var are prefixed.
So it's very n
How is fluokitten's fold any better than using seqs like (map f a b) would?
Both create intermediate collections.
On Fri, Sep 23, 2016 at 11:40 AM, Dragan Djuric wrote:
> If you do not insist on vanilla clojure, but can use a library, fold from
> fluokitten might enable you to do this. It is sim
But that would print 1 to 32 items depending on a ton of things. No the
correct way to write code like that is
(doseq [s coll]
(println s))
If you need to iterate over multiple items then use (map f a b).
Also I would suggest benchmarking things, sure (map f coll) is slower than
a transducer,
How is this done, I searched the source, but there was so much indirection
I can't find it. I'm familiar with how Haskell does rfold vs lfold, but one
of those does create allocations, they may be in the form of closures, but
they are allocations none the less. So does fold use iterators or somethi
Yeah, I have to call you out on this one Dragan. I ran the following code:
(ns fold-test
(:require [uncomplicate.fluokitten.core :refer [foldmap]]))
(defn fa [& args]
(println "fa " args)
1)
(defn fb [& args]
(println "fb " args)
1)
(defn test-fold []
(foldmap fa nil fb [1 2 3] [4 5 6]))
(test
Francis is correct, and I want to make a point about something he said. If
you are mapping over two collections at once, you will either be using Java
iterators, or you will be creating lazy sequences when you walk over the
input collections. Sure, how many lazy sequences are create here and there
group-by is slightly different in that it wraps every value in a vector,
and those vectors will contain multiple items if there is an id collision.
So that may be what the OP wanted, but it also is a change in semantics.
I we can simplify the code a bit to (zipmap (map :id data) data) which is
abo
>> When using clojurescript, adding async really increases the load time.
That's one place where you might want to use agents when you can.
But Clojurescript doesn't support agents.
On Thu, Oct 13, 2016 at 7:16 PM, William la Forge
wrote:
> On Thursday, October 13, 2016 at 3:38:16 PM UTC-4, lar
ed to a mutable reference without having to import core.async.
On Thu, Oct 13, 2016 at 7:28 PM, Timothy Baldridge
wrote:
> >> When using clojurescript, adding async really increases the load time.
> That's one place where you might want to use agents when you can.
>
> But
Yeah, I used to do that, but once core.async came out I started to desire
the back pressure aspects of channels. I don't think I've used agents for
logging since. You always run the risk of something backing up the queue of
the agent and causing your thread to crash when it runs out of memory.
On
I highly recommend this talk on Spec by Stu Halloway. Spec is a new feature
coming in Clojure 1.9, and this talk goes into the pros/cons of static
typing and tests and shows how there can be a better way.
https://www.youtube.com/watch?v=VNTQ-M_uSo8
On Sun, Oct 16, 2016 at 5:58 PM, Alan Thompson
>> but I might end up needing users with e.g. genuine Norwegian addresses.
I think that's an interesting point, and it's a problem I've encountered
several times myself. However I think it can be solved several ways.
1) If your validation function "norwegian-addr?" is a simple predicate,
then the
I use comp all the time, not only for transducers, but also for digging
into maps:
(map (comp first :pets)
[{:pets [:fluffy]}
{:pets [:spot]}])
=> (:fluffy, :spot)
Partial is also handy when used with a lot of sequence functions
(->> [1 2 3 4 5]
(filter (partial > 3)))
Sure I co
That was fixed in a patch that added special cases to partial when used
with smaller numbers of arguments. It was never much slower, but it should
be just as fast as hand made functions now.
http://dev.clojure.org/jira/browse/CLJ-1430
On Fri, Oct 28, 2016 at 5:35 AM, Bobby Eickhoff wrote:
> I a
Specs are for checking the shape of data. "deferreds" are not data, they
are opaque objects. So in short the answer is "you can't" or more
correctly: you may be able to, but shouldn't.
One of the problems with even trying to spec something like IDeref is that
the very act of observing it may have
I would stop the specing at the boundary of a IDeref. For example you can
say "this function takes a integer and returns a instance of IDeref".
Digging into the details of that object isn't something I would try to
spec. Beyond that I would probably try to write functions that take data
and retur
+1 for JavaParser. I used it recently on a project, and it *just works*.
On Thu, Nov 3, 2016 at 8:39 AM, Vitaly Peressada
wrote:
> Thanks, Alex. Will give javaparser a try.
>
>
> On Thursday, 3 November 2016 14:06:31 UTC, Alex Miller wrote:
>>
>> While writing a parser for Java with instaparse w
clojure.core/print-method is a multi method that handles the printing of
objects. You can override or implement the print method by:
(defmethod print-method my.class.Foo
[^my.class.Foo instance ^Writer w]
(.write w ...))
I do that to provide custom printing for deftypes, but you can easil
It's because the value of the + is captured when the partial is created (or
when the var is implicitly derefed). The value of the var is implicitly
captured (via deref) at the point where it appears in the form.
It's a bit of a complex topic, but this blog post I wrote a few months ago
may help a
The question of how vars work comes up enough that I recently wrote a blog
post on the subject. Maybe it will be useful to you.
http://blog.cognitect.com/blog/2016/9/15/works-on-my-machine-understanding-var-bindings-and-roots
Timothy
On Fri, Dec 2, 2016 at 2:44 PM Paul Gowder wrote:
> Thanks Bo
Let bindings map pretty much directly to Java style local variables:
(let [x 42]
(let [x 3]
(+ x 3))
Becomes something like this when compiled to byte code:
x_1 = 42
x_2 = 3
return x_2 +3
So let bindings with the same names are kept separate via modifying the
stored name in the byte code,
I just released the first official version of Odin (
https://github.com/halgari/odin). Odin is a declarative, extensible query
DSL for Clojure that leverages transducers to provide a high amount of
generality while still maintaining acceptable performance.
One of the biggest features of Odin is it
I'm not aware of such a construct, but it's trivial enough to write
something like this using `range` or perhaps write a function that will
yield a lazy seq:
(defn inf-list
([x y]
(cons x (cons y (inf-list x y 2
([x y c]
(cons (+ x (* c (- y x)))
(lazy-seq (inf-list x y (inc
Ah! I knew there was a way to do it via iterate, but it was 9:30pm at the
time and I was tired. Nice example though.
On Tue, Dec 13, 2016 at 10:03 PM, Ghadi Shayban wrote:
> A common way to do it in Clojure is `iterate`, no macros necessary. As of
> Clojure 1.7 this doesn't allocate a list at al
did a tutorial video on into you may also find interesting:
https://www.youtube.com/watch?v=5_eRZRIuqiY
Timothy Baldridge
On Sat, Dec 17, 2016 at 11:22 AM, larry google groups <
lawrencecloj...@gmail.com> wrote:
> I was trying to combine 2 maps into a new map, as you can see here. I
> pr
This is one of those odd questions where the answer of what "could" happen
and what "will most likely happen" are completely different. There is no
reason why `distinct` should reorder or which item will be preserved.
However there's really only one logical way to implement this (the way it's
curre
I've been programming Clojure for something like 6 years now, and yes, I've
hit the cyclic dependency error a few times. How did I solve it? Each time
via abstraction, and parameterization of functions. Most of the time this
means writing a "interfaces.clj" file that contains all my defprotocols an
exity addition to the compiler and
the redefinition of compilation units. The declare method seems like the
cleaner route.
On Fri, Dec 30, 2016 at 5:45 PM, Mark Engelberg
wrote:
> On Fri, Dec 30, 2016 at 4:38 PM, Timothy Baldridge
> wrote:
>
>>
>> So the layout looks like
x27;t designed to do what Potemkin tries to make
it do when it comes to vars. I really recommend against using the library.
On Sat, Dec 31, 2016 at 7:32 AM, squeegee wrote:
>
>
> On Friday, December 30, 2016 at 8:59:46 PM UTC-5, puzzler wrote:
>>
>> On Fri, Dec 30, 2016 at
The check is made at read-time, by the time to form gets to the compiler
it's already a hash-map and one of your forms will have been dropped. So
the decision was made to make the reader check. One way you could solve
your problem here is with tagged literals, as the literal would be created,
and t
Instead of looking at the state as a ref with a vector in it, think of it
as a vector of refs. That then allows multiple refs to be modified at once
without stepping on other unrelated refs.
On Mon, Jan 30, 2017 at 5:26 PM, Brian Craft wrote:
> I'm experimenting with ref, dosync, and alter to ru
As you mentioned, what you're battling right now is contention. In your
existing code the threads always conflict. No matter what, only one
thread's update can succeed, the others will fail and have to re-run. With
the refs-in-a-vector approach as long as two threads don't touch the same
cell (ref)
Please define "scales badly" what are you measuring to reach that
conclusion?
On Mon, Jan 30, 2017 at 7:38 PM, Brian Craft wrote:
> ans: this scales badly.
>
> There must be a way in clojure to operate on large data structures in
> parallel, no?
>
>
> On Monday, January 30, 2017 at 6:03:39 PM UT
We really need more information if you're expecting us to offer any help at
all. How many items are you updating, what are your update patterns, what
is in these refs, are do you need to modify more than one ref in a single
"transaction". All this impacts the correct approach. But with such a lack
A good editor should auto-complete your keywords for you. Since using this
feature in Cursive (same sort of thing is available in other editors) the
cases where I've mis-spelled a keyword have dropped dramatically. It's a
lot harder to mis-spell a keyword when you can just do: :egg/th and
the rest
While I've looked at Specter several times, I have yet to use it in a
project for many of the same reasons that Rangel mentioned. Either my data
is shallow enough that clojure.core functions work just fine, or my data is
complex enough that I need cross-entity joins, and arbitrary clojure logic.
In
That's a pretty old version of ClojureScript. Try upgrading to the latest.
Timothy
On Sun, Feb 19, 2017 at 2:17 PM, William la Forge
wrote:
> I'll note that when I add a second entry to the map, everything is fine:
>>
>>
> {:fix nil :local/contacts-capability contacts-capability}
>
> --
> You
What are the JVM memory settings set at? And how much physical memory does
the box have?
Timothy
--
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 modera
idier wrote:
> How does this compare to Specter?
>
>
> On Thursday, 23 February 2017 13:34:16 UTC-8, Alan Thompson wrote:
>
> Just came across this - it looks very cool!
> Alan
>
> On Sat, Dec 10, 2016 at 7:14 AM, Timothy Baldridge
> wrote:
>
> I just re
>> Specter is not a DSL.
Specter implements a set of terms (navigators) specific to the library that
are interpreted by the library (the transform function) to accomplish some
task for a specific domain (manipulating data structures). In the same way,
`update-in` is a DSL. Both Specter and `updat
Yes, that should work fine, do your tests confirm otherwise? Also if you're
not doing a recur there's no reason to use `go-loop` you can just use `go`.
On Wed, Mar 15, 2017 at 4:44 PM, Eran Levi wrote:
> Hi,
> can I bind variables, same as I do for threads, for go routines, to be
> local only fo
t in case you expect to write cross-platform code with dynamic bindings.
>
>
> Am 16.03.2017 um 01:01 schrieb Timothy Baldridge:
> > Yes, that should work fine, do your tests confirm otherwise? Also if
> > you're not doing a recur there's no reason to use `go-loop` you
The power offered by spec is probably better compared against dependent
type systems like Idris. True static type systems run analysis at
compile-time, but spec allows you to perform very complex checks because
you have the power of full blown language.
For example, with spec you can write a funct
The volatile! is needed for the case where a transducer is only used by one
thread at a time, but the thread executing the transducer may change from
one call to the next. This happens fairly often with core.async. If you
used a non-atomic, non-volatile mutable field, the JVM would be free to
perfo
Transducers were never designed to work in parallel context. So I'd define
any behavior that arises from using the same transducers in multiple
threads *at the same time*, as undefined behavior.
On Sun, Apr 9, 2017 at 4:39 PM, Alexander Gunnarson <
alexandergunnar...@gmail.com> wrote:
> I should
In your example transducer, the problem is with the `result` parameter. The
specification of transducers is that the result of `(rf result x)` should
be fed into the next call to `rf`. In other words: (-> result (rf x1) (rf
x2) (rf x3))` trying to do that in a parallel context is next to
impossible
You're reloading your namespaces from a non-repl thread, concurrently while
editing code in the repl. I don't think this is use case is supported by
tools.namespace.
On Mon, Apr 10, 2017 at 2:56 PM, Didier wrote:
> Hum, not sure why you would do this, but I'm guessing refresh goes in an
> infini
Cursive has had a really good debugger for a long time. I don't use it
much, but when I need it it *just works*.
Timothy
On Tue, Apr 11, 2017 at 7:37 PM, Didier wrote:
> A good debugger is indeed extremely useful for Clojure - I use one every
>> day :-)
>>
>
> Am I living in the past? I thought
I've gotten really fast diffing in Clojure by using the following concepts:
1) If you can sometimes make parts of A and B be identical, then your
differ can skip checking those parts by doing a (identical? A B), this
improves performance
2) Take a side effecting approach, pass into the differ a fu
Can Specter walk two sequences in lock-step? That's what's needed for a
good diffing engine, and that seems quite far removed from Specter's
design.
On Fri, Apr 21, 2017 at 11:22 PM, Mars0i wrote:
> This might be a job for which Specter is particularly useful. You might
> have to dive pretty de
This is a somewhat weird answer to a overcomplicated problem. As mentioned,
the data is a map to start with, and maps are functions so treating the
maps as data is probably the best approach. And like Dragan, I'm unsure why
this example doesn't use `(data :able)`.
When I do need to generate functi
Thu, May 11, 2017 at 9:18 AM, Alan Thompson wrote:
>
>> I like the idea of using `eval` and `memoize`. I'll have to keep that
>> in mind.
>> Alan
>>
>> On Thu, May 11, 2017 at 7:58 AM, Timothy Baldridge
>> wrote:
>>
>>> This is a som
Sure, you can contact me at the address used in this reply :)
Timothy Baldridge
On Fri, May 12, 2017 at 11:19 AM, Erlis Vidal wrote:
> Is there a way I can contact Tim Baldridge for questions about the
> subscription?
>
> Thanks!
>
> On Sun, Jan 31, 2016 at 12:40 PM, Mars0i
Using a protocol is probably the optimal choice, since it also opens up the
dispatch allowing for extension without modifying exiting code. Downstream
users of your library can add extensions to your code without having to
create a patch.
On Sat, May 13, 2017 at 7:43 AM, Alex Miller wrote:
> O
el Spolsky, creator of StackOverflow, has often
>> encouraged people to post both a question and its answer on the site:
>> https://stackoverflow.blog/2011/07/01/its-ok-to-ask-and-ans
>> wer-your-own-questions In fact, they even have a special button for
>> this purpo
-to-generate-functions>
> was incomplete for the new question and I was trying to fill in the missing
> parts.
>
>
>
> On Sat, May 13, 2017 at 3:40 PM, Timothy Baldridge
> wrote:
>
>> Sorry, but this use of intern is a pointless. What does intern give you
&g
It's not working for me. I'm in the US, connecting via Chrome.
On Thu, May 18, 2017 at 2:40 PM, Dragan Djuric wrote:
> It works for me as always.
>
> On Thursday, May 18, 2017 at 10:34:33 PM UTC+2, Gregg Reynolds wrote:
>>
>>
>>
>> On May 18, 2017 3:32 PM, "Jason Stewart" wrote:
>>
>> I'm exper
You know, there's this awesome bit of tech called IRC...someone should
check that out.
On Thu, May 18, 2017 at 3:31 PM, Gregg Reynolds wrote:
> looks like access is restored, for me at least. still, slack is making me
> a little nervous. and that's in addition to the 10K msg limit, which is a
>
Might be good to provide a quick overview of what Chestnut is. It's been a
year, so I either missed the last announcement, or have forgotten in that
time. Also I see a link that would take me to the project page.
On Mon, May 29, 2017 at 5:03 AM, Arne Brasseur
wrote:
> After almost a year I'm ple
Anonymous implies there might be some sort of auto gen going on (as there
is with anonymous functions), Irrelevant has my vote therefore. The other
characteristics are a side-effect of it being a naming convention (with no
official support by the compiler). Maybe that could be pointed out in
greate
Transducers on channels lock the channel while they are running. This is by
design. So yes, the side-effect of this means that no other operation
(puts, takes or closes) can succeed while the transducer is running.
So the short answer is: If you have code that can take awhile to run, don't
put it
A big reason they have to be run inside the lock is that they have to
operate in the context of the channel.
For example:
(chan (take 10))
Firstly we must recognize that transducer instances are *not* thread safe.
They should only ever be executed by one thread at a time. But channels
allow mult
Yes, calls to ! could be written with continuations, or call/cc,
but they are not implemented that way. Instead the code inside the body of
the `go` macro is rewritten into a statemachine. This sort of rewrite is a
lot like the rewrites that C# does for yield, and Cython does much of the
same sort
I recommend starting with this excellent talk, if you haven't already seen
it: https://www.youtube.com/watch?v=qDNPQo9UmJA
Aside from that I recommend taking a look at Pedestal. It's async and
streaming capabilities are some of the most advanced you can find in the
Clojure space, and its protocols
Are the docs out of sync? Because the README talks about immutable APIs and
seq to array conversions, but the library itself is just a renaming wrapper
mapping stuff like GL/GLVertex to gl-vertex. I don't understand how that
makes the API "modern". Unless that part isn't written yet.
Timothy
On F
The answer lies in the term "REPL". You start by reading the string, you
can use `clojure.core/read-string` for this case. This will convert your
string into Clojure data:
"(+ 1 (* 2 2))" => (+ 1 (* 2 2))
That's the "R" part of "REPL", read.
Next step is "E" for "eval". We need to evaluate the s
Once a transducer is completed it should never be called again. This is why
transduce takes both a transducer and a reducing function and combines them
internally. The thought here is that it will be harder to shoot yourself in
the foot by reusing a stateful reducing function if you don't have to
c
If we think about what we're doing here is a stateful filter, then maybe we
could leverage a few more core Clojure functions:
(defn distinct-by [f coll]
(let [seen (atom #{})]
(filter (fn [itm]
(let [m (f itm)]
(when-not (@seen m)
(swap!
It came up today in the Clojurian's Slack mailing list, and it sounds like
the gist is that the papers did a bit of a apples-to-oranges comparison by
using a different hashing algorithm when comparing CHAMP to Clojure's
hashmaps. Once this difference is rectified the performance improvements
are mu
Relevant discussion:
https://groups.google.com/d/msg/clojure/10dbF7w2IQo/ec37TzP5AQAJ
On Fri, Aug 18, 2017 at 10:53 AM, Rafik NACCACHE
wrote:
> Hey guys,
>
> Seems to be a long while we are waiting for 1.9
>
> I kinda feel that core.spec seems to always need more polishing so that's
> why it's s
I find the arguments for variants very unconvincing. As you stated with
specs and s/keys you can spec the same sort of data, and in a way that's
much more open-ended.
For example:
[:person {:name "Tim" :grade "B"}]
What is the type of this data? We would probably guess a :person. But what
if we
ever want variants.
They complicate the code for really no benefit. The complexity they are
attempting to solve can be solved by simply using maps and records instead
of bare values.
On Tue, Aug 22, 2017 at 5:43 PM, James Reeves wrote:
> On 22 August 2017 at 23:04, Timothy Baldridge
>
I think the article is a bit misleading. Variants were never that popular
in Clojure. Infact I've never seen them used in production code or the most
common Clojure libraries. So I'm a bit perplexed as to why the article
recommends them so strongly.
So I think the answer is, they are a fun thought
Nope, ClojureScript uses nested hash maps (try it for yourself here:
http://vps124502.vps.ovh.ca/rage/resources/public/). As does tools.analyer.
Instaparse and Hiccup use a variant of variants, but funny enough the first
thing I ever do when writing code with instaparse is write a converter from
it
) FOR-SEAN -- (904) 302-SEAN
> An Architect's View -- http://corfield.org/
>
> "If you're not annoying somebody, you're not really alive."
> -- Margaret Atwood
>
>
>
> *From: *Timothy Baldridge
> *Sent: *Tuesday, August 22, 2017 6:00 PM
> *To: *c
draw :4s nil]. You can mistake the order: [:event/draw :player1
> :4s].
>
> I think to represent the type of a single element, I agree with you, but
> if you've got a compound type, at first glance, they'd appear less
> practical and more error prone to me. So your second exa
But Datomic has E in [e a v] which links multiple [a v] pairs into an
entity...which is basically a map. So I don't think that applies here.
GET /example HTTP/1.1
Host: www.example.com
[:request/method :get]
[:request/uri "/example"]
[:request/protocol "HTTP/1.1"]
[:request/header ["h
p.
On Tue, Aug 22, 2017 at 9:43 PM, James Reeves wrote:
> On 23 August 2017 at 03:58, Timothy Baldridge
> wrote:
>
>> Put let's take that and look at it under a engineering lens a bit:
>>
>> >> For example, a series of events that represent a player's m
"My codebase (mix of CLJ, CLJS and CLJS) is about fifty thousand lines of
code, and compilation times are starting to interfere with my workflow
happiness. In addition, Chrome Devtools is becoming somewhat sluggish due
to the high number of separate namespaces loaded through Figwheel."
That's not
>> they're a little nicer to type and read
And that's where I have to disagree. The problem with most of these options
is they complect ordering with meaning.
[:image/file "/images/image" :jpeg]
Here I have no idea what these values mean. I have to have out-of-band
information about what offset
>> https://github.com/arrdem/guten-tag
The name alone deserves a +1. :D
On Mon, Aug 28, 2017 at 2:53 PM, Reid McKenzie wrote:
> FWIW I wrote a library around defining tagged map types
> https://github.com/arrdem/guten-tag and used it heavily in the Grimoire
> implementation almost entirely to
To add to what Alex said, look at this trace:
https://gist.github.com/anonymous/65049ffdd37d43df8f23630928e8fed0#file-thread-dump-out-L1337-L1372
Here we see a go block calling mapcat, and inside the inner map something
is calling >!!. As Alex mentioned this can be a source of deadlocks. No
code c
Think about what you're asking:
"Hey, is identity a boolean true value?"
"No, it is a function, not a boolean"
"Is, identity a boolean false value?"
"No, it's a function, not a boolean"
Makes plenty sense to me.
On Fri, Sep 1, 2017 at 10:06 PM, Rostislav Svoboda <
rostislav.svob...@gmail.c
Every thread created on the JVM takes about 2MB of memory. Multiply that by
that number of threads, and I'm surprised your memory usage is that low.
But the futures thread pool will also re-use previously created threads for
new futures. In order to optimize this, a certain number of threads will b
I don't think you can catch an Object on the JVM can you? What happens if
you catch Throwable?
On Sun, Oct 8, 2017 at 9:43 PM, wrote:
> So, for instance, this says that 10 documents were retried:
>
> {"message" {:num-slabs 1, :num-active-slabs 1, :enqueued 389, :retried 10,
> :completed 378, :in
What REPL are you using? A rather nasty side-effect of NRepl is that it
tends to send messages from non-main-threads to weird places.
On Sun, Oct 8, 2017 at 10:29 PM, wrote:
> I just re-wrote much of the code to run on the main thread. And so now I
> can see the error message (which was about a
The problem isn't the macro, it's your use of syntax quoting. `(= x y) gets
expanded at read-time into `(clojure.core/= x y)`. Not much you can do
about that. Although I'd suggest perhaps changing your code a bit to not
require macros.
deftest mostly just creates a defn with some extra metadata an
My answer to most of these questions is often "write it once, stuff it in a
function, and forget about it".
Really though I often see this as a data-modeling and naming problem. For
example, you could go and write a `(update-cells cell-list f & args)` that
wraps custom logic for finding and manipu
If you want to simply keep some messages in order, then a cat transducer
will do the trick just fine:
;; need a buffer or buffer size to get to the transducer param
(def c (chan 20 cat))
(async/onto-chan c [1])
(async/>!! c [2 3 4])
(async/close! c)
(
wrote:
> If you don't want to split at th
Best answer for that is probably the source code itself:
https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Keyword.java
On Wed, Oct 11, 2017 at 9:07 AM, wrote:
> how these keywords in clojure implemented
> could anyone anwer me ?
>
> --
> You received this message because you
To start with, IObj and its .meta method are used with clojure.core/meta to
get the metadata on an object. Since this method can be the same between
refs and immutable data, they all use the same interface.
IMeta is used with withMeta and clojure.core/with-meta to return a new
object with the give
I structure my code very explicitly. Normally the most common constructs
are put in a single file named after the library itself (not in core.clj,
do that half your files will be named core).
https://github.com/halgari/odin/blob/master/src/com/tbaldridge/odin.clj
Anything not in the API that shou
Eval gets a bad reputation from languages like JS where it's messy and a
bit of a security risk. In Clojure, there's nothing wrong with using eval
for something like this.
On Tue, Nov 7, 2017 at 11:43 PM, Nick Mudge
wrote:
> I need to dynamically reify some java interfaces based on data from a
>
201 - 300 of 834 matches
Mail list logo