Add Symbolic Lambda Calculus is superset for Lazy K
Translate MLC to SLC
Add let expression
For other project:
Build dynamic typed version
Build static typed version
Compile SLC to eager version (Brilliant Language)
Add do expression (seq expression?).
Add match expression.
About expression
abs (\ symbol) is abstraction.
if (? symbol).
guard (| symbol) is or line. It is sugar for if.
guard K (|K symbol, guard constants). It Is hack.
guard is (|= symbol, guard equals, case).
guard in (guard belongs to, case list).
let (& symbol) is and line. It is sugar for abs. Real sugar. Maybe we need macros?
Example expressions
: function ! param1 ! param2 result
: variable ? condition expression1 expression2
; guard is predicate
| guard1 result1
| guard2 result2
default result
expression
; It is sugar for:
? (guard1 expression) result1
? (guard2 expression) result2
result
; it is possible do define `|` as function
: | ! guard ! body ! tail ! expression ? (guard expression) body (tail expression)
: default ! body ! expression body; It is true
& id1 init1
& id2 init2
expression
; It is sugar for:
! variable1 ! variable2 expression init1 init2
Issue with breaking line
Can we break lines?
How we should break lines?
Special character on end line or brackets?
Braces?
Indentation?
Tabs?
Example break lines
: function \
\ param1
\ param2
result
: variable \
? condition
result1
result2
: variable \
| guard1 result1
| guard2 result2
default result
expression
: variable \
? (guard1 expression) result1
? (guard2 expression) result2
result
: variable \
& id1 init1
& id2 init2
result
: variable \
\ id1
\ id2
result
init1
init2
a b c; => (a b) c ; => default order
a ` b c; => a (b c) => reverted order
! s v o; => v s o; => object order
o s v; => pipe order
o s v; => stack order
apply
Lambdas and Let
so maybe:
or:
Maybe it is too crazy?
@
- define and special word#
- comment:
- block;
- many instruction in one linedefine-macro
define-combinator
define-syntax-rule
define-syntax
https://justinethier.github.io/husk-scheme//2012/12/10/Understanding-Macros.html
https://3e8.org/pub/pdf-t1/macros_that_work.pdf
http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.53.5184
http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.53.5184&rep=rep1&type=pdf
For this project:
guard
expressioncase
expressionlet
expressionFor other project:
do
expression (seq
expression?).match
expression.About expression
abs
(\
symbol) is abstraction.if
(?
symbol).guard
(|
symbol) is or line. It is sugar forif
.guard K
(|K
symbol, guard constants). It Is hack.guard is
(|=
symbol, guard equals, case).guard in
(guard belongs to, case list).let
(&
symbol) is and line. It is sugar forabs
. Real sugar. Maybe we need macros?Example expressions
Issue with breaking line
Example break lines