Re: Any alternatives for these two ugly patterns?

2013-05-25 Thread Matching Socks
(update-in obj [:attr] #(or %1 %2) something) (cond-> obj (not (:attr obj)) (assoc :attr something)) -- -- 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

Re: Function as key of a map

2013-08-07 Thread Matching Socks
Consider clojure.core/frequencies -- -- 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 unsubsc

Re: (reduce conj ["A"]) verification from source code...

2013-08-13 Thread Matching Socks
reduce's docstring says, "If coll has only 1 item, it is returned and f is not called." -- -- 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 -

Re: Dynamically creating defrecord

2015-01-17 Thread Matching Socks
Did you find something really wrong with defstruct? Occasions when the basis fields are not known to the programmer seem better met by defstruct than defrecord. And defstruct has *not* been deprecated in the API documentation. The comment "Note: Most uses of StructMaps would now be better se

Re: Is this the good way to write get-percentage

2015-02-11 Thread Matching Socks
There was also some discussion of this back in November, where Fluid Dynamics suggested higher-order functions, and tbc++, multimethods(!). The main source of complexity in get-percentage has to do with selecting what it should do. Also, both percentage computation and rounding could potentially

Re: Is this the good way to write get-percentage

2015-02-14 Thread Matching Socks
A Clojure fn is an Object, but Math's ceil method is not an Object. The Java-Interop notation for static methods, eg (Math/ceil...), papers over this difference. If you want to manipulate something like Math/ceil as a Clojure fn, you can wrap it in one such as your round-high. http://stackove

Re: [OT?] Best DB/architecture for n-gram corpus?

2015-03-07 Thread Matching Socks
A lot of guys would use Lucene. Lucene calls n-grams of words "shingles". [1] As for "architecture", here is a suggestion to use Lucene to find keys to records in your "real" database. [2] [1] https://lucidworks.com/blog/whats-a-shingle-in-lucene-parlance/ [2] https://groups.google.com/d/msg/

Re: Better/more idiomatic way to read EDNs than using java.io.PushbackReader

2015-03-07 Thread Matching Socks
Vote for "clojure.java.io/pushback-reader" http://dev.clojure.org/jira/browse/CLJ-1611 ? That enhancement suggestion contains links to some previous discussions on the subject. On Friday, March 6, 2015 at 10:18:03 PM UTC-5, Sam Raker wrote: > > I'm experimenting a little with EDN files. I've

Re: Kwargs vs explicit parameter map for APIs?

2015-03-23 Thread Matching Socks
Could you give an example demonstrating this? user> (defn a [& {x :x y :y}] (vector x y)) #'user/a user> (a :y 7 :x 3) [3 7] user> (apply a {:x 3 :y 7}) [nil nil] On Monday, March 23, 2015 at 6:13:55 AM UTC-4, puzzler wrote: > > It's been a while since I've tested this, but I believe that if

Re: [ANN] Clojure 1.7.0-alpha6 released

2015-04-01 Thread Matching Socks
Ambrose, does that "iterate" result arise from chunking? "iterate" is advertised as producing an infinite lazy sequence. While a suddenly chunking "iterate" will no doubt smoke out some cases like this, doesn't it seem that they are abuses? It's not quite spot-on to employ "take" or "take-wh

Re: (clojure.java.io/resource "no-such-file")

2015-06-03 Thread Matching Socks
The docstring is vague about the failure modes, but it drops a clue: "Use [sic] the context class loader if no loader is specified." The Javadoc for ClassLoader.getResource says it returns "null if the resource could not be found or the invoker doesn't have adequate privileges to get the resour

Re: Merge optimization question

2015-06-11 Thread Matching Socks
(keys old-map) might not be in the same order as (keys new-map). The every? check is almost right but the test will be false where new-map's value is falsey. You could use (set (keys new-map)). -- You received this message because you are subscribed to the Google Groups "Clojure" group. To po

Re: [new] GNU emacs settings for clojure ?

2015-06-14 Thread Matching Socks
The ring-server page (https://github.com/weavejester/ring-server) appears to give an example of starting the server in a REPL: (use 'ring.server.standalone) (serve your-handler) The page also mentions an option, :join? false, that you might need if you want to continue using the REPL while the

Re: ANN: org.clojure/tools.namespace "0.2.11"

2015-06-20 Thread Matching Socks
Hooray for compatibility in general. Let us always remember the less fortunate. (Ehem - users of Emacs 23 for example.) -- 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 fr

Re: roundtripping using data.xml?

2015-06-22 Thread Matching Socks
The usual XML-processing options that are open in Java, are still open in Clojure. You may use JAXP or StAX for applications that outwit clojure.xml. By the way, there is a feature enhancement page about this at http://dev.clojure.org/display/DXML/Namespaced+XML How do you feel about the propos

Re: pr-str and safe serialization

2015-06-24 Thread Matching Socks
There are currently no votes for either Jira issue! - No.1532, "pr-str captures stdout from printing side-effects of lazily evaluated expressions" - No.1611, "clojure.java.io/pushback-reader" -- You received this message because you are subscribed to the Google Groups "Clojure" group. To pos

Re: [ANN] iota - Infix operators for test assertions

2015-07-17 Thread Matching Socks
The name iota is also used by https://github.com/thebusby/iota [iota "1.1.2"] "Iota is a Clojure library for handling large text files in memory" On Friday, July 17, 2015 at 10:44:18 AM UTC-4, Malcolm Sparks wrote: > > I've been writing quite a lot of tests recently, with clojure.test > > I wr

CIDER vs Org Mode: "Symbol's definition is void: nrepl-send-string-sync" (workaround)

2014-08-10 Thread Matching Socks
Using Org Mode's org-babel-execute-src-block, I ran into "Symbol's definition is void: nrepl-send-string-sync" after installing a recent update of the cider package from Melpa. cider-eval-sync appears to be an adequate substitute for the function that vanished. The new function is in the cider

Re: Can I compare ::logging from one namespace with ::logging from another?

2014-08-10 Thread Matching Socks
By the way, Keywords in a hierarchy need not be namespaced unless they are in the global hierarchy. user> (def H (-> (make-hierarchy) (derive :klutz :person))) user> (isa? H :klutz :person) true user> (isa? H :eggplant :person) false user> (isa? H :person :klutz) false ;; just to show contras

lein.bat self-install has been broken for a month

2014-10-18 Thread Matching Socks
Last week, I ran into Leiningen issue 1702, "lein self-install/upgrade/downgrade is broken in lein.bat (2.5.0)"[1]. Here's how it happened: I emailed a Windows user a pointer to leiningen.org. I got an email back saying -- doesn't work. We worked around it by editing lein.bat in Notepad an

Re: clojure.edn won't accept clojure.java.io/reader? How to work around this and why isn't this documented anywhere?

2014-12-08 Thread Matching Socks
How many programmers does it take to change a light bulb?! http://dev.clojure.org/jira/browse/CLJ-1611 -- 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

"Multimethod dispatch based on Java classes is simply not reliable."

2014-12-13 Thread Matching Socks
"Multimethod dispatch based on Java classes is simply not reliable." That sentence comes from a comment in a git commit related to an AOT fix mentioned in a recent core.match announcement. (The workaround wa

Re: how do you name your protocols?

2014-12-27 Thread Matching Socks
In the interest of thoroughness, it should be noted here that a protocol *named "InTimeUnitProtocol" *appears in the ChangeLog referenced in the recent announcement of clj-time . -- You received this message because you are subscri

Re: Inadequate behavior of agent await?

2020-06-13 Thread Matching Socks
await takes many steps and is not synchronized, so it would be messy to guarantee how it relates to other threads. -- 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

Re: Cognitect joins Nubank!

2020-07-23 Thread Matching Socks
I think this will *compound interest* in the language! -- 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 p

Re: DEPRECATED: Libs must be qualified, change cljfmt => cljfmt/cljfmt (~/.clojure/deps.edn)

2020-08-07 Thread Matching Socks
Rich Hickey has pushed using solid domain names before, and I'm super glad to see more progress on that front. But it's unfortunate if the tools castigate the victim, not the perpetrator. Wouldn't Clojars be a better point for enforcement? Has the question been raised with Clojars? Alex's

Re: Classpath bug re Clojure 1.10.1.645 when using Figwheel.Main

2020-09-13 Thread Matching Socks
Too fragile. This reminds me of the notion of "situated programming", featured in the talk by Rich Hickey: you and your programs operate in the middle of a bizarre and changing situation. For Clojure, the Java ecosystem is part of that situation. Even if some jars do not overlap today, you

Re: Rationale behind github.com/cljctools project

2020-09-13 Thread Matching Socks
I especially like the "bigger aspirations" - https://github.com/cljctools/readme#bigger-aspirations And your summary of relevant strengths of Clojure. On Sunday, August 30, 2020 at 2:42:25 AM UTC-4, Sergei Udris wrote: > > Thought process behind and goals of the https://github.com/cljctools >

Re: Truly, we live in the garden of edn

2020-09-13 Thread Matching Socks
I can't comment on the whole crazy world of JSON, but it's a shame to think of all the coal-fired watts spent unnecessarily parsing UUIDs. If all you need is a string, there is no dishonor in letting it be a string. > I was made to wonder how the rest of the world lives! > > P.S. Also, never

Re: clojure.edn/read isn't spec compliant

2020-11-07 Thread Matching Socks
This is not either/or. There is room for an alternative, spec-enforcing, EDN reader. A drop-in replacement, as it were, for those inclined to try it. If you want speed, you use Transit anyway, right? P.S. Even better if the alternative, compliant, reader were compatibly licensed, to replace

Re: Bug (in Clojure 1.5): (fn [& xs] (pop xs)) throws ClassCastException clojure.lang.ArraySeq cannot be cast to clojure.lang.IPersistentStack

2016-06-11 Thread Matching Socks
pop isn't a sequence function. Check out the manual: http://clojure.github.io/clojure/clojure.core-api.html#clojure.core/pop You may use first/rest on any sequence, but pop does something more special(ized). -- You received this message because you are subscribed to the Google Groups "Cloju

Re: Too over complicated

2016-06-18 Thread Matching Socks
The Clojure Cheatsheet can be very helpful if you are experiencing a shock of re-entry to clojure.core after a few years of relatively finite Javadoc pages of 10 methods per class. It is fun to chuckle at Alan Perlis' aphorism about 100 functions vs 10 each for 10 classes, but when you swing o

Parsing namespaced XML with clojure.data.xml

2016-08-20 Thread Matching Socks
The future is XML-with-namespaces: POM files and whatnot. Such cases are tricky because more than one notation is possible. You need a namespace-enabled parser to figure out what the XML text really means. Luckily, a contributed project, clojure.data.xml, can read XML-with-namespaces, and in

Re: Parsing namespaced XML with clojure.data.xml

2016-08-21 Thread Matching Socks
Apps are cobbled together from sub-systems and libraries. Some of those may use clojure.data.xml, either to share their products with their client or for their internal purposes. As soon as two libraries on Clojars differ in their namespace-URI to keyword-namespace mapping, has the ship sunk?

Re: Parsing namespaced XML with clojure.data.xml

2016-08-24 Thread Matching Socks
Namespaced XML is inherently value-comparable and unambiguous. It would be shame to give up on that, and disperse the burden throughout every layer of library and consumer. Pretty-printing need not be a concern of the XML parsing library. Everyone seems to be interested nowadays in easing the

Re: Parsing namespaced XML with clojure.data.xml

2016-09-17 Thread Matching Socks
To make a URI into a Clojure keyword namespace, we may simply replace the 11 URI characters that are forbidden or problematic in keywords with Unicode-alphabetic characters outside Latin-1. The substitutes should be present in common desktop fonts, and should not be mistaken for Latin-1 characters

Re: Parsing namespaced XML with clojure.data.xml

2016-09-17 Thread Matching Socks
No escape needed; or, rather, no need to invent an escape. A mapping from IRI to URI is already specified in RFC 3987, "Internationalized Resource Identifiers (IRIs)". Just translate IRI to URI, and thence to keyword. -- You received this message because you are subscribed to the Google Gro

Re: Possible ClojureScript compiler issue...

2016-10-18 Thread Matching Socks
A reliable "implements?" would be better than a fast-and-sometimes-wrong "implements?". With that in mind, have you tried a distinct sentinel object, as opposed to true? -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send

Re: ava.lang.SecurityException: class "org.apache.poi.POIXMLDocumentPart"'s signer information does not match signer information of other classes in the same package

2016-12-11 Thread Matching Socks
Did you find http://stackoverflow.com/questions/2877262/java-securityexception-signer-information-does-not-match and the linked http://stackoverflow.com/questions/8878068/signer-information-does-not-match -- You received this message because you are subscribed to the Google Groups "Clojure" group

Re: "lein uberjar" gives me java.lang.OutOfMemoryError:

2016-12-11 Thread Matching Socks
An answer from "noisesmith" here http://stackoverflow.com/questions/32288195/why-lein-uberjar-evaluates-variables-defined-with-def says, "In order to compile your namespace for the uberjar (if you have AOT turned on), the clojure compiler must load your namespace. This will always invoke all top-

Re: (= function) evaluation steps

2016-12-18 Thread Matching Socks
Another book that might be very helpful to you here is "Clojure programming", by Emerick, Carper, and Grand. It presumes a background in Ruby, Python, or Java, and makes several useful comparisons. But the best part is an uncommonly insightful chapter about collections. (There is another unc

Re: Order preservation and duplicate removal policy in `distinct`

2016-12-29 Thread Matching Socks
How about a ticket for enhancement of the API documentation to clarify the nature of distinct's parameter (any seqable, even lazy)? That would distinguish it from, e.g., (dedupe (sort coll)). -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to

Re: [ANN] data.xml 0.2.0-alpha1

2017-01-01 Thread Matching Socks
I would expect keywordized namespaces and URIs to agree about equality. But alpha2's keywordization makes significant the case of %xx hex notation, which in URIs is not significant. user> (let [u1 "http://org.draintheaquifers/%4f"; u2 "http://org.draintheaquifers/%4F";] [(.equals (

Re: [ANN] data.xml 0.2.0-alpha1

2017-01-02 Thread Matching Socks
Whereas RFC3986 presents a bunch of options, the W3C has chosen one for use with XML: "Namespaces in XML 1.0 (Third Edition)", section 2.3 https://www.w3.org/TR/REC-xml-names/#NSNameComparison 2.3 Comparing URI References URI references identifying namespaces are compared when determining wheth

Re: cljc aot compilation fails on Windows

2017-01-07 Thread Matching Socks
You will eventually have to whittle it down to a minimal, reproducible case and file it in Jira. But if you are inclined first to entertain some wild and irresponsible speculation, then perhaps the problem might be related to the fix for CLJ-703, and it would work better to use the Clojure 1.7

Re: New to Clojure - productivity and debugging with Emacs

2017-01-08 Thread Matching Socks
That is an ambitious project. Divide and conquer. One super duper benefit of Clojure is that if you make a web app with, say, just Ring and Compojure, you can later transplant that work into a more elaborate app scaffolding, because it's all just plain maps. "quite a lot of map manipulation g

Re: New to Clojure

2017-01-09 Thread Matching Socks
You mention SQL. Note, that using JDBC in Clojure is really, really easy. It's a porcupine in Java, but in Clojure it's pure fudge. Whatever your Java frame of reference for an ORM might be, Hibernate or Spring or whatever, bang! you probably won't need it. Sure, there are JDBC wrappers for

Re: Clojure.spec, maps, restrict valid keywords, easier way?

2017-02-02 Thread Matching Socks
Keyword literals are inherently misspellable and trying to solve that problem with Spec does not really hit the nail on the head. But there is a solution: You do not have to use keyword literals very much! Instead of using, say, :egg/thunder throughout your program, def a var as :egg/thunder

Re: A problem about position of function used by binding

2017-02-07 Thread Matching Socks
There is a manual! https://clojure.org/reference/documentation - see especially under Vars and Compilation. -- 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 member

Re: Contribute Specter to Clojure core?

2017-02-15 Thread Matching Socks
One must recognize Clojure as an art project. It follows, that the choice of curated libraries is an aspect of the artistic expression. Look at them -- what else could it be? clojure.xml was unorthodox. clojure.zip is anti-gravity. clojure.core.logic is inside-out. clojure.core.typed is au

Re: instrument code only in dev, with lein

2017-03-17 Thread Matching Socks
In a nutshell: leverage distinct classpaths. Adjust the :dev profile in project.clj to prepend a directory other than src to :source-paths, and likewise a directory other than resources for :resource-paths. In development, use code or resources from the dev classpath to override default behav

Re: invokePrim(J)Ljava/lang/Object

2017-03-18 Thread Matching Socks
What did you mean by the ^long before the function name? If it is a hint of the return type, see https://clojure.org/reference/java_interop for the proper location. user> (defn integer-sum-to' ^long [^long n] (loop [i 1 sum 0] (if (<= i n) (recur (inc i) (+ i sum)) sum))) #'user/integer-sum-

Re: java interop, `(.instanceMember Classname)`

2017-03-20 Thread Matching Socks
Methods having the same name might be distinguished by their argument lists. -- 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 patie

Re: java interop, `(.instanceMember Classname)`

2017-03-20 Thread Matching Socks
In (.getName String) String is an instance of the class Class. -- 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

Re: clojure.data.zip Selecting a nested tag where tag shares same name as parent

2017-03-22 Thread Matching Socks
Does inserting clojure.zip/down between the two :thing's help? If these examples are representative, then clojure.core/xml-seq could be simpler than zippers: (def xmlstuff (first example1)) ;; you got a list from parse; get the root element (->> xmlstuff xml-seq (filter #(= :thing (:tag %)))

Re: instrument code only in dev, with lein

2017-03-25 Thread Matching Socks
You can avoid conflicts. The ns you start executing in dev may exist only on the dev source-paths, and when it configures the rest of your program (putting functions in closure and whatnot) it can do so drawing from stuff that's only going to be available in the dev profile. Then when you build

Re: potential bug with pr-str+print

2017-05-03 Thread Matching Socks
One more risk of (print ...), for debugging, is that it pollutes the results of functions that use (with-out-str ...). Consider using clojure.tools.logging instead. Setting it up takes some brainpower, but the investment is well worth while. -- You received this message because you are sub

What to read after 3 dozen "introduction to transducers" blog posts

2017-05-06 Thread Matching Socks
This one. https://tech.grammarly.com/blog/building-etl-pipelines-with-clojure "To be honest, this is a somewhat advanced usage of the transducers machinery," says the Grammarly Engineering Blog, right after shoehorning a BufferedReader into the mold with "reify IReduceInit". I already felt I'

Parentheses and Proto-Repl

2017-05-21 Thread Matching Socks
Puzzled about parentheses in Atom + Proto-Repl + Parinfer + lisp-paredit, the combination recommended in the gist at https://gist.github.com/jasongilman/d1f70507bed021b48625. I set up my brand-new Atom 1.17.0 according to those instructions. I am not sure this question has anything to do with

Re: [ANN] Clojure 1.9 / clojure.spec split

2017-05-21 Thread Matching Socks
> Additionally, this is a first step towards increased support for leveraging dependencies within Clojure. What do you have in mind? -- 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

Re: pmap: transducer & chunking

2017-05-26 Thread Matching Socks
With the overhead of threading, isn't the triumph of a transducer (no seq allocations) rather subtle in the case of pmap? At any rate!, as a point of interest, since you mentioned a quirk of pmap's thread usage: It apparently has to do with whether the input sequence is a chunked sequence or not

Re: Clojure, Java 9, and you

2017-06-05 Thread Matching Socks
Reading between the tea leaves, what does the delay in Java 9 (in connection with modularity) portend for Clojure? http://www.infoworld.com/article/3198912/java/java-9-delayed-due-to-modularity-controversy.html -- You received this message because you are subscribed to the Google Groups "Clojur

The soul of case

2017-06-18 Thread Matching Socks
In Clojure's case, a symbol is a symbol. For example, this snippet of Clojure says *:no-match*. (ns foo.bar) (def ^:const n 3) (def ^:const m 4) (let [x 4] (case x n 1 m 2 7 3 "hi" 4 :no-match)) The snippet came from http://blog.fikesfarm.com/posts/2015-06-15-clojurescr

Re: The soul of case

2017-06-24 Thread Matching Socks
Amusingly, ClojureScript's "case" works more like the way I always expect "case" to work. A "case" in Clojure that did what I meant with Java public-static-final constants would be lovely, lovely. ClojureScript's "case" is tasty candy! And now with cljc, those tasty "case" forms are going t

Re: Deserialization "gadget chain" in clojure

2017-07-12 Thread Matching Socks
At its core, it runs eval on untrusted data? -- 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 uns

Re: Unnamed Types - What Am I Doing Wrong?

2017-07-27 Thread Matching Socks
The attention-span constraint gives this challenge the aspect of a migration. Consider it that way and solutions emerge. In particular - attend to the interfaces between functions, and do whatever you like inside the functions. You could adjust the program incrementally, whenever convenient.

Re: Why is Clojure slow? (fibonacci)

2017-08-13 Thread Matching Socks
Avoiding boxed Longs as James suggested reduces the run time to about one-tenth that of the original. "memoize" avoids some additions, but it again boxes the longs. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email

Re: core.async got in a bad state?

2017-08-30 Thread Matching Socks
Special behavior built into only certain blocking operations (e.g., core.async's, but not java.io's) could instill a false sense of security. It could be complemented by a watchdog thread to poll the core.async pool threads and call a given fn if a thread was blocked when it shouldn't have be

Re: Why is the start function called -main

2017-09-06 Thread Matching Socks
There is a hint, as to this, in the API doc of gen-class: https://clojure.github.io/clojure/clojure.core-api.html#clojure.core/gen-class -- 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 Not

Re: Clojure core documentation

2017-09-08 Thread Matching Socks
The question of markup has tended to attract many far-sighted suggestions that turn it into a bike shed. Luckily, the undertaking needs no blessing. Clojure's doc strings change infrequently, if ever! Someone may set forth a markup language and create a fork with marked-up doc strings, and tool

Re: Clojure core documentation

2017-09-11 Thread Matching Socks
I am not convinced I would have found the API docs on reducers or zippers more informative if all references had been tidily markdown'ed. The new clojure.org welcomes contributions of topical overviews. That's helpful. But, to interpret docstrings, nothing helps like perspective. The thing a

Re: Has the (left recursive blowing) concat function been fixed?

2017-09-15 Thread Matching Socks
I think Alex Miller was pointing out that Jira is the point-of-entry for patches to be evaluated in an orderly way and, particularly, in the context of the contributor agreement. So, in this case, the merits have not been considered, much less declined. Perhaps the programmer will step back in

Re: redefining multimethods at the repl

2017-09-20 Thread Matching Socks
After moving a clj file and updating its ns declaration, subsequently updating a ns form that :require's it causes the REPL to bark. Restarting the REPL recovers from it. Here is a self-contained demo. Instead of making a ns to move, and moving it, I illustrate by recycling the same ns requ

Re: read-line is limited to 4095 chars

2017-09-27 Thread Matching Socks
The OP's figure for 4k suggests the "k" must be interpreted as x1024, so the corresponding threshold for 8k should be 8192. -- 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

Re: How to send a string to default system printer in Clojure

2017-10-03 Thread Matching Socks
Java says drawString while Clojure says drawstring. The compiler may be using introspection to find that method, and thus will not give you a compile-time message about the mismatch. I think you could avoid the introspection by using the "graphics" method argument instead of the "g2" variable,

Re: Can slingshot/try+ and then catch Object really catch any error?

2017-10-09 Thread Matching Socks
The linked page https://stuartsierra.com/2015/05/27/clojure-uncaught-exceptions also says "Another wrinkle: exceptions inside a future are always caught by the Future. The exception will not be thrown until something calls Future.get (deref in Clojure)." So you would need to review the pattern

Re: Is the Learning Guide in Order?

2017-10-11 Thread Matching Socks
There are some books that give a cohesive and well-ordered introduction. If you can still find a copy of "Clojure Programming", by Emerick, Carper, and Grand, that's the one that I found most thoroughly helpful with the standard library. Also, it has a pretty good index and I made frequent re

Re: How to add a java servlet into a clojure ring project

2017-10-11 Thread Matching Socks
war files are zip files, so you can unzip the war and see what's wrong with it. If necessary, build the combined war file another way. You might be able to do that by producing a war file with your web app only (which you know works) and then taking it apart with unzip, incorporating the other

Re: Got NullpointerException when using loop/recur/let together

2017-10-25 Thread Matching Socks
Also, have another look at '(ret (- time-now start-time)) It will yield a list containing the symbol 'ret and a nested list containing the symbol '- etc etc etc. I think what you expected was a vector of two numbers. -- You received this message because you are subscribed to the Google Group

Re: Grateful Appreciation

2017-11-01 Thread Matching Socks
Simplicity is a rare pleasure, and so too is a standard library diverging only immaterially from the ideal of 1 data structure and 100 functions. In Clojure, it saves a lot of time that would otherwise be spent asking questions on Stack Overflow. Or rather, it frees up a lot of time for askin

Re: Doc strings for complex cases?

2017-11-09 Thread Matching Socks
You can also put a docstring in a ns form to give context. I don't think you need anything done to Clojure itself. Or more specifically, you need not be limited by whatever Clojure has done with docstrings. Nor will you need to modify defn. You can attach any metadata you like, to the vars i

Re: calling a clojure function within a quote/(')

2017-11-17 Thread Matching Socks
In the docs: "syntax quote" on https://clojure.org/reference/reader -- 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 y

Re: Any data about just how much loc Clojure shaves off java?

2017-11-20 Thread Matching Socks
To Alex's list -- you may add the contorted use of XSLT for lack of data-structure transformation functions! And all the messing around making "safe copies"! And "thread-safe" wrappers! And factory-factory factories! And code written just to print out the contents of POJOs! And duplication

Re: Unexpected behaviour of transient map

2017-11-24 Thread Matching Socks
I would go so far as to (light-heartedly) call the "assoc!" docstring booby-trapped. There is an open issue in Jira for it. Go vote: https://dev.clojure.org/jira/browse/CLJ-1385 -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this grou

Re: Unexpected behaviour of transient map

2017-11-25 Thread Matching Socks
A docstring need not be a rope ladder that leads to all truth. (That would be a project for the IDE documentation access improvement brigade.) But the docstring of "assoc!" feints in a direction that makes this a frequently-asked question. -- You received this message because you are subscri

Re: [ANN] Dynadoc, dynamic docs for Clojure(Script)

2017-11-28 Thread Matching Socks
Hey, gang! There is something important here. Gold!, amidst the nuts and bolts. A humdinger of first-rate philosophical insight is tucked, inconspicuously, way toward the end of the linked demo video. In a word, it is a bat-it-out-of-the-park answer to the docstring-improvement chatter. Ta

Re: Clojure for beginners

2017-12-06 Thread Matching Socks
Meat and potatoes? -- 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

Re: Officially support Vert.x

2018-01-10 Thread Matching Socks
How do the aims of this undertaking compare with Pedestal? http://pedestal.io/ says, "Pedestal supports Tomcat, Jetty, Immutant (with Undertow), Vert.x, ..." -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to cloju

Re: [ANN] com.walmartlabs/lacinia 0.24.0, com.walmartlabs/lacinia-pedestal 0.6.0

2018-01-30 Thread Matching Socks
Lacinia is well done, and, in combination with Clojure, a terrific labor-saving device. In fact, Lacinia is so well-conceived that it makes GraphQL itself glow with labor-saving virtue. GraphQL is anyway splendidly low-impact for in-the-browser clients. In return, the burdens of GraphQL a

Re: create vector from other vector and indices

2018-02-13 Thread Matching Socks
user> (def v [:a :b :c :d]) #'user/v user> (mapv v [3 1 2 0]) [:d :b :c :a] -- 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 pati

Re: macroexpand in uberjar

2018-02-15 Thread Matching Socks
Does the "uberjar" contain .class files for your "m" namespace? -- 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

Re: `lein run` VS `lein uberjar` behaviour

2018-02-18 Thread Matching Socks
With the luxury of commenting on complex software sight-unseen... best of all, JavaFX... and you mention an uberjar, which grants opportunity to vent baseless suspicions about class-loading and compilation differences... could it be that the MediaPlayer is being instantiated *twice* in the uber

Re: Why does the `def-` not exist?

2018-03-03 Thread Matching Socks
^:private is the stale and sleazy co-conspirator of another blunt instrument, the whole-ns :use. Besides relegating inner-workings to a separate ns: You can gracefully omit a function from auto-generated docs by putting its description in a comment instead of a docstring. It would, likewise,

Re: [ANN] clj-memory meter – measure the memory used by arbitrary objects

2018-03-06 Thread Matching Socks
Unrealized lazy sequence... user=> (def mm (filter even? (range 10))) #'user/mm user=> (mm/measure mm) "160 B" Realized... user=> (count mm) 5 user=> (mm/measure mm) "1.8 MB" Structural sharing? user=> (def nn (drop 25000 mm)) #'user/nn user=> (mm/measure nn) "1.8 MB" user=> (mm/me

Re: Calling functions from within maps

2018-03-20 Thread Matching Socks
Why not provide a short, self-contained example that demonstrates the problem? And, by the way, are you using paredit or park fee? -- 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 t

Re: [ANN] packthread 0.1.10

2018-04-04 Thread Matching Socks
Those are also good occasions for the standard-library *as->* user> (-> 4 (as-> x (let [n 2] (+ x n))) inc) 7 -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@google

Re: Clojure on Azul Zing JVM

2018-05-21 Thread Matching Socks
IBM Java likewise has not excited very much conversation here. Perhaps because Java is "write once, run anywhere"! The various implementations of Java have their strong and weak points, but they will run Clojure in any case. -- You received this message because you are subscribed to the Goog

Re: Validate XSD 1.1

2018-05-30 Thread Matching Socks
(A fun and enlightening discussion is here: https://issues.apache.org/jira/browse/XERCESJ-1454 --- about whether to post Xerces on Maven Central.) -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegro

Re: Topological sort

2018-06-15 Thread Matching Socks
user> (topological-sort {0 [1] 1 [2 3] 2 [3] 3 []}) (3 2 0 1) ! -- 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 you

Re: defrecord can't impl some interface methods

2018-07-06 Thread Matching Socks
Wow, that Jira item got mired in a muddle of Various Alternatives! It discusses (1) error messages, (2) documentation, and (3) covariant returns! Jira can be a slow place to resolve a muddle. By the way: I suppose each compiler (clj, cljs, ...) is sensitive to a distinct set of implicitly-r

  1   2   3   >