Re: Parsing large XML files

2013-12-17 Thread Matching Socks
On general Java principles, you can stream a large XML file with either SAX or StAX and pluck what you like from it without wasting memory on the rest. If the file is a long series of small sections that could be examined separately, you might use SAX to partition the file and then subject

Re: get rid of reflection in proxy-super?

2013-12-24 Thread Matching Socks
(Re Colin's note that a proxy gets damaged if super throws - goodness gracious! Is it the same matter as Clojure Jira issue No.983? It's marked as minor and affecting Clojure 1.3, and no one has voted for it.) -- -- You received this message because you are subscribed to the Google Groups

Re: Finding available methods or docs for a value type

2013-12-27 Thread Matching Socks
How does it do that?! From the README at the linked page: what it does is take input arguments and an expected output, and it tries out every function and macro in a set of namespaces, collecting the names of the ones that produce the output for the input arguments passed. Cool! But...

Re: HttpKit, Enlive (html retrieval and parsing)

2014-01-11 Thread Matching Socks
Java has HTTP retrieval built in. Clojure's core functions can use file or http URLs: user (slurp http://google.com;) user (slurp file:///etc/passwd) Parsing HTML on the other hand is a question of not just science but also art. Doesn't enlive use Tag Soup? -- -- You received this

Re: [beginner] How do I make a button that could interact with indicator?

2014-01-11 Thread Matching Socks
To echo the Swing suggestion - Try the Seesaw REPL experiment! I think this is it: https://gist.github.com/daveray/1441520 -- -- 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: JAVA_OPTS not accessible in my Clojure project

2014-01-11 Thread Matching Socks
How did you start the Emacs Cider REPL? -- -- 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

Re: JAVA_OPTS not accessible in my Clojure project

2014-01-12 Thread Matching Socks
The Leiningen sample project https://github.com/technomancy/leiningen/blob/master/sample.project.clj refers to a :jvm-opts key and a JVM_OPTS environment variable. -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send

Re: lein script installation errors on CentOS 6.5

2014-01-13 Thread Matching Socks
Scripts in Red Hat ought to begin with #!/bin/bash which is writable only by root and kept updated by system updates. But lein uses #!/usr/bin/env bash -- use whatever bash executable is on my path -- which is less well controlled and might be different. Try which bash to see what shell is

Re: clojure key destructuring motivation

2014-01-18 Thread Matching Socks
Map keys need to be unique. Therefore, it's tidy for the symbol to be the key to the destructuring map. On Saturday, January 18, 2014 2:57:09 PM UTC-5, Alex Miller wrote: I have some sympathy for this view of things as it was a question I had while learning Clojure as well. The general

Re: oob schemas, re: The Language of the System

2014-01-19 Thread Matching Socks
Hmm, here's a date field that says 090715. I wonder what it means... -- -- 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

Re: Help about using clojure in org mode in Emacs with CIDER

2014-01-26 Thread Matching Socks
I tried updating org alone, but I evidently caused a mishmash of old and new elisp file versions that didn't work. So I built Emacs from the trunk branch (emacs-version 24.3.50.1), and blended Org from the master branch to get Cider. According to package-list-packages, I am using cider

Re: order of returned values from keys and vals

2014-01-31 Thread Matching Socks
Actually, http://dev.clojure.org/jira/browse/CLJ-1302 keys and vals consistency not mentioned in docstring was declined, with the comment The absence of this property in the docs is correct. You should not rely on this. On Wednesday, August 11, 2010 6:03:39 PM UTC-4, Chouser wrote: On Wed,

Multiple sort keys

2014-02-24 Thread Matching Socks
It's straightforward to sort a bunch of maps by a single key: (sort-by :foo x) But how best to sort by primary, secondary(, ...) sort keys? An elegant idiom can be found on briancarper.net*, where it was refined for Clojure 1.1 by Malcolm Sparks: (sort-by (juxt :foo :bar) x) In a very

Map destructuring variations in Pedestal

2013-03-19 Thread Matching Socks
I'm puzzled by two :or syntaxes that are used in io.pedestal.service.http, from [io.pedestal/pedestal.service 0.1.1-SNAPSHOT], which is where following along with the Getting Started got me. In one place, it pairs :or with a map whose keys are symbols being bound in the outer form: {routes

In Emacs Org mode, how to round-trip Clojure code edits?

2013-03-23 Thread Matching Socks
I've got clojure-mode and nrepl installed, but I skipped Slime. From the org-mode sample page, http://orgmode.org/manual/Literal-examples.html, I copied #+BEGIN_SRC emacs-lisp (defun org-xor (a b) Exclusive or. (if a (not b) b)) #+END_SRC where you type

Re: LoL which style for Clojure

2013-03-24 Thread Matching Socks
Doug Hoyte's book Let Over Lambda—50 Years of Lisp devotes its very title to the technique of (let...(fn...)). On Friday, March 22, 2013 2:59:43 PM UTC-4, jamieorc wrote: Curious which style is preferred in Clojure and why: (defn f1 [] (let [x {:foo 1 :bar 2 :baz 3}] (keys x)))

