Re: 'foldcat' slower than 'mapv' even for 10,000 elements

2013-06-17 Thread Herwig Hochleitner
Interesting. A possibly stupid question: the input coll is a vector, right? Can you provide a representative example? 2013/6/17 Jim - FooBar(); > Hi again, > > I'm finding that (r/foldcat (r/map f coll)) is consistently slower than a > simple mapv, even for a collection of 10,000 elements and

Re: In what OS do you code?

2013-06-17 Thread Herwig Hochleitner
Gentoo on my pcs and servers. + the occasional ssh shell from my keyboarded android tablet. 2013/6/17 Angel Java Lopez > Windows 8 at work > Windows 2008 Server at home > > Lot of Node.js, C#, Java, PHP coding. Few Clojure, only spikes or little > sample, using REPL, sometimes lein > > Angel "J

Re: Multiple args: opts map vs inline arguments

2013-06-18 Thread Herwig Hochleitner
The keyword arguments vs. (apply (apply)) issue has come up before: https://groups.google.com/d/topic/clojure-dev/9ctJC-LXNps/discussion My take is: Use keyword arguments wherever appropriate and keep apply-kw handy: http://dev.clojure.org/jira/browse/CINCU-3 2013/6/18 Softaddicts > I use destr

Re: 'foldcat' slower than 'mapv' even for 10,000 elements

2013-06-19 Thread Herwig Hochleitner
I've got a quadcore machine here: user=> (c/bench (porter-stem words)) Evaluation count : 2220 in 60 samples of 37 calls. Execution time mean : *27.571133 ms* Execution time std-deviation : 317.554208 mus Execution time lower quantile : 26.797791 ms ( 2.5%) Execution time

Re: try* macro to catch multiple exception classes with one body. feedback is needed.

2013-06-20 Thread Herwig Hochleitner
One thing to consider: try* is a compiler builtin form. Those are currently not even namespaced. That might lead to confusion for readers. 2013/6/20 Max Gonzih > I updated my macro to your solution, looks really simple and works like > before. I don't know why I overcomplicated my original solu

Re: Let bindings and immutability

