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,

Truly, we live in the garden of edn

2020-08-28 Thread Harold
Hello, I hope all are safe and doing well in these perplexing times. Today, again, while working on the server side of an HTTPS api that transparently serves clients who speak different languages (some JSON and some edn, using the delightful muuntaja <https://github.com/metosin/muunt

Re: Keys in EDN maps: keywords or symbols

2019-10-25 Thread James Reeves
As you point out, symbols in edn have no inherent meaning; it's entirely up to how you interpret them. However, if you saw the symbol "clojure.core/conj" in an edn file, then the chances are that it's intended to refer to a Clojure function. Similarly, the symbol "PI

Re: Keys in EDN maps: keywords or symbols

2019-10-25 Thread Anton Vodonosov
Thank you for responses. The last two arguments do not resolve the doubt, however: 1. symbols also implement IFn: (require 'clojure.edn) ('a (clojure.edn/read-string "{a 1 b 2}")) => 1 2. EDN does not specify any evaluation model, so how can a symbol designa

Re: Keys in EDN maps: keywords or symbols

2019-10-24 Thread James Reeves
ding map values. > > {username "vasya" email "a@b.c"} > Sure, but if I'm reading the edn spec correctly, the intention is that symbols *in isolation* should identify something. So if I just wrote: username What does that identity? If it has no identity beyond i

Re: Keys in EDN maps: keywords or symbols

2019-10-24 Thread David Chelimsky
I think James talking about resolution of values when he said "designates", not "the value bound to a key in the map." In other words, the keyword :email resolves to the keyword :email, whereas the symbol clojure.core/vec resolves to a function. Keywords-as-keys give you some benefits when

Re: Keys in EDN maps: keywords or symbols

2019-10-24 Thread Anton Vodonosov
Regarding the idea that a keyword is an identifier that designates itself, while a symbol is a keyword that designates something else. Keys in config file map do not designate themselves, they designate the corresponding map values. {username "vasya" email "a@b.c"} Here the EMAIL

Re: Keys in EDN maps: keywords or symbols

2019-10-24 Thread James Reeves
In edn, a keyword is an identifier that designates itself, while a symbol is a keyword that designates something else. This means keys in a map should generally be keywords, unless they identify something beyond themselves. For example: {:profiling/function-count {clojure.core/vec 10

Re: Keys in EDN maps: keywords or symbols

2019-10-24 Thread Jason Felice
My personal opinion is to prefer keywords, and prefer less preprocessing of the configuration before the program uses it. If it gets to a place where the configuration changes a lot, and a "natural" (read: clojure-like) expression of the configuration in EDN has either a lot of

Keys in EDN maps: keywords or symbols

2019-10-23 Thread Anton Vodonosov
I'm working on a config file format in EDN, and in doubt: should I use keywords or symbols as map keys. After all, the colon is an extra keyboard press - an extra effort for users. As EDN parser doesn't evaluate expressions, there is no need to quote symbols when using them as EDN map keys

Re: regex in edn?

2019-03-29 Thread Alex Miller
There are edn impls in at least 15 languages so the problem is wider than just java and js. -- 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

Re: regex in edn?

2019-03-29 Thread Matching Socks
erent to each regex library. Worse (or better), suppose you wrote a Java regex into the EDN file, and tried to read the EDN in JS, and the regex constructor threw an exception? A slightly more esoteric issue might also arise. https://github.com/edn-format/edn says, "edn is a system for

Re: regex in edn?

2019-03-29 Thread Ikuru Kanuma
Thanks for the reply! Glad to have confirmations. -- 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.

Re: regex in edn?

2019-03-29 Thread Alexander Yakushev
Not adding much to what you've already said, but a custom reader tag is exactly what I would reach out for in this 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

regex in edn?

2019-03-29 Thread Ikuru Kanuma
Hi, just writing this out of pure curiosity. Background: 1. I thought I could write regex literals like this in an edn file containing configurations: :some-parameter #"foo" But reading this with e.g. clojure.edn/read-string causes an error No dispatch macro for: " 2.

Re: [ANN] CRNTL: An ANSI C reader for Clojure/EDN content

2018-07-01 Thread Colin Fleming
That's really taking Friday afternoon commits to the next level! On 30 June 2018 at 21:42, Edwin Watkeys wrote: > Hey all, > > Have you ever wanted to read Clojure or EDN without using Clojure(Script)? > If so, feel free to check out CRNTL (C Reader for the Next Thousand Lisps) >

[ANN] CRNTL: An ANSI C reader for Clojure/EDN content

2018-06-30 Thread Edwin Watkeys
Hey all, Have you ever wanted to read Clojure or EDN without using Clojure(Script)? If so, feel free to check out CRNTL (C Reader for the Next Thousand Lisps) at: https://github.com/thunknyc/crntl CRNTL is a new project and is incomplete, but I hope some will find it useful as-is. I wrote

Re: Proper way to write EDN file, after production bug

2018-03-30 Thread LaurentJ
I mean just print-dup and print-meta should be enough ! Le vendredi 30 mars 2018 14:31:04 UTC+2, LaurentJ a écrit : > > Yes we will set print-dup, print-meta, print-level and print-length to > have a properly formatted edn file. > > Le vendredi 30 mars 2018 05:55:50 UTC+2,

Re: Proper way to write EDN file, after production bug

2018-03-30 Thread LaurentJ
Yes we will set print-dup, print-meta, print-level and print-length to have a properly formatted edn file. Le vendredi 30 mars 2018 05:55:50 UTC+2, Didier a écrit : > > Ya, I'd write a wrapping fn, like ->edn which internally binds everything > to what it should be, maybe even d

Proper way to write EDN file, after production bug

2018-03-29 Thread Didier
Ya, I'd write a wrapping fn, like ->edn which internally binds everything to what it should be, maybe even declares some extra print defmethod if you need custom edn serialization, and returns the edn. -- You received this message because you are subscribed to the Google Groups "Clojur

Re: Proper way to write EDN file, after production bug

2018-03-29 Thread LaurentJ
I guess we will do that and provide an helper function in an util namespace to write an EDN file safely :/ By the way does binding *print-dup* to true isn't enough to prevent any interaction of other options like : *print-length* *print-level* ? Le jeudi 29 mars 2018 21:16:54 UTC+2, Rick

Re: Proper way to write EDN file, after production bug

2018-03-29 Thread Rick Moynihan
ay, our pipeline was broken because of an EDN file with > ellipsis in it. > > It appears that the file was generated from a Clojure env with > *print-length* configured. > So as many have asked, do we have a better way to write EDN file other > than using prn ? > > For the

Proper way to write EDN file, after production bug

2018-03-29 Thread LaurentJ
Hello, A funny bug today, our pipeline was broken because of an EDN file with ellipsis in it. It appears that the file was generated from a Clojure env with *print-length* configured. So as many have asked, do we have a better way to write EDN file other than using prn ? For the moment what

Re: How to call a function read from an EDN file?

2018-03-13 Thread Simon Luetzelschwab
erence to the return value of reading in the config file that you can pass as the first argument to the function google-apps-clj.credentials/get-auth-map or just pass (edn/read-string (slurp "config/google-creds.edn")) as the first argument directly. While I haven't used the library myse

How to call a function read from an EDN file?

2018-03-12 Thread Christopher Lee
down votefavorite <https://stackoverflow.com/questions/49245041/how-to-call-a-function-read-from-an-edn-file#> Clojure noob here. After reading in the google-creds.edn file like so: "(edn/read-string (slurp "config/google-creds.edn"))" How do I call the function get

Re: [ANN] com.walmartlabs/dyn-edn 0.1.0

2018-02-23 Thread Ravindra Jaju
I've had one too on similar lines for quite some time https://github.com/jaju/properties-clj Primarily used for the `properties` format, but it supports EDN too via the `read-edn` function. This library uses the almost-BASH syntax for picking env variables with default ${USER:some-user} would

Re: [ANN] com.walmartlabs/dyn-edn 0.1.0

2018-02-20 Thread Alan Thompson
l "jdbc:postgresql://db.example.org:5432/accounts"]} :web-server {:port 8192}} On Fri, Feb 16, 2018 at 2:20 PM, Howard Lewis Ship <hls...@gmail.com> wrote: > > com.walmartlabs/dyn-edn 0.1.0 > > Tiny library to allow dynamic data when parsing EDN; useful f