Re: [ANN] java.jdbc 0.3.0-alpha1

2013-04-08 Thread Matching Socks
Could the entities and identifiers functions (translating map-keys to SQL-names and back) be specified along with connection parameters to avoid repetition with each operation? -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this

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: Confused by reference to capturing (as opposed to binding) in C. Grand's talk (not= DSL macros)

2012-09-18 Thread Matching Socks
The Google can find a PDF by that name. It uses capturing in the sense of regular expressions. I think his idea is that in the DSL you identify or produce information (capture it), but you do not specify the names by which the user's program will refer to it (bind it). -- You received this

Re: Differences between data.csv and clojure-csv

2012-12-22 Thread Matching Socks
Examining the source code, you can see that * clojure.data.csv reads forward-only, so I suppose it might work with any Reader. * clojure-csv.core uses mark and reset, so it might not work with all Readers. clojure.data.csv makes the problem look simpler to solve, and its source code is

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: loop/recur being functional

2014-06-03 Thread Matching Socks
Recommended: Programming Clojure, in which Stuart Halloway Aaron Bedra discuss these forms of recursion. -- 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: ClojureScript Clojure 1.6.0

2014-06-06 Thread Matching Socks
Can a lein-cljsbuild clj+cljs project specify separate versions of Clojure for the cljs and clj parts? If not, please give it another 6 months. On Friday, June 6, 2014 10:43:42 AM UTC-4, David Nolen wrote: Future releases of ClojureScript will have a hard dependency on Clojure 1.6.0.

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

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 contrast -

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 and

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. https://github.com/clojure/core.match/commit/0545c6af9d545dcf1bc0a3ca792771b9a678a030 (The workaround was

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 https://groups.google.com/forum/#!topic/clojure/rKKOkj-qKvc. -- You received this message because you are subscribed

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

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

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.

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]

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 a

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-while

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

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

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

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 post to

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

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

#queue, (throw), and other unexampled fruits

2015-08-01 Thread Matching Socks
Admiring the Clojurescript API docs[1], I came across #queue literal, tantalizingly not flagged with the Clojure-compatible icon! Sure enough: cljs.user= #queue [1 :b] #queue [1 :b] cljs.user= (pop *1) #queue [:b] Meanwhile, Clojure says No reader function for tag queue. CLJ-976,

Re: range no longer returns a LazySeq; how to check whether realized?

2015-08-02 Thread Matching Socks
By the way, -- When is it useful to know whether a lazy sequence has been realized? -- 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

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 wrote a

Re: Processing futures and promises asynchronously

2015-10-26 Thread Matching Socks
See also: Zach Tellman's "Manifold" http://aleph.io/manifold/rationale.html http://aleph.io/manifold/deferreds.html -- 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: how to speedup lein uberjar?

2015-10-27 Thread Matching Socks
If you do not want much to be compiled ahead-of-time and represented in the jar as class files, you may use the :impl-ns option on :gen-class. e.g., 1) project.clj says :aot [bla.bla-aot] 2) bla.bla_aot.clj says (ns bla.bla-aot (:gen-class :impl-ns bla.bla)) Ahead-of-time compilation does

import and require for consuming the fruits of defrecord

2015-10-27 Thread Matching Socks
A recent announcement of Clojure 1.8.0-beta2 mentioned an interesting enhancement, CLJ-1823 Document new :load-ns option to defrecord/deftype which I think means that "import" will make a record type fully usable without an auxiliary "require". This would be an improvement (for Clojure),

Re: org-mode Clojure babel

2015-11-04 Thread Matching Socks
If you and your Emacs are happy with cider and clojure-mode, then the leap to Org Babel with Clojure should be a short one. One thing to do is look at your Org mode's ob-clojure.el and figure out whether it mentions cider. (The older or "stable" versions use only slime or nrepl.) The Org

Re: Newbie trying HTML parsing

