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 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/groups/opt_out.




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 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/groups/opt_out.




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 - 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/groups/opt_out.




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 served by records"[1] probably refers to times when you know the 
fields!  Is there really a need to bend over backwards to switch natural 
defstruct usage over to records?

[1] http://clojure.org/data_structures

-- 
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: 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 be useful on their own without the other.
Those considerations recommend higher order functions.  Using
higher-order functions can make the code shorter, clearer, and more
flexible.

First, there's the essential computation:

(defn pct [p t] (/ (* p 100.0) t))

Second, various general-purpose ways to round floating-point numbers:

(defn round-up [x]   (int (Math/ceil x)))
(defn round-down [x] (int (Math/floor x)))
(defn round [x]  (int (Math/round x)))

To put them together, get-percentage took a hint about the rounding
function, dispatched on the hint, and took upon itself responsibility
for detecting a bogus hint.  Instead of a hint from a closed set, why
not let the caller pass in the rounding function itself?  Now
get-percentage is down to one line:

(defn get-percentage* [f p t] (f (pct p t)))

For example

(get-percentage* round-up 4 30)
14
(get-percentage* round-down 4 30)
13

Alternatively, the standard function "comp" can produce your canned
combinations, so you might not need get-percentage* itself anymore:

(def get-percentage-high (comp round-up pct))

For example:

(get-percentage-high 4 30)
14


-- 
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: 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://stackoverflow.com/questions/8623109/how-to-get-a-clojure-handle-on-a-java-static-method-similar-to-memfn-for-a-ja

http://clojure.org/java_interop

P.S. If you find this error message puzzling and think the compiler could 
reasonably do better, would you file a Jira ticket about it?  
http://dev.clojure.org/jira/

-- 
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: [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/datomic/8yrCYxcQq34/GIomGaarX5QJ


-- 
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: 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 currently got this 
> function:
>
> (defn from-edn [edn-file] (with-open [r (clojure.java.io/reader edn-file)]
> (edn/read (java.io.PushbackReader. r
>
> Having to explicitly reach into the Java API to read a clojure-only format 
> seems wrong. What should I be doing instead?
>

-- 
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: 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 map is 
> passed as the last argument to apply, Clojure "does the right thing" and 
> passes the map in as keyword args.
>
>

-- 
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] 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" outside the "iterate" as a loop-ending nanny for sequences 
that could not genuinely be infinite.  The "take" should be concerned with 
what the consumer wants to consume, not preoccupied with what the producer 
will be able to produce.

-- 
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: (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 resource". 

Currently, clojure.java.io/resource is convenient for use with "some", 
"filter", and "if".  A Jira ticket suggesting a more explicit docstring 
would be helpful.


-- 
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: 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 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: [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 server runs.

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

-- 
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: 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 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] 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 little macro to help.
>
> It means you could replace this :
>
> (require '[clojure.test :refer :all]
>  '[schema.core :as s])
>
> (deftest my-test
>   (let [response ...]
> (is (= (:status response) 200))
> (is (= (count (get-in response [:headers "content-length"])) (count 
> "Hello World!")))
> (is (= (count (get-in response [:headers "content-type"])) 
> "text/plain;charset=utf-8"))
> (is (nil? (s/check s/Str (get-in response [:headers "content-type"]
> (is (instance? java.nio.ByteBuffer response))
> ))
>
>
> , with this :
>
> (require '[clojure.test :refer :all]
>  '[schema.core :as s]
>  '[juxt.iota :refer [given]])
>
> (deftest my-test
>   (given response
>   :status := 200
>   :headers :⊃ {"content-length" (count "Hello World!")
>"content-type" "text/plain;charset=utf-8"}
>   [:headers "content-type"] :- s/Str
>   :body :instanceof java.nio.ByteBuffer))
>
>
> , using various infix operators :
>
> :=is equal to:!=isn't equal to:-conforms to schema:!-doesn't conform to 
> schema:?satifies predicate:!?doesn't satisfy predicate:#matches 
> regex:!#doesn't 
> match regex:> or :⊃is superset of:!> or :⊅isn't superset of:< or :⊂is 
> subset of:!< or :⊄isn't subset of:instanceofis instance of:!instanceofisn't 
> instance of
>
>
> It's hardly ground-breaking, but feel free to use it if you like.
>
> https://github.com/juxt/iota
>
>
> Regards,
>
> Malcolm
>

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


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-client module.  The usage that 
needs adjustment is in ob-clojure.

-- 
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: 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 - try it with the global hierarchy:
(derive :eggplant :veg)
AssertionError Assert failed: (namespace parent)  clojure.core/derive (core.
clj:5176)NoSuchMethodError clojure.tools.nrepl.StdOutBuffer.length()I 
 clojure.tools.nrepl.middleware.session/session-out/fn--7630 (session.clj:43
)



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


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 removing five 
lines.  Problem solved.  Therefore, the present memo to the assembled is 
just a contemplation.

Issue 1702 was opened one month ago, September 18.  It is now closed, 
although the lein.bat I got today from the link on leiningen.org still 
exhibited the problem.  I guess the fix will surface in a future official 
release.

Issue 1702 refers informatively to a pull in which the problem was 
introduced[2].  The chain of notes is something to think about.  

---

[1] https://github.com/technomancy/leiningen/issues/1702

[2] https://github.com/technomancy/leiningen/pull/1599

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


"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 was to use keywords for multimethod dispatch.)  

I looked on http://clojure.org/multimethods and 
http://clojure.org/compilation but did not find a warning regarding the 
combination of those two.

In a nutshell, how does a conflict arise between AOT and multimethods?  

-- 
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 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 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: 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 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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/clojure/b7b707f3-2122-4af6-afbe-c03fbe174fbco%40googlegroups.com.


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 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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/clojure/c5906565-819b-4d79-8564-50d9e54e0607n%40googlegroups.com.


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 advice reminds me of a pioneering ClojureScript React-wrapping 
library whose groupId is a domain that belongs to someone else.  The funny 
thing is that this is the library's *second* squatting.  The first one 
lasted only briefly; folks pointed out the domain was already used for an 
unflattering website.  So then the maintainers picked a domain that no one 
had registered at the time.  Risky!

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/clojure/88400d9e-9c68-4098-9321-7cfb89e92be8o%40googlegroups.com.


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 will be forced to take a minor update someday that introduces a 
clash.  Or perhaps (quite likely) jars do overlap today, but you will take 
a minor update someday that causes the classpath to emerge from the 
hash-map differently and your program won't work anymore.  The insight of 
the theory of "situated programs" is, not to hit a cliff when a perfectly 
legal quirk arises in the situation.

>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/clojure/4005f2c2-d95d-4612-b2e3-b223b731700eo%40googlegroups.com.


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
>  project:
>
> https://github.com/cljctools/readme#rationale
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/clojure/e4eb29ef-949a-4d06-88d5-b47ba96d6faao%40googlegroups.com.


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 thinking about commas
>
> P.P.S. Also, sets and keywords and ints and extensibility and characters 
> and symbols and thank you very much! (:
>

P.S.,  Yes!  Yes again!!

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/clojure/76532578-f0f5-4c3c-899d-5771dbf15655o%40googlegroups.com.


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 the original in Clojure 2.

On Sunday, November 1, 2020 at 7:01:04 PM UTC-5 EuAndreh wrote:

> Andy Fingerhut  writes:
>
> > My personal guess: the authors of the EDN specification and
> > implementation are content with their level of detail, and might not be
> > interested in making them 100% equivalent in all ways. (This is only my
> > personal guess. Realize that making specifications and implementations
> > match can be an exhausting and unrewarding process.)
>
> Agree on "making the implementation match the specification" being an
> arduous task, as I am trying to do it myself in working in an edn
> implementation.
>
> However, I don't see a way around this type of job being an
> specification.
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/clojure/5ff53710-9f35-42df-a814-977ced816e67n%40googlegroups.com.


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 "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: 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 
open clojure.core and see what 100 functions looks like, it is a bit 
sobering at first.  Emerick, Carper & Grand's "Clojure Programming" does a 
particularly good job of making it all make sense.

I sure wouldn't mind if "contains?" threw.  Perhaps the coming clojure.spec 
instrumentation of clojure.core will address that.

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


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 good idiom return Clojure-namespaced keywords 
for the element names.  (Its present version is 0.1.0-beta1, a 
work-in-progress.)  You configure the namespaces to keywordize as its 
README illustrates:

(declare-ns "xml.html" "http://www.w3.org/1999/xhtml";)
(parse-str "
http://www.w3.org/1999/xhtml\";>
...

Could the same effect be obtained without the global state of namespace 
mappings?  Do all uses of clojure.data.xml in an app, even fully 
encapsulated uses, have to agree about the keyword for any given well-known 
XML namespace URI?

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

Nonetheless, value equality might sometimes be useful.  How to achieve it?  

There is already a globally distinct, agreed, and unambiguous way to refer 
to each well-known XML namespace URI.  It is the URI itself.  If the 
keyword-namespace must have the same properties, it ought to follow from 
the URI, not be left to the discretion of individual consumers.  

Could there be a well-known translation from namespace-URI to 
keyword-namespace and back?  These keyword namespaces would be cumbersome 
(as they must include the whole URI and also avoid colliding with the 
namespace of any other namespaced keywords anywhere), but consumers could 
alias them conveniently without impacting value comparisons:

(->> 'xmlns.http.www.w3.org.n1999.xhtml
 create-ns
 ns-name
 symbol
 (alias 'xhtml))

To account for the whole space of URIs, without violating the Clojure or 
EDN keyword namespace spec or compromising reverse translation back to the 
URI, you might have to go further.  For example, combine a legible symbol 
name computed with some loss (as an assertion) and a Base-64 encoding...

(->> 
'xmlns.http.maven.apache.org.POM.4.0.0.aHR0cDovL21hdmVuLmFwYWNoZS5vcmcvUE9NLzQuMC4wCg==
 create-ns
 ns-name
 symbol
 (alias 'pom))

A well-known formula for namespace keywords representing XML namespaces 
could replace the ad-hoc mutable map and satisfy your dual aims that 
clojure.data.xml applications might use keywords for convenience while also 
maintaining strict value equality of the XML data structures all the way to 
the horizon.  (The data structure would use such keywords for all element 
tags.)

-- 
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: 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 usage of namespaced 
keywords.  Perhaps printing could be improved (globally) to use the 
caller's keyword namespace aliases.  

Anyway, pretty-printing is always expensive.  If a keyword-conversion step 
must encumber either pretty-printing or everything else, better do it in 
pretty-printing.

Keyword *literals* make the source code easy to read, but composing 
keywords programmatically with a caller-provided namespace might be 
intolerable.  Moreover, providing those namespace mappings would be a messy 
headache for the consumer of XML processing libraries.  The mappings would 
have to pass through layer after layer.  No doubt, every library will 
provide different defaults.  One false step, and you would lose value 
comparability.

By contrast!, with well-known keyword namespaces, computed by a well-known 
function from their respective well-known namespace URI, everyone could 
write source code using keyword literals with whatever keyword namespace 
alias they want, and XML structures would be value-comparable.  In the 
short run, the best pretty-print might be actual XML serialization.  In the 
long run, I predict, Clojure's namespaced keywords will go down as smooth 
as fudge.

By all means, use an encoding more legible than Base64.  URLEncoder could 
be an example in the way it uses %.  Pick an escape character that's legal 
in Clojure namespace names, but unusual in the best-known namespace URIs.  
Apostrophe?

-- 
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: 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.  They should come from a
single Unicode script, to avoid burdensome Unicode puns.  It should
be a raster script that does not require decades of handwriting practice.

Cyrillic fits the bill very well:  it's recognizable and out-of-band.  You'd
never type these URI keywords in, but Cyrillic is a software-selectable 
keyboard so you could if you felt like it.

  http://www.cs.yale.edu/~perlis-alan/quotes.html
  httpцЛЛwwwЯcsЯyaleЯeduЛжperlis-alanЛquotesЯhtml

Here is a demonstration of a simple URI <-> keyword translator 
and a keyword-namespace aliasing macro to facilitate relatively 
painless use of namespace literals in source code.

(To furthermore overcome the problem that "%" hex expressions compare
case-blind in URIs, but not keywords, we should norm %xx to %XX as RFC
3986 recommends before converting to a keyword namespace.)

(def problems  [\. \~ \: \/ \[ \] \@ \( \) \, \;])
(def solutions [\Я \ж \ц \Л \П \Ю \Ж \ъ \Ъ \г \д])

(defn- tr [a b]
  (let [m (zipmap a b)]
(fn [s]
  (apply str (map #(m % %) s)

(def uri->kwns
  (tr problems solutions))

(def kwns->uri
  (tr solutions problems))

(defmacro alias-xml-ns [sym uri]
  `(let [kwns# (symbol (uri->kwns ~uri))]
(create-ns kwns#)
(alias ~sym kwns#)))

(comment

  (uri->kwns "http://www.w3.org/2000/01/rdf-schema#";)
  
  (kwns->uri *1)

  (alias-xml-ns 'html "http://www.w3.org/1999/xhtml";)

  (assert
   (identical? ::html/aside
   :httpцЛЛwwwЯw3ЯorgЛ1999Лxhtml/aside))

)


-- 
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: 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
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: 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 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: 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.
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: "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-level side effects."

-- 
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: (= 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 uncommonly insightful chapter about protocols and stuff.)

-- 
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: 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 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] 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 (java.net.URI. u1)
(java.net.URI. u2))
   (= (clojure.data.xml.jvm.name/encode-uri u1)
  (clojure.data.xml.jvm.name/encode-uri u2))])

yields

[true false]


-- 
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] 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 whether 
a name belongs to a given namespace, and whether two names belong to the 
same namespace. [Definition: The two URIs are treated as strings, and they 
are identical if and only if the strings are identical, that is, if they 
are the same sequence of characters.  The comparison is case-sensitive, and 
no %-escaping is done or undone. 

It continues from there, with emphatic reinforcement of the point.

OK!

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

-- 
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: 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 going on with the request and response 
maps"

On the bright side, map manipulation is *all* that is going on.  There are 
no side effects.  Therefore, it can be very helpful to log the request and 
response maps.  For example, make a Ring handler that does nothing but log 
the request, delegate to the next handler, log its response, and return its 
response; then stick that handler wherever in the handler stack makes you 
curious.  Using the Emacs CIDER REPL you may change the handler stack and 
fiddle with logging while the program runs, so logging is a convenient 
debugging technique.

"unless, of course, I read and understand their source"

On the bright side again, there is not much source code there, at least 
compared with what you'd expect in Java.  Also, the jar that Maven (etc) 
can fetch for you *is* the source code, and Emacs can open such jars and 
browse the files inside.  

Some of the libraries have overview documentation that puts the API docs in 
context.  Keep the Ring SPEC open, and the Liberator graph too if you can 
figure out how to view more than a tiny bit of it.

By all means point out gaps in the docs on the libraries' respective issue 
trackers.

-- 
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: 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 Clojure, to help with joins or portability or whatever, but when push 
comes to shove, if you need to do something "yourself", there is no mystery 
to it.  

For your one-month aspirations (ha!), Clojure is an interesting plan 
because you work in generic data structures and a lot of the alternative 
web-oriented libraries more-or-less agree about those structures.  So for 
example, you start out with Ring + Jetty, super simple, definitely good 
enough for Month No.1, but later you decide you need async and you want to 
switch to Aleph + Netty.  Amazingly little work will have to be thrown out 
and redone just on account of switching libraries.  You don't get dug in so 
deep with library- or framework-specific class names, as it were.  Clojure 
is a great insurance policy.

By the same token, with your own code, you spend so much less time dressing 
stuff up behind made-up APIs, and therefore those APIs are not a source of 
constant churn.  When you really want a hard subsystem boundary you can 
achieve it (same way you would in Java), but most of the time you avoid 
that song-and-dance and just call a duck a duck.  The Clojure way helps 
keep the prototyping stage of the project grounded in pragmatism.

-- 
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: 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 and then use the var.  Misspell the var and the compiler will 
bark at you.  If the var is egg/thunder then every part of the program can 
use it with not much loss of readability.  

If you mark the var as const, is it as efficient too as the keyword literal?

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

One thing those libraries are not, is everything you need.  The art's 
meaning leads elsewhere.  Do not feel limited.  

All in all, I would prefer that you keep Specter independent.  I am glad 
Ring is not in core.  I am glad Schema is not in core.  Works of pragmatism 
don't need to be there.  Greatness is not a one-dimensional space.

-- 
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: 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 behaviors on the uberjarred classpath.  See the sample Lein 
project.clj:

https://github.com/technomancy/leiningen/blob/master/sample.project.clj

-- 
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: 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-to'
user> (integer-sum-to' 3)
6


-- 
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: 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 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: 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 
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: 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 %))) (mapcat :content) 
(filter string?))

;; ("Want this" "Select this")



Other techniques to consider:

- If capable selectors are important, consider Enlive.  It, too, starts 
with what you get from clojure.xml/parse, and it, too, uses zippers inside.

- If you like zippers, with a plain old loop you may use clojure.zip/next 
to traverse the tree and harvest the text nodes you need.  You could even 
look only at text nodes, and query the zipper for their parent...

- If you like zippers and xml->, the functions you can use in an xml-> path 
are not a closed set -- you may make a function that does what you want.


-- 
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: 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 
the uberjar, it simply won't include any of that stuff.

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


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'd 
got my money's worth from reading up to this half-way point.  But I was 
astonished at what came next.  

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


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 Proto-Repl, except that 
Proto-Repl motivated the experiment.

 1. Open empty file b.clj amidst a Clojure project.  Now the mode line says 
"Parinfer:Indent LF UTF-8 Clojure (λ) strict"; the λ is green and "strict" 
is lighter gray. 

 2. Type 
(when true (println "cow 
and the outcome is
(when true (println "cow"))
which is very nice.

 3. Desire to reformat the form on two lines

 3. Position cursor before the (println

 4. Press Enter

 5. Result:
(when true) 
(println "cow")

It has changed the meaning of the program!  By the way, this is different 
from what happens in the parinfer demo 
(http://shaunlebron.github.io/parinfer/demo).  There, the result of the 
same keystrokes is

(when true 
  (println "cow"))

Anyway, proceed:

 6. Try to restore the working state of the program with ^Z to undo:

Result:

(when true)(println "cow")

But that is not something I ever had. 

Is this all working as intended?  How do people keep parentheses from 
rebelling into nonsense in Atom?

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

Comparing two possible inputs

user> (def c (into [] (range 50))) ;; chunked

user> (def n (into '() (range 50))) ;; not chunked

With pmap invoking a function that just returns the thread's name (and
takes some time, so as to keep its assigned thread busy enough not to
accept more tasks right away)

user> (defn f [x] (Thread/sleep 22) (.getName (Thread/currentThread)))
#'user/f
user> (count (distinct (pmap f c)))
32
user> (count (distinct (pmap f n)))
7

The test is not perfect because it does not show that all 32
threads were used *at once*. There were simply 32 distinct threads used at 
one
point or another.  Nonetheless the difference between 7 and 32 is
suggestive.

In this environment there are 4 "processors", so 32 is indeed more than you 
might want.

The docstring about pmap could be clearer about this.

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


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-clojurescript-case-constants.html, 
which uses it to illustrate a rip-snorting new feature of ClojureScript's 
version of the case form.  According to that page, --

in ClojureScript, the same case henceforth yields *2*!

Is the same change coming to Clojure itself?

-- 
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: 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 to migrate to Clojure 
and they are very quietly going to do something completely different.  That 
would be a bad thing and its taxonomic order would be "incidental 
complexity".

Maybe ClojureScript's super-charged "case" could move over to "case*"?

At any rate, I would like to put in either a documentation issue (if it's a 
feature that ClojureScript's "case" does not work like Clojure's) or else a 
defect issue (if it's a bug).  

In a way, this is a question of "easy" vs "simple".  Easy, to let 
ClojureScript accidentally differ (hey, it's better) and just document it. 
 Simple, to have one harmonious core language.

So I am inclined to put it in as a defect, even though I prefer 
ClojureScript's "case". 

-- 
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: 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 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: 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. During the transition your program would remain operable. 
 There is more than one way to do this.  

In any case you would prepare by writing array-to-map and map-to-array 
translator functions (with very short names).  Then you could modernize a 
function by converting its arguments to maps on their way in, and 
converting outputs to arrays on their way out.  Eventually your program 
would contain a ton of a->m and m->a calls and you could decide whether you 
had the attention span to finish the job and get rid of them.  

A twist on this technique, if attention span permits, would involve less 
noise but more work at the outset:  adapt every function, all at once, with 
an adapter of its inputs, m?->a because initially all functions want 
arrays.  Then there will be no need to instrument the functions' outputs. 
 As you convert each function to desire maps instead of arrays, switch its 
m?->a to a?->m. Here the translators have question-marks because they 
should pass-through the parameter without changing it if it's already the 
right shape.  When every function has been switched over to a?->m, all the 
arrays will have vanished into the history books and you may remove the 
adapters.

-- 
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: 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 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: 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 
been.  The watchdog, too, would be a leaky sieve, but it would be likely to 
detect egregious violations, whatever their cause.

-- 
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: 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
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: 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-wrights may substitute them for the matching unmarked originals on the 
fly. 

Perhaps if done consistently with the Contributor Agreement the markup 
could eventually be merged in, but, on the other hand, perhaps lasting 
advantages would be found in the outboard arrangement.

-- 
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: 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 
about perspective is that there could be so many.  I like "Clojure 
Programming" by Emerick, Carper & Grand.  

-- 
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: 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 
and do the necessary?  Until then, further discussion is pointless.  

Speaking of which, my 2c is that the very use of "concat" is a sign you are 
not counting nanoseconds.  Safety first!

-- 
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: 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 require alias on two Clojure core 
namespaces... which makes the REPL's perspective pretty clear:

--8<--

user=> (ns org.draintheaquifers.pickle (:require [clojure.string :as a]))
nil
org.draintheaquifers.pickle=> (ns org.draintheaquifers.pickle (:require 
[clojure.set :as a]))

IllegalStateException Alias a already exists in namespace 
org.draintheaquifers.pickle, aliasing clojure.string 
 clojure.lang.Namespace.addAlias (Namespace.java:224)

--8<--

Stand-alone (require ...) forms are incremental, but (ns) is usually 
all-encompassing. I think I would prefer ns to remap the given aliases 
without complaint.

-- 
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: 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 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 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, which isn't type hinted. Not finding .drawstring it will throw an 
exception. If AWT calls back on a thread other than your REPL thread then 
you might not notice the exception. Long story short, it can help to add 
try/catch. Then what to do in the catch? Log a message. println might or 
might not work, depending on the REPL and the threading. If println does 
not help then you can either open a file and write to it, or you might as 
well use a real logging library, e.g., clojure.tools.logging in conjunction 
with one of the Java libraries it deals with, such as Logback. Setting up 
logging in Java is tedious but very worth-while.

-- 
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: 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 of "(try 
(future (catch (throw".

-- 
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: 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 
reference back to it for a while.  After "a while", of course, you get the 
picture and fling all books aside (until the next one comes out).  

-- 
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 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 
webapp according to its instructions, and zipping it back up again 
(including the MANIFEST stuff as the very first entries).

-- 
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: 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
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: 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 
asking about weirdnesses in Java and Javascript that are crimping one's 
side-effects. 

-- 
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: 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 in your program.  Then your documentation report 
generator can use the metadata you attached.  (You wouldn't generate 
documentation directly from the source code text, of course.)  Since 
metadata is data structures, not just strings, the sky is the limit. 

By the way, there has also been discussion of best or expected use of the 
:arglists metadata.  Sometimes the arities you want to express in 
documentation differ from actual implementation, such as [& xs].  So 
probably you will not want a very rigid correspondence between your 
per-arity docstrings and the arities the compiler is aware of.

-- 
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: 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 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: 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 owing to the inefficiency of factoring out tiny-tiny 
functions!  

-- 
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: 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 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: 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 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] 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.  Tastes great *and *less filling!

So, endure the demo.  The deadpan showmanship does not disappoint.  
Materially, there is fun stuff to think about, springing from the first 
four-fifths of the video.  Imagine what clojure.org could do along these 
lines, or what clojuredocs might do.  But don't get sidetracked before you 
reach the big idea.  The fifth fifth.

-- 
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: 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, 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: 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 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] 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 are borne by the server.  Lacinia bears 
them.  The chores left to your Clojure data service are considerably less 
onerous than GraphQL.

Meanwhile, Lacinia seems to have no overbearing opinions.  For example, you 
may analyze the whole breadth and depth of a Lacinia-parsed GraphQL query 
and optimize retrieval from some back-end database.  But you need not.  And 
Lacinia won't even notice the difference.

Lowering the barrier to providing GraphQL services, Lacinia promotes an 
open and interoperable internet.

Five gold stars.  

>

-- 
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: 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 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: 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 
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: `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 
uberjar version of the program?  The first instance of the MediaPlayer 
lasts only a few milliseconds (during which it starts playing), then it is 
supplanted by the second instance, whereupon instance No.1 becomes eligible 
for garbage collection.  When someone presses 'M' it's the second 
MediaPlayer that plays.  

-- 
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: 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, be within the powers 
of auto-completing editors to disfavor undocumented symbols in other ns.  

-- 
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] 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/measure [mm nn])
"1.8 MB"


Can we free some of that memory?

user=> (def mm nil)
#'user/mm
user=> (mm/measure nn)
"1.8 MB"
user=> (System/gc)
nil
user=> (mm/measure nn)
"1.8 MB"


-- 
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: 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 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] 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@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: 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 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: 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@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: 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 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: 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-reserved method names?

What should the documentation explain about portability?  Should the list 
of implicitly-reserved method names be documented?

In any case, unless the OP of ticket 1791 cares to reclassify it as a 
documentation enhancement, someone will need to start a new ticket.  Also, 
if someone has a sturdy theory about better error messages, punch in a 
second new ticket.  The two tickets can be complementary, and proceed at 
their own pace.

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


  1   2   3   >