Re: [ANN] com.walmartlabs/dyn-edn 0.1.0

2018-02-16 Thread Howard Lewis Ship
Oh, yea, very similar. I wasn't tracking, and the overlap is significant. dyn-edn is just one part, packaged as small as possible, about 90 lines of code. aero looks similar to io.aviso/config (itself very small), but big enough to be noticable. dyn-edn is intended to just plug into whatever

[ANN] com.walmartlabs/dyn-edn 0.1.0

2018-02-16 Thread Howard Lewis Ship
com.walmartlabs/dyn-edn 0.1.0 Tiny library to allow dynamic data when parsing EDN; useful for configuration files. https://github.com/hlship/dyn-edn For example: {:connection-pool {:user-name #dyn/prop [DB_USER "accountsuser"] :user-pw #dyn/prop DB_PW :url #dyn/join ["

[ANN] specter-edn 0.1.4

2017-07-17 Thread Jason Felice
Thanks again to Marcelo! Various bugfixes to handling of derefs, non-printable nodes, anonymous functions, metadata, and key order in maps. specter-edn https://github.com/maitria/specter-edn/ Format-preserving Specter path for EDN and Cloure code. There is one specter path: SEXPRS

[ANN] specter-edn 0.1.3 - Format-preserving transforms for EDN and CLJ

