Dynamically Typed and interpreted Functional Programming Language, implemented in Ocaml. Lamb is a subset of the Lisp family of programming languages.
Some of the basic features
- Data Types
- Int
- Pair
- List
- Functional Idioms
- Lambdas
- Functions
- Recursion
- Closures
- First Class Functions
- Higher Order Functions
- Currying
- Let Expressions
- Arithmetic Operations
- Addition
- Substraction
;True
(define TRUE x (lambda y x))
;False
(define FALSE x (lambda y y))
;Negation
(define NOT b (call (call b FALSE) TRUE))
;And or Conjunction
(define CONJUNCTION x
(lambda y (call (call x y) FALSE)))
;Or / Disjunction
(define DISJUNCTION x
(lambda y (call (call x TRUE) y)))
;Boolean Equality
(define BEQ x
(lambda y (call
(call x (call (call y TRUE) FALSE))
(call x (call (call y FALSE) TRUE)))))
(define map f (define helper xs
(cmp (unit? xs) 0
xs
(pair (call f (car xs))
(call helper (cdr xs))))))