https://github.com/andriisoldatenko/monkey-go
Monkey programming language from Writing an interpreter in Go book
https://github.com/andriisoldatenko/monkey-go
Last synced: 2 months ago
JSON representation
Monkey programming language from Writing an interpreter in Go book
- Host: GitHub
- URL: https://github.com/andriisoldatenko/monkey-go
- Owner: andriisoldatenko
- License: mit
- Created: 2023-11-13T14:39:40.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-04-04T10:33:50.000Z (2 months ago)
- Last Synced: 2025-04-04T11:31:12.372Z (2 months ago)
- Language: Go
- Size: 158 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Monkey programming language
from [Writing an interpreter in Go book ](https://interpreterbook.com/)
[
](https://interpreterbook.com/img/monkey_logo-d5171d15.png)
```
let five = 5;let ten = 10;
let add = fn (x, y) {
x + y;
}let result = add(five, tne);
```## Macros
```
>> let unless = macro(condition, consequence, alternative) { quote(if (!(unquote(condition))) { unquote(consequence); } else { unquote(alternative); }); };
>> unless(10 > 5, puts("not greater"), puts("greater"));
greater
null
```