2 ms·
Here is what the SDLang example would look like in EDN (Extensible Data Notation), a subset of Clojure: ; Maps are denoted as key-value pairs inside curly
by pgt 6y ago
Here is what the SDLang example would look like in EDN (Extensible Data Notation), a subset of Clojure:
; Maps are denoted as key-value pairs inside curly brackets:
{:title "Hello, World"}
; Vectors are denoted by square brackets:
[:bookmarks 12 15 188 1234]
; Or you can use a map with a keyword that maps to a vector:
{:bookmarks [12 15 188 1234]}
; Maps are collections of key-value pairs:
{:author "Peter Parker"
:email "peter@example.org"
:active? true}
; Data structures are heterogeneous and nest:
[:contents
[:section "First section"
[:p "This is the first paragraph"]
[:p "This is the second paragraph"]]]
; ^ Hiccup actually renders these to HTML.
; Everything is an expression, so strings just work:
"This text is the value of an anonymous node!"
; A matrix is just a vector:
[1 0 0
0 1 0
0 0 1]
; Or you could partition it into rows:
[[1 0 0]
[0 1 0]
[0 0 1]]
https://github.com/edn-format/edn https://github.com/edn-format/edn