Giter Site home page Giter Site logo

edn's People

Contributors

davidrupp avatar ersiner avatar honkfestival avatar richhickey avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

edn's Issues

is 1M a valid floating point number?

The proposed grammar for floating point numbers does not allow: "1M" since at least a frac or exp part is required following the int part. Clojure does allow this. Is this deliberate?

Is `:/` a valid keyword?

The spec says about symbols that "/ by itself is a legal symbol" and continues that "[k]eywords follow the rules of symbols, except they can (and must) begin with a colon, e.g. :fred or :my/fred". So :/ seems to be a valid keyword. Is this intended?

What is a valid 'middle' of a Symbol

The / character is valid in the middle of a Symbol.

Is ./. a valid Symbol? Other questionable Symbols: -/.

Is the rule that the / character may not appear at the end or beginning of a Symbol with more than one character? Is the middle anywhere but the end or beginning of a Symbol with more than one character (which would make sense)? Does this imply the restriction that prefix and name are not allowed to be empty (which would make sense)?

iOS framework?

Hi Rich,

Have you heard of any iOS frameworks for parsing/generating EDN?
If not, I might do one for myself (and open sourcing it afterwards).

Best,
Henrik

specify expected integer size

The floating point numbers states:
64-bit (double) precision is expected.

The integers definition should have an analog statement.
e.g. something like
64-bit (signed integer) precision is expected.

parsing characters should have a prefix to '\'

Most languages will interpret "\r" as a literal escape code in the input stream.

Common Lisp solves this problem by representing characters as #\r

(char "r" 0)
> #\r

Which would make parsing input easier.

Clarifying the definition of 'constituent characters' in Symbols

I found the clisp page on constituent, and that seems to mean that the related character is valid for that element in edn. Is that correct?

I'm confused about where : and # are valid in Symbols. Clearly they can be 'in' a Symbol, and not the first character. The Clojure Reader page says that Symbols ending with : are reserved by Clojure - is that also true of edn? That same Clojure Reader page says that : must be non-repeating. Is that true in edn of : and #?

Ordered Map?

What about an ordered map syntax? Many XML applications use the implicit definition order, maybe using ordered maps is better than using lists for some tasks.

Comments and newlines

Is the newline that terminates a ; comment platform dependant or is it strictly \newline?

Is :/x a valid Keyword?

Does the : fulfill the beginning of a Symbol where the / must be in the middle of a Symbol?

Discard reader macro has possible collision with tags that start with an underscore

According to the edn spec, symbols can begin with an underscore. ("Symbols begin with a non-numeric character and can contain alphanumeric characters and . * + ! - _ ?. If - or . are the first character, the second character must be non-numeric. Additionally, : # are allowed as constituent characters in symbols but not as the first character.")

Tags are symbols prefixed with a pound sign. Therefore, you could have a tag like this: #_cnd/my-snazzy-tag.

#_ is a reader macro used to discard the next value, however. In this case, instead of my tag, I discard the symbol cnd/my-snazzy-tag, which is not what I want.

Should there be a special rule eliminating underscores as the first character of a tag? Or should this be handled a different way?

Would #<...> be valid edn?

Greater than and less than aren't in the symbols section and I would like some clarification. Can you have greater than and less than in tags in edn?

Extra symbols in Symbol

Will other symbols be allowed in Symbol?

I'm thinking of: ~ ` @ $ % ^ & + = | \ < >

I'd love in particular: | and %

Special floating point values have no encoding

The "floating point numbers" section refers to 64-bit double precision -- presumably IEEE-754 -- and specifies how to encode typical numbers, but it does not specify encoding of special values such as NaN or infinities. This is undesirable, as now any object graph that includes any IEEE-754 floating point field could conceivably become unserializable, depending on the value that field contains.

JSON makes no allowances for NaN or +/-Inf, forcing tools to use tricks like serializing these values as strings, and coercing certain strings ("NaN") back into their floating-point counterparts on deserialization. Not only does this add semantics on an ad-hoc basis outside the JSON specification, it is simply too much magic for my taste. On the other hand, YAML provides .inf, -.Inf, and .NAN as language-independent tokens representing these particular floating point values. I find this much preferable, as it causes no ambiguity.

I'd like the encoding of these values to be specified, since edn seems to be aiming at general-purpose data interchange, and the set of floating point numbers includes these special values.

