This repository has been archived on 2024-07-15. You can view files and clone it, but cannot push or open issues or pull requests.
holy_lisp_archive/README.md

57 lines
941 B
Markdown
Raw Normal View History

2024-06-22 02:16:57 +00:00
# Holy Lisp
<img src="./assets/holy_lisp.svg" alt="Holy Lisp Logo" width="100">
An opinionated lisp implementation developed in the most intuitive way I could come up with.
## Features
### Lists with a function as the **first element** are evaluated when needed
```lisp
(print (add 1 2)) ; => 3
(print (1 2 3)) ; => (1 2 3)
```
### Quoted lists are **not evaluated**
```lisp
(print '(add 1 2)) ; => '(<function add> 1 2)
```
### Elements within quoted lists can be unquoted
```lisp
(print
'(add
1 ,(sub 3 1)
)
) ; => '(<function add> 1 2)
2024-06-25 05:39:43 +00:00
```
### Maps can be indexed with .
```lisp
; In this example, ball_pos is a map
(print ball_pos.x ball_pos.y)
; This is just syntax sugar for
(get ball_pos "x")
```
### Functions can be defined and called like so
```lisp
(fn hello(name) (
(print (concat "Hello, " name "!"))
))
(hello "Joe") ; => "Hello, Joe!"
; Anonymous function creation
(
(fn(x) (print x))
15
) ; => 15
2024-06-22 02:16:57 +00:00
```