2015-10-14 Thread Matching Socks
(Enlive wraps JSoup and TagSoup and causes them both to return a value in the same format as clojure.xml. Likewise, Enlive's transformation features will work with anything that looks like clojure.xml.) -- You received this message because you are subscribed to the Google Groups "Clojure"

Re: [ANN] mixfix syntax for clojure

2015-09-08 Thread Matching Socks
The Readme is excellent and illuminates some of the depth behind the brief example that opened this thread. If it is possible for depth to be behind. In this case I believe it is. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this

Re: Using metadata to specify how calls to a macro should be indented

2015-09-13 Thread Matching Socks
Unless clojure.core itself will carry these annotations, could the keyword be namespaced? -- 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: Primitive pseudocode parser in Clojure

2015-09-21 Thread Matching Socks
Vitaliy Akimov described an approach to a similar problem here recently... https://groups.google.com/d/msg/clojure/HNH66_KNaNM/BjpJGnl7AgAJ -- 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

Re: Generalizing - and - forms

2015-08-28 Thread Matching Socks
The parameter order of as- makes it convenient to use *inside *- so you can name the threaded parameter only where it needs naming: (- UFOT (reverse) (- (apply str)) (string/lower-case) (as- x (string/replace slip on a tofu x banana peel))) On Friday, August 28, 2015 at

Re: org-mode Clojure babel

2015-12-10 Thread Matching Socks
The latest stable Org Babel stopped working with the introduction of Cider 0.10.0. You can either go back to Cider 0.9.1, or (1) get Org 8.3.2, (2) git-clone Org's repo, and (3) back-port to 8.3.2 the change in ob-clojure.el that accommodates the latest Cider. The breakage was raised at

Re: Why do map/get and similar return nil if not found?

2016-01-12 Thread Matching Socks
To add to the ideas above -- When you want to avoid misspelling the keys of record-like maps, you can define and use constant vars for the keys (so the compiler will verify references). The 'persistency' of data structures in Clojure really puts the shoe on the other foot. Consumers of a

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

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

Re: Check if value is a ring handler

2016-01-27 Thread Matching Socks
(constantly nil) would work as a Ring handler. The str function also would work as a Ring handler. But it might be unclear (in a context where either a Ring handler, or a function for some other purpose, was acceptable) whether these were intended as Ring handlers -- You received this

Re: How is the emphasis of “data over code” different than the XML advocacy of the early 2000s?

2016-02-01 Thread Matching Socks
Also watch Zach Tellman's "Always be composing". And keep in mind Alan Perlis' maxim "It is better to have 100 functions operate on one data structure than 10 functions on 10 data structures ". Is XML a data structure in that sense? Or is

Re: compare-and-set deep value in hashmap atom

2016-02-01 Thread Matching Socks
There is another idiom to consider if you need to involve a side effect like notification. See http://clojure.org/reference/agents. You use a ref instead of an atom, you modify the ref and trigger the notification (by sending a function to an agent) inside a transaction, and the agent runs

Re: Clojure as first language

2016-02-23 Thread Matching Socks
The post-Python effect came up briefly in another Conj talk -- in 2015 -- given by Elena Machkasova and two students, one of whom had had Clojure first and the other Python. Their school offered it either way. https://www.youtube.com/watch?v=n0yN1GauxCA -- You received this message because

Re: Clojure as first language

2016-02-22 Thread Matching Socks
Zach Oakes gave a bracing talk about Clojure-as-a-first-language, unpedantically entitled "Making Games at Runtime with Clojure", at the 2014 Clojure conj. https://www.youtube.com/watch?v=0GzzFeS5cMc -- You received this message because you are subscribed to the Google Groups "Clojure"

Re: Clojure beyond Java 6 ?

2016-01-19 Thread Matching Socks
Apropos of this week's new clojure.org website, this here is a genuine F.A.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

Re: Destructuring seems to work with PersistentList and not with PersistentVector

2016-01-24 Thread Matching Socks
In case it's not clear from the above, {:keys [...]} is a technique for *map* destructuring of associative data structures. (let [{:keys [a b]} {:a 1 :b 2}] [a b]) [1 2] As documented at http://clojure.org/reference/special_forms, :keys takes a vector of the symbols to bind. -- You received

Re: macro question

2016-01-26 Thread Matching Socks
A macro emits a form for the compiler to compile. And it understands its inputs as forms -- unevaluated forms. - Your plus-two emits a list with + in function position. - foo, when it is computing the form to emit, applies + to 2 and some form x. So 5 works but u does not, even after (def u

Re: clojurescript in clojure

2016-01-26 Thread Matching Socks
Is lein's project mavenry important here? Could you call cljs.compiler directly? -- 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

Re: I am wondering if there is a better way to validate and read-in clojure data?

2016-03-13 Thread Matching Socks
Writing text with XSLT is a delicate matter at best, and XSLT certainly does not help with notational guarantees as it does when writing XML. You might find it a better use of the respective strengths of the tools, for the XSLT to emit simple XML and the Clojure program to read it into data

Re: Possible bug in clojure.set/union?

2016-03-04 Thread Matching Socks
This is an FAQ. It is such a good FAQ that "fixing" it would be a shame. It's a good FAQ because it starts with a real problem that everyone thinks they have, and it leads (if you doggedly pursue it) to a well-rounded enlightenment as to what makes Clojure interesting. -- You received this

Re: [ANN] [book] Mastering Clojure published!

2016-04-04 Thread Matching Socks
The publisher's blurb on Amazon says, You'll start off by learning the details of sequences, concurrency primitives, and macros. Packed with a lot of examples, you'll get a walkthrough on orchestrating concurrency and parallelism, which will help you understand Clojure reducers, and we'll walk

Re: Clojure docstring style

2016-05-16 Thread Matching Socks
Cider could be most *helpful* by linking all words that could possibly be linked. Everyone uses clojure.core, after all. Cider could be most *elegant* by not attempting these links at all. Cider could be most *Emacs-like *by letting users override the symbol detector with an Elisp function.

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

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

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?

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

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

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

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

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,

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

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"

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

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: 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

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

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: 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

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

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: 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-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

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)))

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: 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

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: 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

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

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

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

  1   2   3   >