Re: ANN: ClojureScript 0.0-3255 - pretty printer latest Closure Compiler / Library
Hey guys, 0.0-3264 fails for me with: clojure.lang.ExceptionInfo: failed compiling file:resources/public/js/compiled/out/cljs/core.cljs at clojure.core$ex_info.invoke (core.clj:4591) Caused by: java.lang.IllegalArgumentException: No implementation of method: :make-reader of protocol: #'clojure.java.io/IOFactory found for class: nil at clojure.core$_cache_protocol_fn.invoke (core_deftype.clj:554) 0.0-3255 seems fine. @raspasov On Saturday, May 9, 2015 at 12:33:52 PM UTC-7, David Nolen wrote: Just released 0.0-3264, it fixes a critical issue where .js files were missing from the artifacts due to the changed build. Also included are a several fixes around the :libs feature, REPLs, and stack trace mapping. David On Fri, May 8, 2015 at 3:23 PM, David Nolen dnolen...@gmail.com javascript: wrote: ClojureScript, the Clojure compiler that emits JavaScript source code. README and source code: https://github.com/clojure/clojurescript Leiningen dependency information: [org.clojure/clojurescript 0.0-3255] A big thanks goes out to Jonathan Boston and Shaun Lebron for this release. Thanks to their efforts ClojureScript now includes a full port of clojure.pprint under the cljs.pprint namespace. This was the last major namespace in need of porting to ClojureScript. The release also bumps several dependencies: Clojure 1.7.0-beta2, tools.reader 0.9.2, Closure Compiler v20150505, and Closure Library 0.0-20150505-021ed5b3. This release also fixes some regressions around async testing, docstring REPL support, arglist meta, and more. As always feedback welcome! ## 0.0-3255 ### Changes * Update Closure Library dependency * CLJS-1252: Update Closure Compiler Dependency to v20150505 * .clj - .cljc for important analysis / compilation bits * add public cljs.compiler.api namespace * CLJS-1224: cljs.repl: Memoize stack frame mapping * depend on tools.reader 0.9.2 ### Enhancements * add cljs.pprint/pp macro * CLJS-710: port clojure.pprint * CLJS-1178: Compiler does not know Math ns is not not-native * add getBasis methods to deftype and defrecord ctors a la Clojure JVM * support ^long and ^double type hints ### Fixes * fix cljs-1198 async testing regression * CLJS-1254: Update REPL browser agent detection CLJS-1253: Create/Use new Closure Library Release * CLJS-1225: Variadic function with same name as parent function gives runtime error in advanced compile mode. * CLJS-1246: Add cljs.core/record? predicate. * CLJS-1239: Make eduction variadic. * CLJS-1244: tagged-literal precondition check missing wrapping vector * CLJS-1243: Add TaggedLiteral type related fns * CLJS-1240: Add cljs.core/var? * CLJS-1214: :arglists meta has needless quoting CLJS-1232: bad arglists for doc, regression * CLJS-1212: Error in set ctor for 8-entry map literal * CLJS-1218: Syntax quoting an alias created with :require-macros throws ClassCastException * CLJS-1213: cljs.analyzer incorrectly marks all defs as tests when eliding test metadata * CLJS-742: Compilation with :output-file option set fails -- 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 with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Have a look at pretial and apply-to
I've uploaded a proposal / working code in literate programming style to github: https://gist.github.com/bendlas/0722a35ab274d659c507 I'd be delighted if you took the time to read it through, maybe try it out and tell me what you think of it. This is not strictly a proposal for core just now, and I know how wary the community is with such things, but this fits so well, I just had to give it a chance to take a hold in the language. For an example, look at the benchmarking code at the end of the gist. So if this passes by someone at cognitect, please add a comment on whether you'd consider these operations for inclusion. thanks -- 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 with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Opinion on take-while for stateful transducers
Hi *, I first needed a transducer that stopped when the first non-distinct item is seen. Thus changing distinct slightly to: (defn take-while-distinct Just like clojure.core/distinct but terminating as soon as one duplicate element is seen. [] (fn [rf] (let [seen (volatile! #{})] (fn ([] (rf)) ;; init arity ([result] (rf result)) ;; completion arity ([result input];; reduction arity (if (contains? @seen input) (reduced result);; !! difference to distinct (do (vswap! seen conj input) (rf result input I figured this can be generalized to also work with dedup and possibly other stateful transducers (after all if they aren't stateful then I can just use take-while) so that I can do something like this: (into [] (take-while-xf (distinct)) [1 2 3,,, 1 4 32 42]) (into [] (take-while-xf (dedupe)) [1 2 3 1 4 32,,, 32 42 292 23]) The comma marks where the transducers stops (after consuming one more input). I came up with this (non-working) implementation: (defn take-while-xf-buggy Takes a transducer and returns a transducer that will immediately finish (ie call (reduced)) when the transducer did not call the reducing function and just returned the result. Only really useful with stateful transducers. [xf] (fn [rf] (let [td (xf rf)] (fn ([] (rf)) ([result] (rf result)) ([result input] (let [x (td result input)] (if (= x result) (reduced x) x))) This doesn't work. I believe because the reducing function bashes the transient in place and the comparison always yields true and thus stops after one input element. I then ended up with something hacky that does seem to work however: (defn take-while-xf Takes a transducer and returns a transducer that will immediately finish (ie call (reduced)) when the transducer did not call the reducing function and just returned the result. Only really useful with stateful transducers. Otherwise you'd use take-while. [xf] (fn [rf] (let [td (xf (fn ;; custom reducing function to avoid calls to rf ([] []) ([x] [x]) ([r i] i)))] (fn ([] (rf)) ([result] (rf result)) ([result input] (let [x (td result input)] (if (= x input) (rf result input) (reduced result ;; or equivalently:(defn take-while-xf' [xf] (let [td (xf (fn ([] []) ([x] x) ([r i] i)))] (take-while #(= % (td nil %) Is this a good idea and rock solid implementation? I'm a little worried this breaks down for corner cases (and this would be no fun to debug). Or am abusing transducers here? What would be a good way to implement this? Possibly even further up the chain? Thanks for reading, Andy -- 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 with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: ANN: ClojureScript 0.0-3255 - pretty printer latest Closure Compiler / Library
Sounds like you need to a lein clean? That's normally the error you see if you have old versions of compiled files laying around... On Sat, May 9, 2015 at 9:22 PM, Rangel Spasov raspa...@gmail.com wrote: Hey guys, 0.0-3264 fails for me with: clojure.lang.ExceptionInfo: failed compiling file:resources/public/js/compiled/out/cljs/core.cljs at clojure.core$ex_info.invoke (core.clj:4591) Caused by: java.lang.IllegalArgumentException: No implementation of method: :make-reader of protocol: #'clojure.java.io/IOFactory found for class: nil at clojure.core$_cache_protocol_fn.invoke (core_deftype.clj:554) 0.0-3255 seems fine. @raspasov On Saturday, May 9, 2015 at 12:33:52 PM UTC-7, David Nolen wrote: Just released 0.0-3264, it fixes a critical issue where .js files were missing from the artifacts due to the changed build. Also included are a several fixes around the :libs feature, REPLs, and stack trace mapping. David On Fri, May 8, 2015 at 3:23 PM, David Nolen dnolen...@gmail.com wrote: ClojureScript, the Clojure compiler that emits JavaScript source code. README and source code: https://github.com/clojure/clojurescript Leiningen dependency information: [org.clojure/clojurescript 0.0-3255] A big thanks goes out to Jonathan Boston and Shaun Lebron for this release. Thanks to their efforts ClojureScript now includes a full port of clojure.pprint under the cljs.pprint namespace. This was the last major namespace in need of porting to ClojureScript. The release also bumps several dependencies: Clojure 1.7.0-beta2, tools.reader 0.9.2, Closure Compiler v20150505, and Closure Library 0.0-20150505-021ed5b3. This release also fixes some regressions around async testing, docstring REPL support, arglist meta, and more. As always feedback welcome! ## 0.0-3255 ### Changes * Update Closure Library dependency * CLJS-1252: Update Closure Compiler Dependency to v20150505 * .clj - .cljc for important analysis / compilation bits * add public cljs.compiler.api namespace * CLJS-1224: cljs.repl: Memoize stack frame mapping * depend on tools.reader 0.9.2 ### Enhancements * add cljs.pprint/pp macro * CLJS-710: port clojure.pprint * CLJS-1178: Compiler does not know Math ns is not not-native * add getBasis methods to deftype and defrecord ctors a la Clojure JVM * support ^long and ^double type hints ### Fixes * fix cljs-1198 async testing regression * CLJS-1254: Update REPL browser agent detection CLJS-1253: Create/Use new Closure Library Release * CLJS-1225: Variadic function with same name as parent function gives runtime error in advanced compile mode. * CLJS-1246: Add cljs.core/record? predicate. * CLJS-1239: Make eduction variadic. * CLJS-1244: tagged-literal precondition check missing wrapping vector * CLJS-1243: Add TaggedLiteral type related fns * CLJS-1240: Add cljs.core/var? * CLJS-1214: :arglists meta has needless quoting CLJS-1232: bad arglists for doc, regression * CLJS-1212: Error in set ctor for 8-entry map literal * CLJS-1218: Syntax quoting an alias created with :require-macros throws ClassCastException * CLJS-1213: cljs.analyzer incorrectly marks all defs as tests when eliding test metadata * CLJS-742: Compilation with :output-file option set fails -- 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 with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- Sean A Corfield -- (904) 302-SEAN An Architect's View -- http://corfield.org/ World Singles, LLC. -- http://worldsingles.com/ Perfection is the enemy of the good. -- Gustave Flaubert, French realist novelist (1821-1880) -- 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 with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: ClojureCLR and nrepl ?
How simple a fix is it I may be interested in giving it a shot. On Wednesday, May 6, 2015 at 4:33:27 PM UTC-10, dmiller wrote: Not completely functional and not thoroughly tested. Several tests still fail -- the most important one being interrupting an eval. (I know what the fix is, but haven't had the time.) On Wednesday, May 6, 2015 at 3:58:34 PM UTC-5, Alex Miller wrote: https://github.com/clojure/clr.tools.nrepl On Wednesday, May 6, 2015 at 3:39:18 PM UTC-5, rogergl wrote: Does ClojureCLR provide an nrepl implementation that would allow vim.fireplace to connect to his session ? Regards Roger -- 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 with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: how goeth the STM experiment?
Hi! Personally, I do not have the opportunity to use refs, but atoms and agens I have used it in different ways I have used agents for logging system, thanks to its guarantees of execution functions in a serial way. This allows heavy multithreading applications put logs to stdout (or any other destination) and have as result a consistent log. An other thing when I have used with agents is implement an async interface for jdbc like applications. I have a little explication on how it is done here: http://funcool.github.io/suricatta/latest/#_async_interface I hope you find it useful. Cheers. Andrey 2015-05-09 3:56 GMT+02:00 piastkra...@gmail.com: This seems to be true: I would have to say that the biggest surprise is how little they're needed in Clojure. Run this search on Google: agent send clojure site:github.com The first 5 pages point me to examples from several years ago, or error reports, or unit tests. Nothing substantial or recent. I think it is interesting how many of the results are blog posts or gists -- people talk about agents much more then they actually use them. Still, there are some examples: https://github.com/aphyr/riemann/blob/302cff942f308771b1d8d837cdf9ce2c9090daed/src/riemann/pool.clj (defmacro with-pool Evaluates body in a try expression with a symbol 'thingy claimed from the given pool, with specified claim timeout. Releases thingy at the end of the body, or if an exception is thrown, invalidates them and rethrows. Example: ; With client, taken from connection-pool, waiting 5 seconds to claim, send ; client a message. (with-pool [client connection-pool 5] (send client a-message)) [[thingy pool timeout] body] ; Destructuring bind could change nil to a, say, vector, and cause ; unbalanced claim/release. `(let [thingy# (claim ~pool ~timeout) ~thingy thingy#] (try (let [res# (do ~@body)] (release ~pool thingy#) res#) (catch Throwable t# (invalidate ~pool thingy#) (throw t#) And: https://github.com/clojure/java.jmx/blob/master/src/main/clojure/clojure/java/jmx.clj (deftype Bean [state-ref] DynamicMBean (getMBeanInfo [_] (MBeanInfo. (.. _ getClass getName) ; class name Clojure Dynamic MBean ; description ( map-attribute-infos @state-ref) ; attributes nil ; constructors nil ; operations nil)) (getAttribute [_ attr] (@state-ref (keyword attr))) ( getAttributes [_ attrs] (let [result (AttributeList.)] (doseq [attr attrs] (.add result (Attribute. attr (.getAttribute _ attr result)) ( setAttribute [_ attr] (let [attr-name (.getName attr) attr-value ( .getValue attr) state-update {(keyword attr-name) attr-value}] (condp = ( type state-ref) clojure.lang.Agent (await (send state-ref (fn [state state-update] (merge state state-update)) state-update)) clojure.lang.Atom (swap! state-ref merge state-update) clojure.lang.Ref (dosync (ref-set state-ref (merge @state-ref state-update)) (setAttributes [_ attrs] ( let [attr-names (map (fn [attr] (.setAttribute _ attr) (.getName attr)) attrs)] (.getAttributes _ (into-array attr-names) I would love to see some other examples. On Wednesday, May 6, 2015 at 9:49:47 PM UTC-4, Surgo wrote: I'm not saying this is everyone's experience or anything, but at times I have at times considered some deeper STM-work with agents but I could not seem to penetrate the documentation at the time. I do not know if it's different now -- Morgon On Wednesday, May 6, 2015 at 5:38:08 PM UTC-4, James Reeves wrote: On 6 May 2015 at 21:58, Alex Miller al...@puredanger.com wrote: I would have to say that the biggest surprise is how little they're needed in Clojure. The combination of immutable data, functions to update complex data structures, and fast pure function updates with atoms actually satisfies a large percentage of real use cases. I'll echo this. I've been using Clojure for years, and I can't recall ever needing refs (or agents for that matter). - James -- 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 with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- Andrey Antukh - Андрей Антух - andrei.anto...@kaleidos.net / n...@niwi.be http://www.niwi.be http://www.niwi.be/page/about/ https://github.com/niwibe -- 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
Re: [ANN] kibit-helper.el 0.1.1 on melpa.org
Cool package! -- 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 with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [ANN] Bocko 0.2.0
Yeah I agree. I misremembered them from 33 years ago as being HLINE and VLINE and corrected them when I looked them up. :) By the way, it is available for ClojureScript / iOS now: https://github.com/mfikes/bocko-ios (I have to say, CLJC rocks!) - Mike On May 8, 2015, at 10:16 PM, David Sargeant da...@dsargeant.com wrote: I guess HLIN and VLIN have a historical significance. Still kind of confusing, but I understand now how you arrived at those names. -- 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 with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- 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 with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: ANN: ClojureScript 0.0-3255 - pretty printer latest Closure Compiler / Library
Just released 0.0-3264, it fixes a critical issue where .js files were missing from the artifacts due to the changed build. Also included are a several fixes around the :libs feature, REPLs, and stack trace mapping. David On Fri, May 8, 2015 at 3:23 PM, David Nolen dnolen.li...@gmail.com wrote: ClojureScript, the Clojure compiler that emits JavaScript source code. README and source code: https://github.com/clojure/clojurescript Leiningen dependency information: [org.clojure/clojurescript 0.0-3255] A big thanks goes out to Jonathan Boston and Shaun Lebron for this release. Thanks to their efforts ClojureScript now includes a full port of clojure.pprint under the cljs.pprint namespace. This was the last major namespace in need of porting to ClojureScript. The release also bumps several dependencies: Clojure 1.7.0-beta2, tools.reader 0.9.2, Closure Compiler v20150505, and Closure Library 0.0-20150505-021ed5b3. This release also fixes some regressions around async testing, docstring REPL support, arglist meta, and more. As always feedback welcome! ## 0.0-3255 ### Changes * Update Closure Library dependency * CLJS-1252: Update Closure Compiler Dependency to v20150505 * .clj - .cljc for important analysis / compilation bits * add public cljs.compiler.api namespace * CLJS-1224: cljs.repl: Memoize stack frame mapping * depend on tools.reader 0.9.2 ### Enhancements * add cljs.pprint/pp macro * CLJS-710: port clojure.pprint * CLJS-1178: Compiler does not know Math ns is not not-native * add getBasis methods to deftype and defrecord ctors a la Clojure JVM * support ^long and ^double type hints ### Fixes * fix cljs-1198 async testing regression * CLJS-1254: Update REPL browser agent detection CLJS-1253: Create/Use new Closure Library Release * CLJS-1225: Variadic function with same name as parent function gives runtime error in advanced compile mode. * CLJS-1246: Add cljs.core/record? predicate. * CLJS-1239: Make eduction variadic. * CLJS-1244: tagged-literal precondition check missing wrapping vector * CLJS-1243: Add TaggedLiteral type related fns * CLJS-1240: Add cljs.core/var? * CLJS-1214: :arglists meta has needless quoting CLJS-1232: bad arglists for doc, regression * CLJS-1212: Error in set ctor for 8-entry map literal * CLJS-1218: Syntax quoting an alias created with :require-macros throws ClassCastException * CLJS-1213: cljs.analyzer incorrectly marks all defs as tests when eliding test metadata * CLJS-742: Compilation with :output-file option set fails -- 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 with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: CLJ-703 - 10x compilation time decrease after applying one-line patch, no downsides.
Luc Prefontaine lprefonta...@softaddicts.ca writes: There's a better 'fix'. Run your builds on SSDs or on a memory based file system. Performance problems are solved best by throwing more hardware at them. Seriously?! No, I completely agree with Bozhidar in that regular bugfix releases would be a good thing. Clojure releases already have a minor version, so we might as well use it. Bye, Tassilo -- 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 with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[ANN] Shrubbery 0.2.0, a stubbing, spying, and mocking library for Clojure protocols
This looks neat Brian! People who find this useful may also like a similar lib I wrote that provides mocking tools at a single function level: https://github.com/glenjamin/q -- 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 with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.