2017-05-30 Thread Jason Felice
More thanks to Marcelo!: - Fix for nils in collections - Fix for rebuilding of maps - Ensure whitespace between adjacent tokens after a transform Also, the code in the README has been corrected. specter-edn https://github.com/maitria/specter-edn/ Format-preserving Specter path

Re: [ANN] specter-edn 0.1.2

2017-05-16 Thread Jason Felice
And, I forgot the link: https://github.com/maitria/specter-edn > > -- 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 - p

[ANN] specter-edn 0.1.2

2017-05-16 Thread Jason Felice
Thank you to Marcelo Nomoto for bug fixes and updating the dependencies! specter-edn Specter paths for working with formatted EDN and Cloure code. There is one specter path: SEXPR. This navigates to a sequence of s-expressions parsed from a string. For the transform case, specter-edn preserves

Re: Storing Clojure spec's in edn files?

2017-01-13 Thread david swift
being fixed.) > > > > On Friday, January 13, 2017 at 3:19:03 PM UTC-6, david swift wrote: >> >> I was curious and wondering if it is possible (and if so how) to store >> Clojure spec's in edn files? >> >> I've an idea of (dynamically) loading spec's from say a resource/spec

Re: Storing Clojure spec's in edn files?

2017-01-13 Thread Alex Miller
ssible (and if so how) to store > Clojure spec's in edn files? > > I've an idea of (dynamically) loading spec's from say a resource/spec > folder of app using some form of a lookup function and then use that > analysis the code; > I say this as I was looking to implement a kind of

Storing Clojure spec's in edn files?

2017-01-13 Thread david swift
I was curious and wondering if it is possible (and if so how) to store Clojure spec's in edn files? I've an idea of (dynamically) loading spec's from say a resource/spec folder of app using some form of a lookup function and then use that analysis the code; I say this as I was looking

[ANN] edn-java 0.5.0 released

2016-12-11 Thread Ben Smith-Mannschott
edn-java [1] is a parser and printer for edn [2]. This release: * Can read namespaced maps as per CLJ-1910 [47] * Throws an exception when asked to read a map or set with duplicates [49] It should be appearing on Maven Central shortly. // Ben [1] http://edn-java.bpsm.us [2] https

Re: should edn/read call close() on the PushbackReader?

2016-09-02 Thread Thomas Heller
In general Java it is up to the creator of a "stream" to close it, the same applies to Clojure pretty much. Java has "try with resources" and in Clojure you can use "with-open": (with-open [rdr (open-the-reader)] (edn/read rdr {})) This will ensure .close is c

should edn/read call close() on the PushbackReader?

2016-09-02 Thread John Valente
Running on Windows, I found that I could not delete an edn file that I had read from. I've looked at a few examples of reading edn, and none of them seem to suggest that the user code should explicitly call close() on the Java object, or that it needs to use with-open. Should I be doing

[ANN] eq - A command line tool for edn

