[ANN] data-scope - tools for interactively inspecting and visualizing data

2016-09-24 Thread James Sofra
Hi all, I have written a little library inspired by Spyscope (which I use a lot) to provide tools for interactively inspecting and visualizing data. data-scope - https://github.com/jsofra/data-scope Like Spyscope, data-scope uses (abuses?) reader tags to provide a convenient mechanism for tagg

Random xxxx-init.clj files created in root of project.

2016-09-24 Thread Nathan Smutz
I have a Figwheel project that kept generating files with random names ending in -init.clj when "lein figwheel" was run. The files have code related to figwhee-sidecar and starting up the REPL. i followed some breadcrumbs ( https://github.com/emezeske/lein-cljsbuild/issues/394 ) suggesting it's

Correcting a docstring mistake in clojure.core/filter

2016-09-24 Thread Alan Thompson
Hi Alex - What is the best way to correct a mistake in the docstring for clojure.core/filter? The existing docstring is: ​​ Returns a lazy sequence of the items in coll for which (pred item) returns true. pred must be free of side-effects. Returns a transducer when no collection is provided. ​I

Re: Clojure support for Visual Studio Code

2016-09-24 Thread Michael Ball
On Tuesday, September 20, 2016 at 1:53:31 AM UTC-7, Andrey Lisin wrote: > > 2. I will investigate if it is possible to run repl from within VSCode. On > the other hand, this behavior can be unexpected for some users. I believe, > many users are willing to connect to a remote repl and need an expl

Re: Parsing namespaced XML with clojure.data.xml

2016-09-24 Thread Herwig Hochleitner
What about skipping the alphabet translation and just doing uri encoding? {http://www.w3.org/1999/xhtml}pre => :http%3A%2F%2Fwww.w3.org %2F1999%2Fxhtml/pre doesn't seem so bad and this way we would get uniformity without weird corner cases. -- You received this message because you are subscribed

Re: parallel sequence side-effect processor

2016-09-24 Thread Dragan Djuric
Just for the reference, this is the code with neanderthal, so we can get the difference when running with primitives. No native code has been used here, just pure Clojure. (def sv1 (sv v1)) (def sv2 (sv v2)) (defn side-effect-4 ^double [^double a ^double b] 1.0) (with-progress-reporting (quick

Re: parallel sequence side-effect processor

2016-09-24 Thread Dragan Djuric
Francis, The times you got also heavily depend on the actual side-effect function, which in this case is much faster when called with one arg, instead of with varargs, that fluokitten need here. If we give fluokitten a function that does not create a sequence for multiple arguments, it is much

Re: parallel sequence side-effect processor

2016-09-24 Thread Dragan Djuric
That's why I still think that in this particular case, there is no new sequence creation (by fluokitten). yes, it does call first/next but those do not require (significant) new memory or copying. They reuse the memory of the underlying vectors, if I understood that well. Or there is something else

Re: parallel sequence side-effect processor

2016-09-24 Thread Alex Miller
sequence taps into the underlying TransfomerIterator which applies a transducer while iterating across multiple iterators at the same time. sequence wraps that into a chunked sequence, but you could tap directly into TransformerIterator/createMulti without using the outer sequence. Nothing in

Re: parallel sequence side-effect processor

2016-09-24 Thread Alex Miller
Just a general note of caution. range is a highly specialized (and optimized) impl for both reducing and seq traversal. Also note that seqs on vecs are about the next-most optimized seq (because they also don't allocate or cache - rather they just pull from the vector nodes as the backing store

Re: clojure.spec question

2016-09-24 Thread Alex Miller
#{{"id" 1 "name" "john"}} is a valid spec for that On Saturday, September 24, 2016 at 9:46:55 AM UTC-5, Philos Kim wrote: > > How can I define the following spec? > > {"id" 1 "name" "john"} > > 1) The keys of a map must be the string type, not the keyword type. > > 2) The values must be fixed. Nam

Re: parallel sequence side-effect processor

2016-09-24 Thread Francis Avila
BTW I noticed that sequence got hotter and eventually became the fastest, but it took many more runs: (time (dorun (sequence (map side-effect) col1 col2))) "Elapsed time: 31.321698 msecs" => nil (time (dorun (sequence (map side-effect) col1 col2))) "Elapsed time: 15.492247 msecs" => nil (time (do

Re: parallel sequence side-effect processor

2016-09-24 Thread Francis Avila
Well, you pay a cost whenever you use seqs instead of reduce, so it/s strange to think of doseq as "as fast as possible". If it/s argument is a true collection, its IReduce is usually faster than its seq. If it is a sequence already, its IReduce is usually just using seqs anyway. Let's get some

clojure.spec question

2016-09-24 Thread Philos Kim
How can I define the following spec? {"id" 1 "name" "john"} 1) The keys of a map must be the string type, not the keyword type. 2) The values must be fixed. Namely, the value of the key "id" must be 1 and the value of the key "name" must be "john" -- You received this message because you

Re: parallel sequence side-effect processor

2016-09-24 Thread Timothy Baldridge
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

Re: Clojure support for Visual Studio Code

2016-09-24 Thread Boris V. Schmid
Just started using your plugin. Thanks. So far so good. Two questions. 1. Every time I eval something, or have an error, a bar appears on top, like this: "[Info] Successfully Compiled[Close]". They don't fade away automatically, and stack, meaning that they block the top part of the edito

Re: parallel sequence side-effect processor

2016-09-24 Thread Dragan Djuric
Now I am on the REPL, and the solution is straightforward: (foldmap op nil println [1 2 3] [4 5 6]) gives: 1 4 2 5 3 6 nil The first function is a folding function. In this case we can use op, a monoid operation. Since nil is also a monoid, everything will be folded to nil. The second part is