Is "#_ #_ 1 2 3" equivalent to "#_ 1 #_ 2 3"?

It's not clear to me if "#_ #_ 1 2 3" is equivalent to "#_ 1 #_ 2 3". This is the case in Clojure's LispReader, but I thought I'd ask to be certain.

(One could argue for "#_ #_ 1 2 3" being equivalent to "1 2 3" if the first #_ were to eat the second.)

Escaping of quotes and backslashes in strings

Escaping of double quotes and backslashes in strings is not specified at all.

I would assume that:

  • "foo\\bar" => foo\bar
  • "foo\"bar" => foo"bar

And the clojure implementation confirms this. It should be specified in edn though.

suggestion: char literals \ should not quote white space

I assume that character literals are intended to be like those in Clojure, however these are legal in Clojure:

\<an actual space>
\<an actual newline>
\<an actual return>
\<an actual tab>

I don't think it would be a good idea to support these in edn as they are hard for a human to read unambiguously. I'd suggest requiring:

\space
\newline
\return
\tab
...

and disallowing whitespace immediately following the \ introducing a
character literal.

EDN Schemas?

Considering EDN is a simpler XML, can we also get a simpler XSD?

David Nolen and I were discussing the potential for formalizing the ClojureScript AST. My first thought was that I wish I had an AST validator, like the ASTValidator.java in Google Closure. My next thought was "I'm sure core.logic could make this very easy". I typed not more than two sentences of notes on this topic before I thought: This smells an awful lot like XML Schemas...

Regex tag?

Is there a high probability of a built-in tag for regex?

regex "something"

isn't that much shorter than

tld.company/regex "something"

I'm just curious.

is "foo/-0bar" an acceptable symbol?

"If - or . are the first character, the second character must be non-numeric. Additionally, : # are allowed as constituent characters in symbols but not as the first character."

So, is "foo/-4bar" allowed or not? It would seem allowed, but this has the unfortunate property that the we're left with an unreadable symbol if we strip the prefix: "-4bar".

Make the tag output capable of be consumed by another tag or specify it can't

Suppose you have defined the #x/table tag which takes a list with a header and rows to increase a little the readability and diminish the data length:

 #x/table ((:name   :surname  :age)
           ("bob"   "smith"   33)
           ("miles" "davis"   83)
          )

This tag will yield the list ({:name "bob" :surname "smith" :age 33}, {:name "miles" :surname "davis" :age 83}). My question is: can you give this output value as an input to another tag handler? Like by doing:

#x/othertag #x/table ((:name   :surname  :age)
                      ("bob"   "smith"   33)
                      ("miles" "davis"   83)
                     )

By reading the EDN spec I think is not clear if you can compose tags or not, maybe the phrase "This value is the value to be returned to the program and is not further interpreted as edn data by the reader." prohibits it.

So, will the reader pass the value returned by the #x/table handler as the input of the #x/othertag handler? That will be nice, in any case needs to be clear in the spec if is permitted or not.

support for metadata?

I noticed that the relevance/edn-ruby lib is supporting metadata e.g.
^{:doc "This is my vector" :rel :temps} [98.6 99.7]

Is this going to be part of the official edn spec? At the very least I can imagine suggesting that languages which do not have support for metadata can treat it as a comment/discard?

Spec versions for implementations to state compliance

It might be helpful for implementations to have the ability to state exactly what version of the spec they conform to.

'Though this might only be most useful as the spec solidifies and likely won't be useful after the final BNF is published - assuming the definition of Edn is stable after that.

Can literal tags contain periods?

The Clojure reader currently does not allow periods in tagged literals (see http://dev.clojure.org/jira/browse/CLJ-1100). The EDN spec is unclear on this issue:

edn supports extensibility through a simple mechanism. # followed immediately by a symbol starting with an alphabetic character indicates that that symbol is a tag.

Are periods allowed in tags?

Escape characters in strings

Am I correct to assume that only the 3 escape sequences \t \r \n are supported in EDN strings? Seems to not be complete since escaped double quotes are so common?

Unicode and Symbols

In the explanation for Symbols it says, "non-numeric character" and "alphanumeric characters." Are those restricted to ASCII or can relevant Unicode fit?

The wikipedia page for 'alphanumeric' states that it is commonly restricted to Latin Letters and Arabic Digits, but then makes exception for 'other locales.'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.