2016-06-12 Thread Jonas
Hi! I've been working on a command line tool for edn processing and pretty printing. The project is available at https://github.com/jonase/eq and it is heavily inspired by jq (https://stedolan.github.io/jq/). Eq could be a very useful tool if you're working a lot with edn data (for example via

[ANN] specter-edn 0.1.0

2016-06-11 Thread Jason Felice
Hello, all! Here's a new library which works with specter, which will hopefully be useful for writing code transformations and queries. specter-edn Specter paths for working with formatted EDN and Cloure code. There is one specter path: SEXPR. This navigates to a sequence of s-expressions

Limit print depth and level while still allowing form to be parseable as EDN

2016-02-06 Thread Jason Gilman
When *print-length* and *print-level* are set the forms printed are not always parseable as EDN. See this example: (require 'clojure.edn) (clojure.edn/read-string (pr-str {:a 1 :b 2 :c 3 :d 4})) => RuntimeException Map literal must contain an even number of forms This occurs because the va

Re: A call for an idiomatic rendering of Clojure EDN in info/error messages

2015-11-14 Thread Colin Yates
the literal 2 or a string containing 2. To >> interpret it correctly you must know more than just the literal text, >> therefore it isn’t a great choice. >> >> The choice of delimiter seems independent of how to render the value in >> question. To my mind there's

A call for an idiomatic rendering of Clojure EDN in info/error messages

2015-11-13 Thread Colin Yates
Hi all, Can we, the community agree a consistent way of rendering Clojure EDN when we report it in info or error. For example, given the EDN "2" (i.e. a string containing a single character 2) I have seen various libraries render it as: - 2 - "2" - ["2"]

Re: A call for an idiomatic rendering of Clojure EDN in info/error messages

2015-11-13 Thread Steve Miner
, Colin Yates <colin.ya...@gmail.com> wrote: > > Hi all, > > Can we, the community agree a consistent way of rendering Clojure EDN when we > report it in info or error. For example, given the EDN "2" (i.e. a string > containing a single character 2) I have seen

Re: A call for an idiomatic rendering of Clojure EDN in info/error messages

2015-11-13 Thread Jason Felice
at 6:55 AM, Colin Yates <colin.ya...@gmail.com> wrote: > > > > Hi all, > > > > Can we, the community agree a consistent way of rendering Clojure EDN > when we report it in info or error. For example, given the EDN "2" (i.e. a > string containing a sing

Re: A call for an idiomatic rendering of Clojure EDN in info/error messages

2015-11-13 Thread William la Forge
As a newbie, a red warning flag pops up when I see a back tick. :-) -- 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

Re: A call for an idiomatic rendering of Clojure EDN in info/error messages

2015-11-13 Thread Yuri Govorushchenko
s://google.github.io/styleguide/objcguide.xml?showone=Implementation_Comments#Implementation_Comments пятница, 13 ноября 2015 г., 13:55:40 UTC+2 пользователь Colin Yates написал: > > Hi all, > > Can we, the community agree a consistent way of rendering Clojure EDN when > we report it i

Re: A call for an idiomatic rendering of Clojure EDN in info/error messages

2015-11-13 Thread Colin Yates
tation_Comments > > <https://google.github.io/styleguide/objcguide.xml?showone=Implementation_Comments#Implementation_Comments> > > пятница, 13 ноября 2015 г., 13:55:40 UTC+2 пользователь Colin Yates написал: > Hi all, > > Can we, the community agree a consistent way of

Re: A call for an idiomatic rendering of Clojure EDN in info/error messages

2015-11-13 Thread Atamert Ölçgen
gt; > // Remember to call |StringWithoutSpaces("foo bar baz")| > > > -- > https://google.github.io/styleguide/objcguide.xml?showone=Implementation_Comments#Implementation_Comments > > пятница, 13 ноября 2015 г., 13:55:40 UTC+2 пользователь Colin Yates > написал: >&

Re: A call for an idiomatic rendering of Clojure EDN in info/error messages

2015-11-13 Thread Ben Wolfson
elimiter seems independent of how to render the value in question. To my mind there's exactly one correct, and obviously correct, way to render an EDN value which is a string containing the single character \2, and it's the second one: "2" If you want to refer to the value by wrapping

Re: A call for an idiomatic rendering of Clojure EDN in info/error messages

2015-11-13 Thread Colin Yates
ld_ interpret that as either the literal 2 or a string containing 2. To > interpret it correctly you must know more than just the literal text, > therefore it isn’t a great choice. > > The choice of delimiter seems independent of how to render the value in > question. To my mind there'

Re: A call for an idiomatic rendering of Clojure EDN in info/error messages

2015-11-13 Thread Alan Thompson
a validation library and it reported [:a :b :c must >> be “2”] you _could_ interpret that as either the literal 2 or a >> string containing 2. To interpret it correctly you must know more than >> just the literal text, therefore it isn’t a great choice. >> > > The choic

Re: A call for an idiomatic rendering of Clojure EDN in info/error messages

2015-11-13 Thread Fluid Dynamics
+1 for | -- 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

Re: A call for an idiomatic rendering of Clojure EDN in info/error messages

2015-11-13 Thread Gary Trakhman
Fri, Nov 13, 2015 at 1:55 PM, Colin Yates <colin.ya...@gmail.com> > wrote: > >> Hi all, >> >> Can we, the community agree a consistent way of rendering Clojure EDN >> when we report it in info or error. For example, given the EDN "2" (i.e. a >>

Re: A call for an idiomatic rendering of Clojure EDN in info/error messages

2015-11-13 Thread Colin Yates
gt;> On Fri, Nov 13, 2015 at 1:55 PM, Colin Yates <colin.ya...@gmail.com >> <mailto:colin.ya...@gmail.com>> wrote: >> Hi all, >> >> Can we, the community agree a consistent way of rendering Clojure EDN when >> we report it in info or error. For example, give

Re: A call for an idiomatic rendering of Clojure EDN in info/error messages

2015-11-13 Thread Atamert Ölçgen
Hi Colin, Why not just "2"? On Fri, Nov 13, 2015 at 1:55 PM, Colin Yates <colin.ya...@gmail.com> wrote: > Hi all, > > Can we, the community agree a consistent way of rendering Clojure EDN when > we report it in info or error. For example, given the EDN "2"

Re: A call for an idiomatic rendering of Clojure EDN in info/error messages

2015-11-13 Thread Colin Yates
> Why not just "2"? > > On Fri, Nov 13, 2015 at 1:55 PM, Colin Yates <colin.ya...@gmail.com > <mailto:colin.ya...@gmail.com>> wrote: > Hi all, > > Can we, the community agree a consistent way of rendering Clojure EDN when we > report it in info or er

[ANN] edn-java 0.4.6 released

2015-10-25 Thread Ben Smith-Mannschott
edn-java [1] is a parser and printer for edn [2]. This release: * Teaches the default parser to produce values that can participate in Java serialization. [3] It should be appearing on Maven Central shortly. // Ben [1] http://edn-java.bpsm.us [2] https://github.com/edn-format/edn [3] https

Re: Timbre corrupting EDN via prn-str

2015-10-07 Thread Atamert Ölçgen
DEBUG and other > log messages from Timbre. > > Is there any way to turn a Clojure data structure into EDN without mucking > around with things like pr-str that use *out*, which apparently is used for > logging, among other things? > > -ken > > -- > You received th

Re: Timbre corrupting EDN via prn-str

2015-10-07 Thread Ken Restivo
; > > > > > > > However, I'm also using Timbre for logging. > > > > > > > > My nice data structure is getting corrupted by INFO and DEBUG and other > > > > log messages from Timbre. > > > > > > > &

Timbre corrupting EDN via prn-str

2015-10-07 Thread Ken Restivo
I was trying to save a data structure using prn-str. However, I'm also using Timbre for logging. My nice data structure is getting corrupted by INFO and DEBUG and other log messages from Timbre. Is there any way to turn a Clojure data structure into EDN without mucking around with things like

Re: Timbre corrupting EDN via prn-str

2015-10-07 Thread Ken Restivo
> > I was trying to save a data structure using prn-str. > > > > However, I'm also using Timbre for logging. > > > > My nice data structure is getting corrupted by INFO and DEBUG and other > > log messages from Timbre. > > > > Is there any way to turn

Re: Timbre corrupting EDN via prn-str

2015-10-07 Thread Atamert Ölçgen
11:18 AM, Ken Restivo <k...@restivo.org> wrote: > > > > > I was trying to save a data structure using prn-str. > > > > > > However, I'm also using Timbre for logging. > > > > > > My nice data structure is getting corrupted by INFO and DEBUG and

Re: Timbre corrupting EDN via prn-str

2015-10-07 Thread Tassilo Horn
Ken Restivo writes: > Only when conch is called, is this error generated. Not shelling out > makes the problem go away. So it's an interaction between pr-str, > conch and/or clojure.java.shell, and Timbre-- all three of which are > manipulating *out* which I'm guessing is not

Re: clojure edn function reader

2015-05-28 Thread Leon Grapenthin
and imports. Clojures namespace API is very mature and concise so an implementing it should be fun. On Wednesday, May 27, 2015 at 3:02:30 PM UTC+2, ronen wrote: Hey, I'm looking for an edn data read for clojure functions (similar to https://github.com/Datomic/day-of-datomic/blob/master/resources/day

Re: clojure edn function reader

2015-05-28 Thread Gary Verhaegen
that it is just as bad as read security-wise.) Or perhaps you already have a clear idea of what you would want to do with the data structures in your edn file, and you're actually asking about how to register your custom literal reader with the edn reader? On Thursday, 28 May 2015, Herwig Hochleitner

Re: clojure edn function reader

2015-05-28 Thread ronen
Gary your last comment hits what I look for exactly: If you are looking for an encoding of clojure's syntax extensions into pure edn reader tags (as my crystall ball tells me you might be), I haven't encountered such a thing yet, even though it's conceivable. My use case is to pass functions

Re: clojure edn function reader

2015-05-28 Thread ronen
Leon spot on, maybe ill get to implement such a thing :) On Friday, May 29, 2015 at 2:44:04 AM UTC+3, ronen wrote: Gary your last comment hits what I look for exactly: If you are looking for an encoding of clojure's syntax extensions into pure edn reader tags (as my crystall ball tells me

Re: clojure edn function reader

2015-05-28 Thread Herwig Hochleitner
2015-05-27 18:14 GMT+02:00 ronen nark...@gmail.com: 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 https://github.com/edn-format/edn#inst-rfc

clojure edn function reader

2015-05-27 Thread ronen
Hey, I'm looking for an edn data read for clojure functions (similar to https://github.com/Datomic/day-of-datomic/blob/master/resources/day-of-datomic/clojure-data-functions.edn) Is there any known implementation? Thanks -- You received this message because you are subscribed to the Google

Re: clojure edn function reader

2015-05-27 Thread ronen
Ok ill expand the question a bit hoping to make it clearer :) I'm well aware of read/read-string and the security implications they bring (not interested in those), Clojure EDN has support for literal tags https://github.com/edn-format/edn#inst-rfc-3339-format and the ability of extending

Re: clojure edn function reader

2015-05-27 Thread Andy Fingerhut
in edn format. They have limitations, of which I don't remember them all, but IIRC at least one is that they cannot read back in records in some of the ways that Clojure code can print them out. They work well when the data you have is just lists, vectors, sets, maps, and primitive types

Re: [ANN] Baum - Extensible EDSL in EDN for configuration files

2015-04-11 Thread Ryo Fukumuro
Thanks for releasing this. I've started using it for a configuration file that was previously an edn file. I was mainly interested in the import and include features but have now started using the eval macro to replace some repetitive parts of the file with for loops. I'll admit that using eval

Re: [ANN] Baum - Extensible EDSL in EDN for configuration files

2015-04-10 Thread Geoff Salmon
Hi Ryo Thanks for releasing this. I've started using it for a configuration file that was previously an edn file. I was mainly interested in the import and include features but have now started using the eval macro to replace some repetitive parts of the file with for loops. I'll admit

[ANN] Baum - Extensible EDSL in EDN for configuration files

2015-04-04 Thread Ryo Fukumuro
Hi all, I'd like to announce the release of Baum. https://github.com/rkworks/baum Baum, my first public library for Clojure, is designed to create self-contained configuration files. It allows you to include the following things in your configuration files: - References to external files -