2015-02-11 Thread Herwig Hochleitner
I think that, from a user perspective, the important difference from mutation to shadowing is, that outer x is available even in the inner context, if captured by a closure. Likewise, a second thread, that runs an outer closure, would see the original x. Observe: (let [x :outer f (fn [] x)

Re: Let bindings and immutability

2015-02-11 Thread Herwig Hochleitner
2015-02-12 3:06 GMT+01:00 gvim : > > That explains it but I think Clojure's syntax is misleading here. Without > knowledge of this magic the mind doesn't readily translate: > > In some other lisps, clojure's let is called let* for this reason. Their let binds only in parallel, similar to clojure's

Re: OO Programmer trying to move to Clojure: Encapsulation

2015-02-11 Thread Herwig Hochleitner
Hm, the most common way to encapsulate in clojure is with a closure: Your account repository would be: (defn account-repository [connection] ;; <- here goes additional constructor logic (fn save [account] (sql-save connection account)) If the repository has more methods than just save, y

Re: Performant string concatenation (of many, large strings)

2015-02-11 Thread Herwig Hochleitner
The most versatile way to do this is a pattern, I like to call concatenated lists of strings. You implement the parts as functions returning sequences of strings. You combine parts with concat. And map parts over input data with mapcat. Interpose and interleave have the role of str/join. Another u

Re: Performant string concatenation (of many, large strings)

2015-02-11 Thread Herwig Hochleitner
Also, since you probably want defined order of columns for CSV, replace (map #(interpose ", " (vals %))) with (map #(interpose ", " (map % [:one :two :three :four]))) in the str - sequence version or #(eduction (comp (map val) (interpose-xf ", ")) %) with #(eduction (comp (map %) (interpose

Re: getting enlive not to parse something

2015-02-14 Thread Herwig Hochleitner
Enlive by default uses tagsoup to parse html and can also use jsoup, so I'd start with parsing options for those. It can also be used with other parsers, provided you can get them to generate clojure's xml map format. 2015-02-13 18:55 GMT+01:00 Sam Raker : > I'm trying to parse some stuff with en

Re: Name of a function

2015-02-14 Thread Herwig Hochleitner
Well, one of the many reasons, that clojure is faster than bash is, that during compilation, code is divorced from the original source symbols. That means you can only access information about the original source that you, or some library code you use, put in there for you. Jony stated correctly,

Re: [ANN] Dunaj project, an alternative core API for Clojure

2015-03-17 Thread Herwig Hochleitner
2015-03-12 12:15 GMT+01:00 Jozef Wagner : > > Experiment #5: Reducers First > > Wow! There are some great ideas on how to unify reducers with lazy-seq. Have there yet been thoughts on how reduce-kv could fit in a reducer stack? Obviously, the notion of a transducer could be extended to allow dis

Re: Curious behavior of syntax quote?

2015-03-25 Thread Herwig Hochleitner
I've not dived deeply into it, but could this come from two lines above? https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/LispReader.java#L837 As to why: PersistentList can only be consed from another PersistentList, where as Cons can be consed from any ISeq. Relatedly, Cons is

Re: How do I create streaming XML response?

2015-04-20 Thread Herwig Hochleitner
The way enlive does it, is to create a lazy sequence of strings. A response body such as that can be immediately be used by ring. However, I don't know from the top of my head how to generate it from data.xml.​ I'll be glad to get some input on that, otherwise I'll think about this more, the next t

Re: Embedded systems and transpiling Clojure to Nim

2015-05-01 Thread Herwig Hochleitner
I think Nim is pretty cool (conceptionally, haven't used it yet) and full of wonderous features: From the hands down awesome, like the a la carte GC, its AST - based macros and optimizations and effect system to positively weird stuff like its partial case-insensitivity (foo-bar == fooBar == foo_ba

Re: Embedded systems and transpiling Clojure to Nim

2015-05-01 Thread Herwig Hochleitner
I have seen it. PyPy (the platform for pixie) hasn't the reach of even LLVM, let alone plain C, so while there might be overlap in other areas, pixie is a no-starter for non-mainstream hardware. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post

Re: Embedded systems and transpiling Clojure to Nim

2015-05-01 Thread Herwig Hochleitner
Tim, I went with what I saw on http://pypy.org/features.html "... runs on Intel x86 (IA-32) , x86_64 and ARM platforms, with PPC being stalled ...". Not sure if that's just for the JIT, but if it were, they would list non-JIT platforms separately, no? I'm aware, that you use RPython directly, but

Re: Clojure needs a web framework with more momentum

2015-05-03 Thread Herwig Hochleitner
​To me, the idea of a framework is embodied by a set processing tools, whose primary design goal is to work best in concert with each other. I rather enjoy working with libraries, whose primary design goal is to work well in any technology stack. I don't think those are mutually exclusive, but work

Re: Embedded systems and transpiling Clojure to Nim

2015-05-03 Thread Herwig Hochleitner
Tim, I agree that porting enough of rpython to run pixie seems like the best way to get started on a given bare-metal platform. Not least because pypy's contributors would certainly be sympathetic to that effort. Still, a piece that I'd really love to see is, what I call rclojure: That is, tools

Re: Clojure needs a web framework with more momentum

2015-05-03 Thread Herwig Hochleitner
2015-05-03 16:27 GMT+02:00 Fluid Dynamics : > > So, basically, Clojure *is* the framework? :) > > Exactly! As is any language that you choose to work in. That means that buying into at least one framework is nessecary to get started with programming anyway. With clojure, the predominant attitude s

Re: Embedded systems and transpiling Clojure to Nim

2015-05-04 Thread Herwig Hochleitner
2015-05-05 2:04 GMT+02:00 Alan Moore : > > > Herwig - I like your suggestion re: rclojure. That seems like a harder > but more fruitful approach than other porting options. Do you have any > references to this kind of approach in other languages? > > It could be argued, that compilers doing escape

Re: Dynamic/Convention-based routing libraries? (was: Clojure needs a web framework with more momentum

2015-05-05 Thread Herwig Hochleitner
Cool Idea! Convention based routing is a great way to get started quickly and I think that it actually might make a lot of people, asking for clojure frameworks, happy. I'm not aware of any clojure lib that does that, but I'd like to speculate a bit on what it might mean: As it happens, when I hea

Re: Why (defn- ...) but (def ^:private? ...)

2015-05-07 Thread Herwig Hochleitner
2015-05-07 16:12 GMT+02:00 Stig Brautaset : > Is it because the def form can also be ^:dynamic? > Hm, cognitect turned it down, because basically "if you go down this road, why stop with def- ? and before you know, you've got a core namespace full of def*-" > At any rate, I did an attempt at my f

Have a look at pretial and apply-to

2015-05-09 Thread Herwig Hochleitner
I've uploaded a proposal / working code in literate programming style to github: https://gist.github.com/bendlas/0722a35ab274d659c507 I'd be delighted if you took the time to read it through, maybe try it out and tell me what you think of it. This is not strictly a proposal for core just now, an

Re: Have a look at pretial and apply-to

2015-05-11 Thread Herwig Hochleitner
The compositional advantage with cojure's convention collection-arg first is pretty much the point. -> is to pretial, what ->> is to partial. The improvement is more than syntactical: pretial lets you swap out or preprocess whole arms of the computation at the value level. Macro's don't help with t

Re: Need advice/idiom to reduce number of parameters in functions

2015-05-13 Thread Herwig Hochleitner
In functional programming you can do a similar thing as in OOP: Define your functions as closures that can access common arguments via lexical scope. So instead of creating a context object, you create functions: (defn make-context [some context parameters] {:op1 (fn [x] ...) :op2 (fn [y] ...

Re: clojure edn function reader

2015-05-28 Thread Herwig Hochleitner
2015-05-27 18:14 GMT+02:00 ronen : > Ok ill expand the question a bit hoping to make it clearer :) > Still not clear to me, but I'll try to expand a bit in the hope of showing what is unclear. Clojure EDN has support for literal tags > and

Re: Get anonymous function's(which is parameter to function) body in called function

2015-05-28 Thread Herwig Hochleitner
I'd definitely go with 1.), because the `exec` in 2.) is basically `eval` and thus should be used most sparingly. You can also expand on 1.) by using a macro, that stores the source and other debugging information in metadata and thus get all the benefits of 2.) and then some. -- You received thi

Re: Get anonymous function's(which is parameter to function) body in called function

2015-05-28 Thread Herwig Hochleitner
2015-05-28 19:22 GMT+02:00 Mohit Thatte : > Changing wait-until to a macro seems like the simplest way to tackle this. > It gives you access to pred at compile time, does not force the caller to > add meta-data to pred, and you can construct the error message as you like. > I was actually thinkin

Re: Get anonymous function's(which is parameter to function) body in called function

2015-05-28 Thread Herwig Hochleitner
2015-05-28 19:42 GMT+02:00 Mohit Thatte : > > The interesting question here is what constitutes useful information! > (let [pred #(exists? ".foo")] (wait-until pred)) ;; <- the fact that it's called 'pred is not interesting in most cases > The trade-off is breaking an existing public API. > H

Re: Handling exceptions with Reader Conditionals

2015-06-03 Thread Herwig Hochleitner
2015-06-02 23:57 GMT+02:00 Daniel Compton : > On the Reader Conditionals > dev > discussion page at one part it talks about exception handling: > > "Exception handling, catching "all" - see issue below on why this is not a > complete solu

Re: roundtripping using data.xml?

2015-06-23 Thread Herwig Hochleitner
Matching Socks, thanks for mentioning the design page I created. I haven't pushed anything recently, but I'm still working on the rewrite implementing the proposal: https://github.com/bendlas/data.xml I've also made a library, that uses a snapshot from my rewrite to implement a WebDAV server: http

Re: transducer (+ closures) efficiency question

2015-06-24 Thread Herwig Hochleitner
2015-06-24 1:25 GMT+02:00 Ben Wolfson : > On Tue, Jun 23, 2015 at 4:17 PM, Ghadi Shayban wrote: > >> >> Tangentially: >> (remove even?) >> Will be faster than >> (remove (fn [i] (even? i))) >> because in the first case the dereference of the var 'even?' happens only >> once and the value inside t

Re: transducer (+ closures) efficiency question

2015-06-24 Thread Herwig Hochleitner
2015-06-24 18:19 GMT+02:00 Ben Wolfson : > > I meant a difference in speed. > > A var-root fetch is a volatile read, which can have several adverse performance effects. Most importantly, it hinders inlining, since the JIT has to place a guard for every inlining site of a volatile read, thus it won

Re: java method overloading and clojure interop

2015-07-07 Thread Herwig Hochleitner
2015-07-07 15:04 GMT+02:00 Jo Geraerts : > > * multiply(long x) > * multiply(double x) > * multiply(Number x) > > In clojure i want to do something like > > (defn multiply[^MonetaryAmount amount multiplicant] > (.multiply amount multiplicant)) > Function parameters in Clojure, are generally pass

[ANN] lein-collisions: a plugin to find classpath collisions

2015-07-08 Thread Herwig Hochleitner
Dear Community, I'm releasing https://github.com/webnf/lein-collisions Running it on your projects and libraries is highly recommended, because classpath collisions can be the source of some very confusing errors and inconsistencies. thanks -- You received this message because you are subscrib

Re: java method overloading and clojure interop

2015-07-09 Thread Herwig Hochleitner
05:20:51 UTC+2 schreef Herwig Hochleitner: >> >> The way I would do it: Define multiply as a function calling (.multiply >> amount ^Number x), for higher order usage, and then add an :inline function >> to its metadata, which returns `(.multiply ~amount ~x). >> That acts

Re: [ANN] lein-collisions: a plugin to find classpath collisions

2015-07-09 Thread Herwig Hochleitner
[lein-collisions "0.1.2"] now working properly with resource directories​ -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient

Re: [ANN] lein-collisions: a plugin to find classpath collisions

2015-07-09 Thread Herwig Hochleitner
2015-07-08 18:41 GMT+02:00 Kevin Corcoran : > > The projects on which I work already use lein's :pedantic? flag. Is there > any reason we might want to use lein-collisions instead of :pedantic? > > Hi Kevin, if I understand :pedantic correctly, it catches cases, where transitive dependencies wou

Re: [ANN] lein-collisions: a plugin to find classpath collisions

2015-07-09 Thread Herwig Hochleitner
​So long story short, you want both :pedantic and lein-collisions -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with you

Re: [ANN] lein-collisions: a plugin to find classpath collisions

2015-07-13 Thread Herwig Hochleitner
2015-07-09 19:01 GMT+02:00 Andy Fingerhut : > I think it would be helpful to include that text in your README on Github > somewhere. > Done. Good idea, thanks Andy! -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to

Re: [ANN] lein-collisions: a plugin to find classpath collisions

2015-07-14 Thread Herwig Hochleitner
2015-07-13 18:50 GMT+02:00 Tim Gilbert : > > http://pastebin.com/js93Mrzw > > ...and in fact the only way I can get it to pass dependency checks is if I > add a lot of :exclusions, up to and including org.slf4j/slf4j-api at which > point it aborts with a runtime error "java.lang.ClassNotFoundExcep

Re: Understanding when compilation occurs - for function producing functions

2014-06-22 Thread Herwig Hochleitner
2014-06-22 9:12 GMT+02:00 Reid McKenzie : > > since there's no other way that we can take a > function "as a value" prior to JVM 1.8 which has bytecode lambdas and > which the reference Clojure implementation doesn't leverage yet if ever. > Java 8 gained no such feature. Lambda expressions are sy

Re: [ClojureScript] [ANN] Cats: category theory abstractions library for clojure(script).

2014-07-11 Thread Herwig Hochleitner
Hello Andrey, after having spent some time with Haskell lately, trying to wrap my head around those categorical abstractions, I enjoy your take on them a lot. At first glance, I feel your design blends in with clojure's style very well. Also, congratulations on the documentation, it's a great rea

Re: Re-upload corrupted Rich Hickey video?

2014-07-15 Thread Herwig Hochleitner
2014-07-16 0:18 GMT+02:00 gvim : > "Clojure for Lisp Programmers Part 1" by Rich Hickey: > > http://www.youtube.com/watch?v=cPNkH-7PRTk > > seems to have become corrupted. Can anyone re-upload the original? I can confirm that it's cut off at 6:35 in all resolutions. I hope ClojureTV still h

Re: multiple file upload

2014-08-03 Thread Herwig Hochleitner
I'm not sure how that would be handled with noir. With plain ring, you would use the multipart-params middleware [1] to get a :multipart-params submap in the request, in which all uploaded files are passed. At this point you can process them with (doseq [[param-name {:keys [filename content-type b

Re: CLJS Function clobbering js function of same name

2014-08-03 Thread Herwig Hochleitner
To clarify on David's comment, js/console puts a literal 'console' identifier into the generated js. In your example, js/console is shadowed, because (defn console[] js/console) is emitted as ns.console = (function console(){return console;}); The discussion to be had here is whether the (interna

Re: CLJS Function clobbering js function of same name

2014-08-04 Thread Herwig Hochleitner
Ticket'd http://dev.clojure.org/jira/browse/CLJS-833 2014-08-04 0:57 GMT+02:00 David Nolen : > Ah hm, yeah I'm surprised this isn't caught by the existing shadowing > and :js-globals logic. Sure open a ticket, patch welcome of course. > > David > > On Su

Re: CLJS Function clobbering js function of same name

2014-08-04 Thread Herwig Hochleitner
commit d8d8f58df51db7246a2c92f1f863cff502dbcc45 Author: Herwig Hochleitner Date: Mon Aug 4 11:08:12 2014 +0200 CLJS-833 Test for fn-name shadowing commit aa048ad64743ef51538c55163b86a90a02a8940d Merge: 7de3636 bb3adca Author: David Nolen Date: Sat Aug 2 10:45:54 2014 -0400 Merge bran

Re: CLJS Function clobbering js function of same name

2014-08-04 Thread Herwig Hochleitner
, but in the case of an open set of names (such as globals that can differ from runtime to runtime), they are particularly awful. Ad reproducing the issue: Can the shadowing mechanism be influenced by compiler flags such as :advanced? 2014-08-04 14:43 GMT+02:00 Herwig Hochleitner : > That&#

Re: CLJS Function clobbering js function of same name

2014-08-04 Thread Herwig Hochleitner
2014-08-04 16:27 GMT+02:00 David Nolen : > > We don't gensym let bindings - the shadowing logic was added to create > stable names. In fact, we do within statement contexts. I wrote that as a fix for the case (do (let [x 1] (fn [] x)) (let [x 2] (comment clobbered x in fn))) (as well as topl

Re: CLJS Function clobbering js function of same name

2014-08-04 Thread Herwig Hochleitner
Thomas, in my test, (defn console []) is munged aswell, so I'm guessing that Sam is using a version from before https://github.com/clojure/clojurescript/commit/f371c04d95a00cdda79c63f89f35088d62de8e73 Sam, is that correct? The observation that eval should be in js-globals is irrelevant, because as

Re: CLJS Function clobbering js function of same name

2014-08-04 Thread Herwig Hochleitner
2014-08-04 22:28 GMT+02:00 David Nolen : > I meant would not > > > On Mon, Aug 4, 2014 at 4:28 PM, David Nolen > wrote: > >> I would rely on the behavior in the REPL to check this - the REPL >> compilation environment is likely different. >> > Yes, I noticed that ./script/repl has different behav

Re: Transducers are Coming

2014-08-07 Thread Herwig Hochleitner
Thanks Rich! Transducers, like all of your releases, are an eye opener. I've always felt slightly hesitant to use core.async's version of sequence functions, because of the overhead of intermediate channels. Then there was the strictness tradeoff with reducers. All of that complexity, gone from m

Re: HTTP server that supports ring handlers, but asynchronously?

2014-09-03 Thread Herwig Hochleitner
Yet another: I'm using a servlet implementation, that can be deployed in any servlet container supporting servlet api 3.0 (with async) https://github.com/webnf/webnf/tree/master/async-servlet It allows to return a function instead of a regular ring response, that will get an async context to drive

davstore: a buzzword-complete file storage; public demo of namespaced data.xml

2014-09-07 Thread Herwig Hochleitner
Hi Folks! Maybe you remember my 'recent' push for data.xml namespacing support. I've built out most of the stuff, that I had sketched in the design document, but before pushing for an actual release, I'd ask you to evaluate my approach towards namespaced xml. I published the project [1] that actu

Re: Interop nightmare

2014-09-07 Thread Herwig Hochleitner
I'm not familiar with the stanford parser, or nlp, but the `no matching ctor error` is easily explained: According to the doc

Re: [ANN] Clojure 1.7.0-alpha2

2014-09-09 Thread Herwig Hochleitner
2014-09-09 18:54 GMT+02:00 Brent Millare : > Excuse my ignorance but does "volatile!" have anything to do with Java's > "volatile" keyword? Is there any relation at all? I'm not suggesting a name > change, but it can be confusing coming from that angle. Maybe a blurb in > the doc string? > I figu

Re: {ANN} defun: A beautiful macro to define clojure functions with pattern match.

2014-09-14 Thread Herwig Hochleitner
Hi Dennis, marrying core.match to defn is a pretty neat idea. Thanks for releasing it! I see that you actually extended defn in that you made it possible to recur between different arities. Can you give a quick rundown on how you made that work? Are the arities still separate IFn arities? Does it

Re: jetty restart failing

2014-09-15 Thread Herwig Hochleitner
Feel free to steal from my jetty component: https://github.com/webnf/webnf/blob/master/server/src/clj/webnf/server/component.clj 2014-09-15 10:42 GMT+02:00 Sven Richter : > > > Am Montag, 15. September 2014 00:20:21 UTC+2 schrieb Wilker: >> >> I felt that was too much for me, but I'm digging into

Re: jetty restart failing

2014-09-16 Thread Herwig Hochleitner
2014-09-16 8:36 GMT+02:00 Wilker : > Thank you very much Herwig! The (.join jetty) did the trick :D > Cool! The thing I do on startup: (doseq [l (.getConnectors jetty)] (.getLocalPort l)), is my solution to wait until it's come fully up. -- You received this message because you are subscribed

Re: jetty restart failing

2014-09-16 Thread Herwig Hochleitner
2014-09-16 17:28 GMT+02:00 James Reeves : > On 16 September 2014 10:13, Herwig Hochleitner > wrote: > >> >> The thing I do on startup: (doseq [l (.getConnectors >> jetty)] (.getLocalPort l)), is my solution to wait until it's come fully up. >> > > Wh

Re: why (> 2) returns true

2014-09-17 Thread Herwig Hochleitner
2014-09-17 11:51 GMT+02:00 Phillip Lord : > > So, why not special case 1 arg as well, and have that except? It's a > reasonable question. I would submit a bug report and see if anyone else > agrees. Something is wrong for sure. Either (> x) should throw arity, or > (>) should return true, or the d

Re: atom swap! versus ref dosync+alter?

2014-09-30 Thread Herwig Hochleitner
One update taking much longer than the other, isn't optimal for either atoms or refs. In atoms, the faster update wins, which could randomly lead to a stream of faster updates starving few slow updates. I believe refs behave similarly, though if you can make your updates commutative, you can take

Re: Retrieving the namespace an expression in compiled in

2014-10-23 Thread Herwig Hochleitner
FWIW, I've made macros out of parse and emit in my data.xml rework, for this purpose. cheers 2014-10-24 0:32 GMT+02:00 Stephen Gilardi : > > On Oct 23, 2014, at 5:06 PM, James Reeves wrote: > > Or a macro: > > (defn endpoint [config] > (routes >(GET "/" [] (resource/url (this-ns) "index.h

Re: Retrieving the namespace an expression in compiled in

2014-10-24 Thread Herwig Hochleitner
2014-10-24 10:20 GMT+02:00 Brian Guthrie : > Depending on how deep your investment in Compojure is, I've found ... > I'd imagine James' investment with Compojure to be quite substantial, given that he is its primary author ;-) -- You received this message because you are subscribed to the Googl

Re: Demoralising experience trying to install on Win 7

2014-10-25 Thread Herwig Hochleitner
I'd like to chime in with my view on the experiences, that clojure and haskell provide, respectively, if only to highlight some of the upshots. Clojure has been staying very true to its perception as a "hosted language". This caters to my needs very well, because I've found in every real project,

Re: [Patch] Support for DOCTYPE when emitting XML (DXML-10)

2014-10-31 Thread Herwig Hochleitner
Hi Christian, your patch looks, like it should be straightforward to port to my work, but it won't apply as is, since I moved the emitter into its own namespace. I can take care of that, as soon as your CA goes through. Of course, I'd also welcome a patch based on my branch ;-) cheers -- You re

Re: Content-negotiation in compojure web libraries/frameworks the right way (tm)

2014-11-05 Thread Herwig Hochleitner
Liberator is very helpful for this: http://clojure-liberator.github.io/liberator/ 2014-11-05 14:47 GMT+01:00 Miguel Ping : > Hi all, > > What's the best way to do content-negotiation on compojure-based web > frameworks? I know liberator deals with it in a special way, I was > wondering if is ther

Re: Clojure <-> Java

2014-11-09 Thread Herwig Hochleitner
2014-11-08 3:32 GMT+01:00 Blake McBride : > Greetings, > Hi, I am an old lisp guy that is new to Clojure. > Welcome! Lisp can't do that without a real lot of work (make generic functions > evaluate the arguments and then execute the applicable method). > This is exactly what Clojure does, via

Re: [ANN] Clojure 1.9.0-alpha5

2016-06-09 Thread Herwig Hochleitner
2016-06-09 15:32 GMT+02:00 Alex Miller : > > "lein deps :tree" is a good place to start, but it doesn't tell you what's > actually inside the jars. There used to be a Maven plugin that would track > down multiple class definitions across the dependency classpath, can't > remember what it was calle

Re: why is it so annoying to run clojure code

2016-06-09 Thread Herwig Hochleitner
Leiningen is a tool external to clojure, that has project automation in mind. The equivalent to `python script.py` would be `java -jar clojure.jar -i script.clj`. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clo

Re: [ANN] cljsee 0.1.0

2016-06-14 Thread Herwig Hochleitner
+1 thanks for releasing that. I've been thinking about doing this also as a maven plugin. That might help finally getting .cljc accepted in contrib projects. ​ -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to cloju

Re: Is this behavior of clojure.core/pr a bug?

2016-08-04 Thread Herwig Hochleitner
2016-08-04 1:41 GMT+02:00 Timothy Baldridge : > I highly suggest using transit. It's much faster and formally specified. > https://github.com/cognitect/transit-format > > It's issues like this that caused the creation of transit in the first > place. > I thought transit was created to take advan

Re: Is this behavior of clojure.core/pr a bug?

2016-08-04 Thread Herwig Hochleitner
2016-08-04 13:56 GMT+02:00 Timothy Baldridge : > The problem is that many do not understand that Clojure data is a superset > of EDN. The two were never meant to be completely compatible. There are > many things, especially when dealing with keywords and symbols, where its > possible to have data

Re: Parsing namespaced XML with clojure.data.xml

2016-08-21 Thread Herwig Hochleitner
2016-08-20 21:43 GMT+02:00 Matching Socks : > > 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? > Currently

Re: Parsing namespaced XML with clojure.data.xml

2016-08-22 Thread Herwig Hochleitner
I've been thinking this over. I'm starting feel that you are right in that the arbitrary, global mapping could cause more problems, than it would solve. Even if we could get by with a maintained registry, it would still be a burden to maintain and to use. Also, there is the open question of code ex

Re: Parsing namespaced XML with clojure.data.xml

2016-08-28 Thread Herwig Hochleitner
2016-08-25 1:53 GMT+02:00 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. > That's a very good point. Disregarding concerns for edn syntax for a mom

Re: Parsing namespaced XML with clojure.data.xml

2016-09-17 Thread Herwig Hochleitner
2016-09-17 15:10 GMT+02:00 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. > Yep, I've been thinking along those lines as well. We'd

Re: Parsing namespaced XML with clojure.data.xml

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

Re: Parsing namespaced XML with clojure.data.xml

2016-09-28 Thread Herwig Hochleitner
So, your comment about using uri-encoding inspired me to just use that as an encoding to fit in a kw-ns. It seems to work out: https://github.com/bendlas/data.xml/commit/22cbe21181175d302c884b4ec9162bd5ebf336d7 There is a couple of open issues, that I commented on the commit. ​ I'll open a dev-thr

Re: Parsing namespaced XML with clojure.data.xml

2016-09-28 Thread Herwig Hochleitner
http://dev.clojure.org/jira/browse/CLJ-2030 ​ -- 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 un

Re: [ANN] Clojure 1.9.0-alpha13

2016-09-29 Thread Herwig Hochleitner
https://github.com/laurentpetit/ccw.server/pull/1 2016-09-29 14:37 GMT+02:00 Alex Miller : > I think the problem is not on the :or but on the :keys which is being > passed a set rather than a sequential? > > -- > You received this message because you are subscribed to the Google > Groups "Clojure

[ANN] data.xml 0.1.0-beta3

2016-12-05 Thread Herwig Hochleitner
data.xml is a Clojure contrib library that parses and emits XML. Github: https://github.com/clojure/data.xml Changelog: https://github.com/clojure/data.xml/blob/master/CHANGES.md Information on updating the dependency is here . 0.1.0-beta3

[ANN] data.xml 0.2.0-alpha1

2016-12-13 Thread Herwig Hochleitner
data.xml is a Clojure contrib library that parses and emits XML. Github: https://github.com/clojure/data.xml Changelog: https://github.com/clojure/data.xml/blob/master/CHANGES.md Information on updating the dependency is here . The major

Re: [ANN] data.xml 0.2.0-alpha1

2016-12-20 Thread Herwig Hochleitner
Hi Francis, first off: if you can afford it, I'd recommend working with the 0.2.0 series, as the 0.1.0 namespace api is legacy. In the 0.2.0 series, the mapping of keyword prefix to xmlns is unique and fixed, so names are always parsed as keywords (though QName instances still are permitted for e

Re: [ANN] data.xml 0.2.0-alpha1

2016-12-21 Thread Herwig Hochleitner
2016-12-22 5:23 GMT+01:00 Francis Hitchens : > > Hi Herwig, > > Thanks for the quick response. So I upgraded to the latest version and now > I see my tags represented not as QName Java objects but as horribly long > keywords like so... > > xmlns.http%3A%2F%2Fintegration.sprint.com%2Fv2%2Fcommon% >

Re: [ANN] data.xml 0.2.0-alpha1

2016-12-24 Thread Herwig Hochleitner
Sorry for the late response, I had to finish 0.2.0-alpha2, in order to present you with the final API for constructing qnames. Please upgrade. ​::can/mqMessageHeader is a purely syntactic shorthand, which gets expanded by the reader to whatever 'can aliases to in the current namespace. Apparently

[ANN] data.xml 0.2.0-alpha2

2016-12-24 Thread Herwig Hochleitner
data.xml is a Clojure contrib library that parses and emits XML. Github: https://github.com/clojure/data.xml Changelog: https://github.com/clojure/data.xml/blob/master/CHANGES.md Information on updating the dependency is here . 0.2.0-alph

Re: [ANN] data.xml 0.2.0-alpha1

2016-12-29 Thread Herwig Hochleitner
2016-12-29 15:42 GMT+01:00 Francis Hitchens : > Herwig, > > Thanks, I upgraded. The tip about the reader was very useful. So I can now > pass a string representation of my element tag like so and it works... > > (zx/xml1-> zipper >(zx/tag= (eval (read-string "::can/mqMessageHeader"

Re: [ANN] data.xml 0.2.0-alpha1

2016-12-29 Thread Herwig Hochleitner
2016-12-29 15:42 GMT+01:00 Francis Hitchens : > ... to generate my flattened representation of the XML document that I am > putting into a text table to allow testers to easily set values int the > documents as part of their testing... > For that use case, just put the namespace URI into your tex

Re: [ANN] data.xml 0.2.0-alpha1

2017-01-01 Thread Herwig Hochleitner
2017-01-01 17:16 GMT+01:00 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"; >

Re: [ANN] data.xml 0.2.0-alpha1

2017-01-02 Thread Herwig Hochleitner
2017-01-02 15:29 GMT+01:00 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

Re: A more mathematical kind of set object in clojure

2017-01-28 Thread Herwig Hochleitner
There is a talk by Alex Engelberg about constraint solvers and his clojure interface to one of them: https://github.com/aengelberg/loco https://www.youtube.com/watch?v=AEhULv4ruL4 I'm not quite familiar with it, but maybe it's relevant to your requirements. ​ -- You received this message because

Re: A more mathematical kind of set object in clojure

2017-01-28 Thread Herwig Hochleitner
core.logic's CLP(FD) extensions, for finite domains, might also suit your needs: https://github.com/clojure/core.logic/wiki/Features#clpfd​ -- 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 N

Re: A more mathematical kind of set object in clojure

2017-01-29 Thread Herwig Hochleitner
2017-01-29 21:15 GMT+01:00 Michael Lindon : > Not quite what I'm looking for. There is an assigment in the Functional > Programming in Scala coursera course called "funsets" - purely functional > sets. A set is defined by its characteristic functions (a predicate) and > source code can be found he

Re: User input validations, design doubt

2017-02-08 Thread Herwig Hochleitner
2017-02-08 23:14 GMT+01:00 Rastko Soskic : > (let [fns [(fn ([] :empty) ([x] "x")) (fn ([] :format) ([y] "y"))] val > "field value"] > (reduce #(assoc % (%2) (%2 val)) {} fns)) The advantage in this approach is that you can get the keys from a set of validators, but you still need some outside l

Re: User input validations, design doubt

2017-02-08 Thread Herwig Hochleitner
Of course, for performance you can optimize that apply+hash-map+interleave (or even your reduce) into reduce+transients, e.g. by using map-vals .​ -- You received this message because you are

Re: Contribute Specter to Clojure core?

2017-02-14 Thread Herwig Hochleitner
How about making specter into a contrib library?​ -- 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. T

  1   2   3   4   >