-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add println * Rewrite fib * Refactor parse * Update lisp completer * Store args in env * Add 'or' and 'and' builtins * Add factorial.lsp * Update docs * Add cat operation * Add join operation * Add system command * Add time command (#346) * Add time command * Fix merge artefact * Fix call to realtime * Replace clock syscalls with device files (#345) * Replace clock syscalls with device files * Add missing newline to read * Update time command * Use Rc<RefCell<Env>> * Add first TCO * Remove Box * Change result of env_for_lambda * Run clippy * Remove env clone * Remove TCO * Change return type of env_for_lambda
- Loading branch information
Showing
7 changed files
with
216 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,3 +41,6 @@ | |
|
||
(defn third (lst) | ||
(second (rest lst))) | ||
|
||
(defn println (exp) | ||
(do (print exp) (print "\n"))) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
(load "/ini/lisp/core.lsp") | ||
|
||
(defn fact-acc (n acc) | ||
(cond | ||
((< n 2) acc) | ||
(true (fact-acc (- n 1) (* acc n))))) | ||
|
||
(defn fact (n) | ||
(fact-acc n 1)) | ||
|
||
(println | ||
(fact | ||
(cond | ||
((null? args) 10) | ||
(true (parse (car args)))))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
(load "/ini/lisp/core.lsp") | ||
|
||
(defn fib (n) | ||
(cond | ||
((< n 2) n) | ||
(true (+ (fib (- n 1)) (fib (- n 2)))))) | ||
|
||
(println | ||
(fib | ||
(cond | ||
((null? args) 10) | ||
(true (parse (car args)))))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.