Skip to content

Instantly share code, notes, and snippets.

@millerdev
Last active August 29, 2015 14:00
Show Gist options
  • Save millerdev/3a6436a2bd860dc106e5 to your computer and use it in GitHub Desktop.
Save millerdev/3a6436a2bd860dc106e5 to your computer and use it in GitHub Desktop.
Lis - lisp dialect with semantic whitespace
define sum term a next b
define iter a result
if
> a b
result
iter
next a
+
term a
result
iter a 0
# parens are allowed because practicality beats purity
# but syntax for let and lambda needs more work
define f x y
let
a (+ 1 (* x y))
b (- 1 y)
+
* x (square a)
* y b
* a b
define f x y
lambda a b
+
* x (square a)
* y b
* a b
+ 1 (* x y)
- 1 y
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment