Re: Q: How to parse stream of text (from java.io.Reader) via instaparse with minimal input consuption

2015-01-31 Thread henrik42
n find the source at https://github.com/henrik42/extended-lisp-reader/blob/master/src/extended_lisp_reader/stream_parser.clj In https://github.com/henrik42/extended-lisp-reader/blob/master/src/extended_lisp_reader/instaparse_adapter.clj you find (parser-for) that builds an instaparse parser that pa

Extending the LispReader with "embeded language lorms"

2015-01-31 Thread henrik42
to Clojure target form is missing in the examples). If you're interested have a look at https://github.com/henrik42/extended-lisp-reader What do you think? Henrik -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this g

Re: Extending the LispReader with "embeded language lorms"

2015-01-31 Thread henrik42
*LOL* Can anybody change the title to "embeded language forms"? :-) -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with y

Re: Extending the LispReader with "embeded language lorms"

2015-02-09 Thread henrik42
Not anybody? I'm a little puzzled: is this feature so useless? I thought embedding stuff like CSV data in Clojure code "as is" could be a nice feature. https://github.com/henrik42/extended-lisp-reader#parsing-csv No need to rewrite it in Clojure syntax/string literals or other

Re: Extending the LispReader with "embeded language lorms"

2015-02-10 Thread henrik42
@Luc: I see your points. Thanks for the reply. Just to make it clear: all I suggest is to integrate https://github.com/henrik42/extended-lisp-reader/blob/master/src/extended_lisp_reader/core.clj into clojure.core - i.e. make #[...]-forms and the delegation to user code "official". T

Re: XPATH/XSLT like access to Clojure data structures?

2015-02-28 Thread henrik42
Thanks. But I'm looking for something that may (a) clojure.walk a clojure data structure (b) let me use clojure.match rules to say what I'm interested in (like xpath does) and (c) use zippers to 'mutate'. - Henrik -- You received this message because you are subscribed to the Google Groups "Cloj

Delivering HTML documentation to end-users via uberjar

2015-04-09 Thread henrik42
Hi, I'd like to ship my app *incl. documentation* as an uberjar to end-users and give them access to the docs via HTTP. I plan to use codox/marginalia/markdown-clj to produce the HTML in lein build and then build the uberjar incl. the generated HTML. The app will have a CLI but as a plus I'd li

Help: Markdown in Leiningen project :description not recognized by codox

2015-04-13 Thread henrik42
Hi, I'd like to use Markdown in the description of my Leiningen project.clj: (defproject foo "0.1.0-SNAPSHOT" :description "*foo* is my project" :plugins [[codox "0.8.11"]] :codox {:defaults {:doc/format :markdown}} [...]) But its not working. Markdown in function descriptions is working

Re: [BUG?] loading Clojure source files from various data sources (classloading)

2015-05-23 Thread henrik42
Hi Alex, I did some experimenting with Clojure and RMI and tried some things with classloading. The READE at https://github.com/henrik42/rmi-examples is long-ish - sorry. At the end I used (defmacro compile-with-cl [body] (.addURL @Compiler/LOADER (java.net.URL. "http://127.0.0.1:8080/

Re: [BUG?] loading Clojure source files from various data sources (classloading)

2015-06-05 Thread henrik42
Hi, I hacked a small example. https://github.com/henrik42/stuff/blob/master/require-example/java/RequireExample.java Testes with 1.5.1. - Henrik -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email

Suggesting destructuring with :merge

2015-06-15 Thread henrik42
Hi all, I have a function *(defn foo [a b & {:keys [c d] :or {c "C" d "D"} :as opt-args}] [a b opt-args])* I want to let users call *(foo 1 2 :e "E")* and get *[1 2 {:e "E", :c "C", :d "D"}]*. But *:or* only affects the binding of *c* and *d* - not *opt

Re: Working on a patch to add Clojure for Spring dynamic language support

