ylang is Programming Language. Scheme like, but it is NOT Lisp family
ylang aims to simplify design for programming.
Programming has many concepts easy to confuse, and too easy to bind self (regacy own code, uncontrollable dependency, language spec, etc ...)
ylang is designing to "Easy to Re-design own".
- To be as possible as easy to rewrite own
- To be as possible as easy to restruction own
; <- Comment
; Apply Function
(<FACTOR> <EXPR>)
; Eval Expression
(<EXPR>)
([]) ; Empty List
(1) ; Integer
(0.5) ; Floating
(1/2) ; Rational
(yes) ; Boolean (true)
(no) ; Boolean (false)
(:a) ; Keyword
('a') ; Charactor
("a") ; String
(, 1 2) ; Pair
;; List
[] ; Empty List
[1 2 3] ; = (, 1 2 3 [])
;; Examples
(, 1 []) ; [1]
(, [] 1) ; (, [] 1)
(, [1 2] []) ; [[1 2]]
(:) ; Declare Type Binding
(: x Int)
(=) ; Define [Value / Function]
(= x 10)
(+ x x) ; 20
(= (not x) (if x no yes))
(not yes) ; no
(not no) ; yes
;; Arrow (Function-Type)
(->)
(: add (: t Addible) (-> t t))
(: VariadicType (-> Natural Set Set Set))
(= (VariadicType 0 A B) B)
(= (VariadicType (suc n) A B)
(-> A (VariadicType n A B)))
(\) ; Lambda
(= id (\ x x))
((\ x x) 1) ; => (1)
(.) ; Compose
((. f g) x) ; => (f (g x))
(,) ; Pair
;; Examples
(, x) ; (\ y (, x y))
(, x []) ; => [x]
(, [] x) ; => (, [] x)
(>?) ; GT (>? 1 2) -> no
(<?) ; LT (<? 1 2) -> yes
(=?) ; EQ (=? 2 2) -> yes
(+) ; Add (+ 1 1) -> (1)
(-) ; Sub (- 1 1) -> (0)
(*) ; Mul (* 2 2) -> (4)
(/) ; Div (/ 1 2) -> (1/2)
(&) ; And (& yes no) -> (no)
(|) ; Or (| no yes) -> (yes)
(~) ; Not (~ yes) -> (no)
(= (: x Int) 10)
(= y 20)
(+ x 1)
; (: 11 Int)
(+ x y)
; (: 30 Int)
((\ x (+ x x)) 1)
; (: 2 Int)
((\ x (+ x y)) 1)
; (: 21 Int)
(: length (-> [a] Int))
(= (length []) 0)
(= (length (, x xs))
(+ (length xs) 1))
(length [1 2 3 4 5])
; (: 5 Int)
See License file