Drop backslash from lambda definitions
This commit is contained in:
17
README.md
17
README.md
@ -11,12 +11,11 @@ tricu is the word for "tree" in Lojban: `(x1) is a tree of species/cultivar (x2)
|
||||
## Features
|
||||
|
||||
- Tree Calculus operator: `t`
|
||||
- Assignments: `x = t t`
|
||||
- Immutable definitions
|
||||
- Lambda abstraction syntax: `id = (\a : a)`
|
||||
- Immutable definitions: `x = t t`
|
||||
- Lambda abstraction: `id = (a : a)`
|
||||
- List, Number, and String literals: `[(2) ("Hello")]`
|
||||
- Function application: `not (not false)`
|
||||
- Higher order/first-class functions: `map (\a : append a "!") [("Hello")]`
|
||||
- Higher order/first-class functions: `map (a : append a "!") [("Hello")]`
|
||||
- Intensionality blurs the distinction between functions and data (see REPL examples)
|
||||
- Simple module system for code organization
|
||||
|
||||
@ -24,15 +23,15 @@ tricu is the word for "tree" in Lojban: `(x1) is a tree of species/cultivar (x2)
|
||||
|
||||
```
|
||||
tricu < -- Anything after `--` on a single line is a comment
|
||||
tricu < id = (\a : a) -- Lambda abstraction is eliminated to tree calculus terms
|
||||
tricu < head (map (\i : append i " world!") [("Hello, ")])
|
||||
tricu < id = (a : a) -- Lambda abstraction is eliminated to tree calculus terms
|
||||
tricu < head (map (i : append i " world!") [("Hello, ")])
|
||||
tricu > "Hello, world!"
|
||||
tricu < id (head (map (\i : append i " world!") [("Hello, ")]))
|
||||
tricu < id (head (map (i : append i " world!") [("Hello, ")]))
|
||||
tricu > "Hello, world!"
|
||||
|
||||
tricu < -- Intensionality! We can inspect the structure of a function or data.
|
||||
tricu < triage = (\a b c : t (t a b) c)
|
||||
tricu < test = triage "Leaf" (\z : "Stem") (\a b : "Fork")
|
||||
tricu < triage = (a b c : t (t a b) c)
|
||||
tricu < test = triage "Leaf" (z : "Stem") (a b : "Fork")
|
||||
tricu < test (t t)
|
||||
tricu > "Stem"
|
||||
tricu < -- We can even convert a term back to source code (/demos/toSource.tri)
|
||||
|
Reference in New Issue
Block a user