;; full — begin/end for structure, parens for one-liners
defn begin stars [owner repo]
let begin
[
url str("https://api.github.com/repos/" owner "/" repo)
resp slurp(url)
data json/read-str(resp :key-fn keyword)
count :stargazers_count(data)
]
println(str(owner "/" repo ": " count " ⭐"))
end
end
M-expressions were McCarthy's original intended syntax for Lisp (1960). S-expressions were meant to be internal representation only — but they stuck. beme picks up where McCarthy left off: two rules that make nesting self-evident, while preserving Clojure's semantics exactly.
Rule 1 — head outside the parens: f(x y) => (f x y)
Rule 2 (optional) — begin/end instead of parens: f begin x y end => (f x y)
Everything else is Clojure.
Add to deps.edn:
io.github.beme-lang/beme-clj {:git/tag "v0.3.0" :git/sha "a3767c4"}
Or clone and use directly:
git clone https://github.com/beme-lang/beme-clj.git
cd beme-clj
All namespaces live under beme.alpha to signal that the API is pre-1.0 and may change. When the API stabilizes, namespaces will move to beme.
Run a .beme file:
$ bb beme run hello.beme # Babashka
$ clojure -T:beme run :file '"hello.beme"' # Clojure JVM
Hello, world!
Interactive REPL:
$ bb beme repl # Babashka
user=> +(1 2)
3
user=> map(inc [1 2 3])
(2 3 4)
Convert between beme and Clojure (direction detected from extension):
$ bb beme convert hello.beme # .beme → Clojure
$ bb beme convert hello.clj # .clj → beme
$ clojure -T:beme convert :file '"hello.beme"' # Clojure JVM
Format .beme files (normalize syntax via pprint):
$ bb beme format hello.beme # in-place
$ bb beme format src/ # directory, recursive
Can you improve this documentation?Edit on GitHub
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |