Commit 7de0f4f1 authored by Pierre-Antoine Rouby's avatar Pierre-Antoine Rouby 🤘🏻
Browse files

doc: Add features and example in README.

parent 328de025
......@@ -2,3 +2,46 @@ Hylang Truelisp
===============
**Hylang implement of classic lisp, like car / cdr / list? / etc.**
## Features
| Name | Description | Type |
|-------------|---------------------------------|----------|
| λ | Define lambda function | Macro |
| lambda | Define lambda function | Macro |
| car! | Return first element of list | Marco |
| cdr! | Return rest of list | Macro |
| car | Return first element of list | Function |
| cdr | Return rest of list | Function |
| append | Concat 2 list | Function |
| list? | True if arguement is an list | Function |
| map-list | map l with function f | Function |
| reverse | Reverse list | Function |
| remove-last | Remove last element of list | Function |
| cons* | cons multiple element with list | Macro |
| let | Define local variable | Macro |
## Examples
### List
```hy
(import [truelisp [*]])
(setv lst [1 2 3 4 5])
(print (car lst))
(print (cdr lst))
(setv nlst (map-list (λ [x] (+ x 1)) lst))
(print nlst)
(print (reverse nlst))
```
### Let
```hy
(require [truelisp [*]])
(let foo 4
(let bar 10
(+ 2 (* foo bar))))
```
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment