The Marco Programming Language
Java Groovy ANTLR
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
examples
fixtures
src
.gitignore
README.md
TODO
build.gradle

README.md

Marco

Language Reference

Literals

Numbers

All numbers of either positive or negative integers with no bounds.

1
-2
422319487132984710238740192387408937018470329874123123

Strings

Strings are delimited by double quotes.

"this is a string!"

Symbols

Symbols start with a :.

:a_symbol

Bindings

def bindings are immutable. var bindings are mutable and can be changed with set!.

(def :answer 42) // immutable binding

(var :done false) // mutable binding
(set! :done true) // mutation

Functions

All functions are anonymous. To create a function use the function function. To reuse a function, bind it with a def binding.

function takes a list of symbols and a block and returns an object that when called will evaluate the block adding the arguments to the block closure.

(def :inc @"Increments a number"
  (function [:n] {
    (+ n 1)
  })
)

To call a function use parenthesis.

(inc 2)