Re: Edn, Fressian, Transit: which of these formats have a future?

2015-03-20 Thread Ryan Schmitt
Thanks for this breakdown; a lot of what you're saying about Transit is stuff I had inferred from prior announcements, but it's still enlightening to see an explicit comparison to Edn and Fressian. On Sunday, March 15, 2015 at 7:51:55 PM UTC-7, Alex Miller wrote: Hi Ryan, To answer the big

Re: Edn, Fressian, Transit: which of these formats have a future?

2015-03-20 Thread Ryan Schmitt
you a sense of how it works: public interface Album extends DynamicObjectAlbum { @Key(:artist) String getArtist(); @Key(:album) String getAlbum(); @Key(:tracks) int getTracks(); @Key(:year) int getYear(); } String edn = {:artist \Meshuggah\, :album \Chaosphere\, :tracks 8, :year

Re: Edn, Fressian, Transit: which of these formats have a future?

2015-03-17 Thread Andrey Antukh
this small usage example from the README to give you a sense of how it works: public interface Album extends DynamicObjectAlbum { @Key(:artist) String getArtist(); @Key(:album) String getAlbum(); @Key(:tracks) int getTracks(); @Key(:year) int getYear(); } String edn = {:artist

Re: Edn, Fressian, Transit: which of these formats have a future?

2015-03-16 Thread Lucas Bradstreet
(:album) String getAlbum(); @Key(:tracks) int getTracks(); @Key(:year) int getYear(); } String edn = {:artist \Meshuggah\, :album \Chaosphere\, :tracks 8, :year 1998}; Album album = DynamicObject.deserialize(edn, Album.class); album.getArtist(); // = Meshuggah dynamic-object has

Re: Edn, Fressian, Transit: which of these formats have a future?

2015-03-15 Thread Alex Miller
typed values. edn is the best choice for human-readable data. It is however, less efficient to transmit and depends on writing a high-performance parser - this is a high bar in some language environments. edn is most attractive right now to Clojure users b/c of its proximity to Clojure itself

Edn, Fressian, Transit: which of these formats have a future?

2015-03-15 Thread Ryan Schmitt
you a sense of how it works: public interface Album extends DynamicObjectAlbum { @Key(:artist) String getArtist(); @Key(:album) String getAlbum(); @Key(:tracks) int getTracks(); @Key(:year) int getYear(); } String edn = {:artist \Meshuggah\, :album \Chaosphere\, :tracks 8, :year 1998

Re: should edn recognise defrecord?

2015-02-27 Thread Colin Yates
http://www.compoundtheory.com/clojure-edn-walkthrough/ is a nice read around this as well. On Tuesday, 24 February 2015 21:40:14 UTC, Colin Yates wrote: I am sending instances of defrecords from clojurescript via transmit/edn and getting: 2015-Feb-24 19:23:52 + dev-os-mbp.local DEBUG

Re: should edn recognise defrecord?

2015-02-25 Thread Colin Yates
Thanks miner. I see, so I have to treat each record individually. Never mind - I was only using defrecord so I could dispatch on class and protocols. multi-methods and keywords will suffice here. Thanks again. On Tuesday, 24 February 2015 22:04:55 UTC, miner wrote: The edn format does

should edn recognise defrecord?

2015-02-24 Thread Colin Yates
I am sending instances of defrecords from clojurescript via transmit/edn and getting: 2015-Feb-24 19:23:52 + dev-os-mbp.local DEBUG [taoensso.sente] - Bad package: [[:client/message #health.shared.domain.PingCommand{}]] (clojure.lang.ExceptionInfo: No reader function for tag

Re: should edn recognise defrecord?

2015-02-24 Thread Steve Miner
The edn format does not include records. The transit README gives an example of how to write a transit handler for a record. See the section on extensibility. https://github.com/cognitect/transit-format#extensibility https://github.com/cognitect/transit-format#extensibility Before transit

[ANN] edn-java 0.4.5 released

2015-01-28 Thread Ben Smith-Mannschott
edn-java [1] is a parser and printer for edn [2]. This release: * Incorporates a patch from 'redahe' to fix issue 40 where and were not recognized as symbols. [3] It is available on Maven central as I write this. [1] http://edn-java.bpsm.us [2] https://github.com/edn-format/edn [3

Re: Backslashes in Edn

2014-11-26 Thread Andy Dwelly
Update. I've played around with pr-str and prn-str in the repl, and discovered that they both should work fine. In fact it turns out that my problem is nothing to do with Edn or anything Clojuresque at all, and in fact everything to do with the database that's responsible for the storage

Backslashes in Edn

2014-11-25 Thread Andy Dwelly
I've recently been serialising some data using Edn, and to date this has caused no problems. During some tests today, I serialised a string representing a file path that originated on a windows machine \My Documents\somedoc.txt. Edn throws a runtime exception when reading this back claiming

Re: Backslashes in Edn

2014-11-25 Thread Jonathan Winandy
​Hi Andy, ​ If I stick with Edn are there any other gotchas that should be sanitised ? The specs of String literals is a bit implicit : https://github.com/edn-format/edn#strings refers to https://docs.oracle.com/javase/specs/jls/se7/html/jls-3.html#jls-3.10.6 . I think there are no ways

Re: Backslashes in Edn

2014-11-25 Thread James Reeves
On 25 November 2014 at 12:23, Andy Dwelly andydwe...@gmail.com wrote: I've recently been serialising some data using Edn, and to date this has caused no problems. During some tests today, I serialised a string representing a file path that originated on a windows machine \My Documents

Re: Backslashes in Edn

2014-11-25 Thread Andy Dwelly
...@gmail.com javascript: wrote: I've recently been serialising some data using Edn, and to date this has caused no problems. During some tests today, I serialised a string representing a file path that originated on a windows machine \My Documents\somedoc.txt. Edn throws a runtime exception when

Re: best way to edit EDN value in cljs

2014-10-11 Thread Dylan Butman
in your tree and then returning an edited version. On Friday, October 10, 2014 2:28:26 PM UTC-4, Dustin Getz wrote: I have an arbitrarily nested EDN value stored in an atom in ClojureScript. What is the best way to make edits to an arbitrary subtree of this value? -- You received

best way to edit EDN value in cljs

2014-10-10 Thread Dustin Getz
I have an arbitrarily nested EDN value stored in an atom in ClojureScript. What is the best way to make edits to an arbitrary subtree of this value? -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure

Re: best way to edit EDN value in cljs

2014-10-10 Thread Mike Fikes
Can you use update-in or assoc-in? On Friday, October 10, 2014 2:28:26 PM UTC-4, Dustin Getz wrote: I have an arbitrarily nested EDN value stored in an atom in ClojureScript. What is the best way to make edits to an arbitrary subtree of this value? -- You received this message because you

Unmarshalling EDN to Java Object

2014-10-08 Thread Timur
Hi everyone, One can use into-edn [1] to convert from Java objects to EDN structures. Is there a way to convert EDN structures to their original Java objects? Regards, Timur [1] https://github.com/thebusby/into-edn -- You received this message because you are subscribed to the Google

Re: Unmarshalling EDN to Java Object

2014-10-08 Thread Mark Mandel
I'm sure you can, but you would need to implement your own custom methods to do it, using :readers or :default options in edn/read / edn/read-string It would very much depend on the format of the outputted EDN as to which approach to take. Mark On 9 October 2014 07:12, Timur timurha

careful w/ edn injection

2014-07-11 Thread Ignacio Thayer
we noticed this possibility of edn injection when mixing validated and unvalidated data into a single edn blob. it's hard to exploit, and in some sense it's obvious but i thought i'd share it since it caught us off-guard and requires greater care than when serializing w/ json for example. Given

Re: careful w/ edn injection

2014-07-11 Thread James Reeves
Ring uses a post condition to guard against this: (defn- ^String serialize [x] {:post [(= x (edn/read-string %))]} (pr-str x)) - James On 11 July 2014 20:13, Ignacio Thayer itha...@gmail.com wrote: we noticed this possibility of edn injection when mixing validated and unvalidated data

Re: careful w/ edn injection

2014-07-11 Thread Ignacio Thayer
serialize [x] {:post [(= x (edn/read-string %))]} (pr-str x)) - James On 11 July 2014 20:13, Ignacio Thayer itha...@gmail.com wrote: we noticed this possibility of edn injection when mixing validated and unvalidated data into a single edn blob. it's hard to exploit, and in some sense

  1   2   3   >