2014-09-22 Thread henrik42
Hi Adan, not sure if it helps, but defining Spring beans that call Clojure code is straight forward: You can find more examples at https://github.com/henrik42/spring-break I've played around with the Spring scpting API but as far as I can tell it won&

[ANN] Spring/Clojure integration

2014-10-03 Thread henrik42
7;re interested have a look at https://github.com/henrik42/spring-break I'm still writing on it. Feedback is very much appreciated. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroup

[UPDATE] Spring/Clojure integration / Clojure functions via JMX

2014-10-18 Thread henrik42
Hi folks, I added code that lets you call your clojure functions via JMX operations. https://github.com/henrik42/spring-break#jmxmbeans Cheers Henrik -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email

[UPDATE] Spring/Clojure integration / changing Clojure references via JMX attributes

2014-11-10 Thread henrik42
Hello again, just in case anybody is following this - I added stuff that lets you publish your mutable references (atom, ref, var) as JMX attributes so that you may use jconsole to change things at runtime. https://github.com/henrik42/spring-break#changing-mutable-state-references-via-jmx

Q: How to parse stream of text (from java.io.Reader) via instaparse with minimal input consuption

2015-01-06 Thread henrik42
Hi all, I want to parse a stream of text which comes from a java.io.Reader with https://github.com/Engelberg/instaparse. But the stream of text will only start with what can be parsed by my grammar. The rest of the text stream must be consumed/parsed with some other grammar. I know of instpars

[Q] How to consume stdout/stderr from remote nREPL session while session call is still running?

2016-07-02 Thread henrik42
Hi, I'm using an nREPL server as an sshd replacement for Windows. I'm doing things like unzip files, copy files, calling shell (bat/cmd/git bash) scripts local to the nREPL process. The scripts write to stdout/stderr. Some of the scripts produce **A LOT** of output so I'm not using clojure.jav

Re: Component and company with Spring?

2017-04-14 Thread henrik42
I did the opposite - build Spring beans with clojure - https://github.com/henrik42/spring-break#defining-clojure-based-spring-beans HTH Henrik -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email

Numbers/math in Clojure

2017-06-24 Thread henrik42
Hi, I'm doing a little write-up on Java basics and comparing some of them to Clojure (things like mutable shared state, side effects and so on). When I came to "numbers" I was surprised by some of the things I found in Clojure. (== (double 0.5) (float 0.5)) ;; -> true (== (double 0.2) (fl

Re: Numbers/math in Clojure

2017-06-24 Thread henrik42
gt; More: > http://steve.hollasch.net/cgindex/coding/ieeefloat.html > > https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/ > Thanks for your reply. Yes, I know. Here https://github.com/henrik42/java-quiz#numberquiz I wrote down some of the "inter

[Q] Transparently call functions remotely via nREPL?

2018-04-10 Thread henrik42
Hi, I'm calling some functions a,b and c via ring/compojure. I would like to be able to switch to "remote invocation of a, b and c via nREPL" without changing my ring/compojure routes. I know I can just code that into a, b and c,(not good, not-dry) but I was wondering if there is a lib that sup

Re: [Q] Transparently call functions remotely via nREPL?

2018-04-29 Thread henrik42
Hi, I ended up using https://github.com/technomancy/robert-hooke -- like this: ,,,(:require [clojure.tools.nrepl :refer :all]) (defn remote-eval [conn code] (let [{:keys [value err]} (-> (client conn 1000) (message {:op :eval

[Q] How to load Clojure as part of Wildfly module?

2019-02-06 Thread henrik42
ne that loads my code base. After that Clojure finds clojure/core.clj without problems. Any ideas on how to do without this hack? Henrik [1] https://github.com/henrik42/buttle/ [2] https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/RT.java#L2174 [3] https://github.com/henrik

Re: [Q] How to load Clojure as part of Wildfly module?

2019-02-07 Thread henrik42
Rastko - thanks for the reply. My /modules/buttle/main/module.xml looks like this: And the driver in standalone.xml: The loading of my classes incl. clojure.lang.RT works "in principle". Only when Clojure

[ANN] buttle 0.1.0 -- A proxying JDBC driver with hooks

2019-03-21 Thread henrik42
Hello, I just did my very first release to clojars. https://github.com/henrik42/buttle *Buttle* is a proxying JDBC driver with hooks. It can be used like any other JDBC driver and lets you do testing, debugging, monitoring etc. Hope someone finds this usefull. Sincerely, Henrik -- You

[Q] Deploying two artefacts/jars with same group/artefactid via Leiningen

2019-03-28 Thread henrik42
Hi, I have an uberjar that I want to deploy to clojars. Part of building the uberjar is building the "standard" lib-jar of the same project. Now I'd like to release/deploy both with the same group/artefactid to clojars. The uberjar should get the :classifier "app". So after that people could lei

Re: [Q] Deploying two artefacts/jars with same group/artefactid via Leiningen

2019-04-05 Thread henrik42
@Francis Great that works. Thank's! The deploy task expects a repo argument in this case though. So I came up with this: https://github.com/henrik42/buttle/blob/1.0.0/plugin/leiningen/deploy_driver.clj With this I can use this in project.clj https://github.com/henrik42/buttle/blob/m

[Q] How to release with Leiningen and `with-profile`?

2019-04-05 Thread henrik42
I'd like to do a `lein with-profile +local-repo release` and `lein with-profile +clojars release`. This way I want to control which repo the deploy goes to. I tried but it didn't work. Here you find my attempt: https://github.com/henrik42/buttle/blob/master/project.clj#L92 Look

Re: Calling Java from Clojure

2019-06-11 Thread henrik42
a) in Java, so that IDE autocompletion, generics etc. work as excepted. HTH Henrik [1] https://github.com/henrik42/spring-break Example: Am Montag, 10. Juni 2019 17:34:25 UTC+2 schrieb eglue: > > > I find the glue code is actually small in practice (I've done a couple >

Re: Calling Java from Clojure

2019-06-12 Thread henrik42
I hacked just that a few days ago to support Java development at work: https://github.com/henrik42/deeto Not released yet but could be a starter in that direction. Henrik -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this g

[ANN] Deeto - A Java dynamic proxy factory for interface-typed data transfer objects

2019-07-03 Thread henrik42
(via reflection) the interface class and then give you a factory for it. Deeto returns Java dynamic proxys which implements `Cloneable` and `Serializable`. The proxy has sane `equals`, `hashCode` and `clone` implemetations. It's available now on Clojars. Henrik [1] https://github.com/henrik42/deeto/

Re: [ANN] Deeto - A Java dynamic proxy factory for interface-typed data transfer objects

2019-07-04 Thread henrik42
Yes! I agree. This is for people how want/must stay with Java for reasons. There are people in the Clojure community who work on Java-Clojure-integration and this is one of man ways to go. I just hope it is useful for someone. It could even be a door opener for Clojure and more people (like you

Re: How can find something inside heavily nested data structure ?

2015-08-22 Thread henrik42
I like using tree-seq and core.match when working on instaparse ASTs - like this: (require ['clojure.core.match :as 'm]) (def s [{"n" {"id" "a"} "d" 2 "children" [{"n" {"id" "c"} "d" 4 "children" nil}]} {"n" {"id" "b"} "d" 3 "children" nil}]) ;; top-down-traversal (defn nodes [x] (tree-seq

Re: How can find something inside heavily nested data structure ?

2015-08-23 Thread henrik42
OK, so in this special case you one would just use (def s [{"n" {"id" "a"} "d" 2 "children" [{"n" {"id" "c"} "d" 4 "children" nil}]} {"n" {"id" "b"} "d" 3 "children" nil}]) (some (fn [x] (and (map? x) (some #{{"id" "c"}} (vals x (tree-seq coll? seq s)) --