fixed the tests with new args

This commit is contained in:
Felix Brendel
2019-09-21 01:24:15 +02:00
parent 5f90f2877f
commit 47b33f2f3a
14 changed files with 1108 additions and 1439 deletions
+5 -6
View File
@@ -1,8 +1,8 @@
(define-syntax (define-class name-and-members :rest body) (define-syntax (define-class name-and-members . body)
"Macro for creating simple classes." "Macro for creating simple classes."
(let ((name (first name-and-members)) (let ((name (first name-and-members))
(members (rest name-and-members))) (members (rest name-and-members)))
`(set-type `(set-type!
(define (define
;; The function definition ;; The function definition
(,(string->symbol (concat-strings "make-" (symbol->string name))) @members) (,(string->symbol (concat-strings "make-" (symbol->string name))) @members)
@@ -11,8 +11,8 @@
;; the body ;; the body
@body @body
(let ,(zip members members) (let ,(zip members members)
(set-type (set-type!
(lambda (:rest args) (lambda args
"This is the docs for the handle" "This is the docs for the handle"
(let ((op (eval (first args)))) (let ((op (eval (first args))))
(if (callable? op) (if (callable? op)
@@ -21,6 +21,5 @@
,(symbol->keyword name)))) ,(symbol->keyword name))))
:constructor))) :constructor)))
(define-syntax (-> obj meth :rest args) (define-syntax (-> obj meth . args)
`(,obj ',meth @args)) `(,obj ',meth @args))
+1 -3
View File
@@ -36,7 +36,6 @@ condition is false."
(define-syntax (let bindings . body) (define-syntax (let bindings . body)
(define (unzip lists) (define (unzip lists)
(break)
(when lists (when lists
(define (iter lists l1 l2) (define (iter lists l1 l2)
(define elem (first lists)) (define elem (first lists))
@@ -45,7 +44,6 @@ condition is false."
(pair (first elem) l1) (pair (first elem) l1)
(pair (first (rest elem)) l2)) (pair (first (rest elem)) l2))
(list l1 l2)))) (list l1 l2))))
(iter lists () ())) (iter lists () ()))
(define unzipped (unzip bindings)) (define unzipped (unzip bindings))
@@ -152,7 +150,7 @@ ithe sequence as arguemens."
(concat-strings module-prefix (concat-strings module-prefix
(symbol->string orig-export-name))))) (symbol->string orig-export-name)))))
`(define ,export-name `(define ,export-name
,(try (eval orig-export-name) ,(mytry (eval orig-export-name)
(error "The module does not contain" orig-export-name))))) (error "The module does not contain" orig-export-name)))))
exports)))) exports))))
+2 -2
View File
@@ -6,7 +6,7 @@
(define-syntax (n-times times action) :doc "Executes action times times." (define (repeat times elem) (unless (> 1 times) (pair elem (repeat (- times 1) elem)))) `(begin (unquote-splicing (repeat times action)))) (define-syntax (n-times times action) :doc "Executes action times times." (define (repeat times elem) (unless (> 1 times) (pair elem (repeat (- times 1) elem)))) `(begin (unquote-splicing (repeat times action))))
(define-syntax (let bindings . body) (define (unzip lists) (break) (when lists (define (iter lists l1 l2) (define elem (first lists)) (if elem (iter (rest lists) (pair (first elem) l1) (pair (first (rest elem)) l2)) (list l1 l2)))) (iter lists () ())) (define unzipped (unzip bindings)) `((,lambda ,(first unzipped) (unquote-splicing body)) (unquote-splicing (first (rest unzipped))))) (define-syntax (let bindings . body) (define (unzip lists) (when lists (define (iter lists l1 l2) (define elem (first lists)) (if elem (iter (rest lists) (pair (first elem) l1) (pair (first (rest elem)) l2)) (list l1 l2)))) (iter lists () ())) (define unzipped (unzip bindings)) `((,lambda ,(first unzipped) (unquote-splicing body)) (unquote-splicing (first (rest unzipped)))))
(define-syntax (cond . clauses) (define (rec clauses) (if (= nil clauses) nil (if (= (first (first clauses)) 'else) (begin (if (not (= (rest clauses) ())) (error "There are additional clauses after the else clause!") (pair 'begin (rest (first clauses))))) `(if ,(first (first clauses)) (begin (unquote-splicing (rest (first clauses)))) ,(rec (rest clauses)))))) (rec clauses)) (define-syntax (cond . clauses) (define (rec clauses) (if (= nil clauses) nil (if (= (first (first clauses)) 'else) (begin (if (not (= (rest clauses) ())) (error "There are additional clauses after the else clause!") (pair 'begin (rest (first clauses))))) `(if ,(first (first clauses)) (begin (unquote-splicing (rest (first clauses)))) ,(rec (rest clauses)))))) (rec clauses))
@@ -20,7 +20,7 @@
(define-syntax (define-typed args . body) (define (get-arg-names args) (when args (pair (first args) (get-arg-names (rest (rest args)))))) (let ((name (first args)) (lambda-list (rest args)) (arg-names (get-arg-names (rest args)))) `(define (,name (unquote-splicing arg-names)) (assert-types= (unquote-splicing lambda-list)) (unquote-splicing body)))) (define-syntax (define-typed args . body) (define (get-arg-names args) (when args (pair (first args) (get-arg-names (rest (rest args)))))) (let ((name (first args)) (lambda-list (rest args)) (arg-names (get-arg-names (rest args)))) `(define (,name (unquote-splicing arg-names)) (assert-types= (unquote-splicing lambda-list)) (unquote-splicing body))))
(define-syntax (define-module module-name :exports . body) (let ((module-prefix (concat-strings (symbol->string module-name) "::"))) (eval `(begin (unquote-splicing body))) (pair 'begin (map (lambda (orig-export-name) (let ((export-name (string->symbol (concat-strings module-prefix (symbol->string orig-export-name))))) `(define ,export-name ,(try (eval orig-export-name) (error "The module does not contain" orig-export-name))))) exports)))) (define-syntax (define-module module-name :exports . body) (let ((module-prefix (concat-strings (symbol->string module-name) "::"))) (eval `(begin (unquote-splicing body))) (pair 'begin (map (lambda (orig-export-name) (let ((export-name (string->symbol (concat-strings module-prefix (symbol->string orig-export-name))))) `(define ,export-name ,(mytry (eval orig-export-name) (error "The module does not contain" orig-export-name))))) exports))))
(define (null? x) :doc "Checks if the argument is =nil=." (= x ())) (define (null? x) :doc "Checks if the argument is =nil=." (= x ()))
+3 -4
View File
@@ -5,8 +5,8 @@
(define key-not-found-index -1) (define key-not-found-index -1)
(define (make :rest vals) (define (make . vals)
(set-type (set-type!
(if vals (if vals
(list vals) (list vals)
'(())) '(()))
@@ -27,7 +27,6 @@
(define (insert! set value) (define (insert! set value)
(unless (contains? set value) (unless (contains? set value)
(set! set (pair (pair value (first set)) ())) (set! set (pair (pair value (first set)) ()))
(set-type set :set)) (set-type! set :set))
set) set)
) )
+2 -2
View File
@@ -1,7 +1,7 @@
((lambda (:keys k1 :defaults-to (+ 1 2 3)) ((lambda ((:k1 (+ 1 2 3)))
(assert (= k1 6)))) (assert (= k1 6))))
((lambda (:keys k1 :defaults-to ()) ((lambda ((:k1 ()))
(when k1 (when k1
(assert ())) (assert ()))
(assert (= k1 ())))) (assert (= k1 ()))))
+1 -1
View File
@@ -32,7 +32,7 @@
;; key arguments ;; key arguments
(define (make-key-counter) (define (make-key-counter)
((lambda (:keys var) ((lambda (:var)
(lambda () (lambda ()
(mutate var (+ 1 var)) (mutate var (+ 1 var))
var)) var))
+1 -1
View File
@@ -26,7 +26,7 @@
(define (g) (define x 0) (lambda () (define temp x) (mutate x (+ x 1)) temp)) (define (g) (define x 0) (lambda () (define temp x) (mutate x (+ x 1)) temp))
(define (make-key-counter) ((lambda (:keys var) (lambda () (mutate var (+ 1 var)) var)) :var 0)) (define (make-key-counter) ((lambda (:var) (lambda () (mutate var (+ 1 var)) var)) :var 0))
(define key-counter1 (make-key-counter)) (define key-counter1 (make-key-counter))
+92 -412
View File
@@ -1,7 +1,14 @@
\hrule \hrule
* =file_name=
- defined in :: =generate-docs.slime:5:44=
- type :: =:string=
- value :: ="../manual/built-in-docs.org"=
- docu :: none
\hrule
* === * ===
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:166:0= - defined in :: =src/./built_ins.cpp:159:0=
- type :: =:cfunction= - type :: =:cfunction=
- docu :: - docu ::
#+BEGIN: #+BEGIN:
@@ -10,7 +17,7 @@ Takes 0 or more arguments and returns =t= if all arguments are equal and =()= ot
\hrule \hrule
* =>= * =>=
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:182:0= - defined in :: =src/./built_ins.cpp:175:0=
- type :: =:cfunction= - type :: =:cfunction=
- docu :: - docu ::
#+BEGIN: #+BEGIN:
@@ -19,7 +26,7 @@ TODO
\hrule \hrule
* =>== * =>==
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:199:0= - defined in :: =src/./built_ins.cpp:189:0=
- type :: =:cfunction= - type :: =:cfunction=
- docu :: - docu ::
#+BEGIN: #+BEGIN:
@@ -28,7 +35,7 @@ TODO
\hrule \hrule
* =<= * =<=
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:216:0= - defined in :: =src/./built_ins.cpp:203:0=
- type :: =:cfunction= - type :: =:cfunction=
- docu :: - docu ::
#+BEGIN: #+BEGIN:
@@ -37,7 +44,7 @@ TODO
\hrule \hrule
* =<== * =<==
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:235:0= - defined in :: =src/./built_ins.cpp:217:0=
- type :: =:cfunction= - type :: =:cfunction=
- docu :: - docu ::
#+BEGIN: #+BEGIN:
@@ -46,7 +53,7 @@ TODO
\hrule \hrule
* =+= * =+=
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:252:0= - defined in :: =src/./built_ins.cpp:231:0=
- type :: =:cfunction= - type :: =:cfunction=
- docu :: - docu ::
#+BEGIN: #+BEGIN:
@@ -55,7 +62,7 @@ TODO
\hrule \hrule
* =-= * =-=
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:264:0= - defined in :: =src/./built_ins.cpp:243:0=
- type :: =:cfunction= - type :: =:cfunction=
- docu :: - docu ::
#+BEGIN: #+BEGIN:
@@ -64,7 +71,7 @@ TODO
\hrule \hrule
* =*= * =*=
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:286:0= - defined in :: =src/./built_ins.cpp:264:0=
- type :: =:cfunction= - type :: =:cfunction=
- docu :: - docu ::
#+BEGIN: #+BEGIN:
@@ -73,7 +80,7 @@ TODO
\hrule \hrule
* =/= * =/=
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:306:0= - defined in :: =src/./built_ins.cpp:281:0=
- type :: =:cfunction= - type :: =:cfunction=
- docu :: - docu ::
#+BEGIN: #+BEGIN:
@@ -82,7 +89,7 @@ TODO
\hrule \hrule
* =**= * =**=
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:326:0= - defined in :: =src/./built_ins.cpp:300:0=
- type :: =:cfunction= - type :: =:cfunction=
- docu :: - docu ::
#+BEGIN: #+BEGIN:
@@ -91,7 +98,7 @@ TODO
\hrule \hrule
* =%= * =%=
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:341:0= - defined in :: =src/./built_ins.cpp:307:0=
- type :: =:cfunction= - type :: =:cfunction=
- docu :: - docu ::
#+BEGIN: #+BEGIN:
@@ -100,7 +107,16 @@ TODO
\hrule \hrule
* =assert= * =assert=
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:356:0= - defined in :: =src/./built_ins.cpp:314:0=
- type :: =:cfunction=
- docu ::
#+BEGIN:
TODO
#+END:
\hrule
* =define-syntax=
- defined in :: =src/./built_ins.cpp:323:0=
- type :: =:cfunction= - type :: =:cfunction=
- docu :: - docu ::
#+BEGIN: #+BEGIN:
@@ -109,7 +125,7 @@ TODO
\hrule \hrule
* =define= * =define=
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:367:0= - defined in :: =src/./built_ins.cpp:369:0=
- type :: =:cfunction= - type :: =:cfunction=
- docu :: - docu ::
#+BEGIN: #+BEGIN:
@@ -118,7 +134,7 @@ TODO
\hrule \hrule
* =mutate= * =mutate=
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:429:0= - defined in :: =src/./built_ins.cpp:425:0=
- type :: =:cfunction= - type :: =:cfunction=
- docu :: - docu ::
#+BEGIN: #+BEGIN:
@@ -127,7 +143,7 @@ TODO
\hrule \hrule
* =vector-length= * =vector-length=
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:454:0= - defined in :: =src/./built_ins.cpp:447:0=
- type :: =:cfunction= - type :: =:cfunction=
- docu :: - docu ::
#+BEGIN: #+BEGIN:
@@ -136,7 +152,7 @@ TODO
\hrule \hrule
* =vector-ref= * =vector-ref=
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:462:0= - defined in :: =src/./built_ins.cpp:452:0=
- type :: =:cfunction= - type :: =:cfunction=
- docu :: - docu ::
#+BEGIN: #+BEGIN:
@@ -145,7 +161,7 @@ TODO
\hrule \hrule
* =vector-set!= * =vector-set!=
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:479:0= - defined in :: =src/./built_ins.cpp:465:0=
- type :: =:cfunction= - type :: =:cfunction=
- docu :: - docu ::
#+BEGIN: #+BEGIN:
@@ -154,7 +170,7 @@ TODO
\hrule \hrule
* =set!= * =set!=
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:499:0= - defined in :: =src/./built_ins.cpp:480:0=
- type :: =:cfunction= - type :: =:cfunction=
- docu :: - docu ::
#+BEGIN: #+BEGIN:
@@ -163,7 +179,7 @@ TODO
\hrule \hrule
* =set-car!= * =set-car!=
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:521:0= - defined in :: =src/./built_ins.cpp:500:0=
- type :: =:cfunction= - type :: =:cfunction=
- docu :: - docu ::
#+BEGIN: #+BEGIN:
@@ -172,7 +188,7 @@ TODO
\hrule \hrule
* =set-cdr!= * =set-cdr!=
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:532:0= - defined in :: =src/./built_ins.cpp:508:0=
- type :: =:cfunction= - type :: =:cfunction=
- docu :: - docu ::
#+BEGIN: #+BEGIN:
@@ -181,7 +197,7 @@ TODO
\hrule \hrule
* =if= * =if=
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:543:0= - defined in :: =src/./built_ins.cpp:516:0=
- type :: =:cfunction= - type :: =:cfunction=
- docu :: - docu ::
#+BEGIN: #+BEGIN:
@@ -190,7 +206,7 @@ TODO
\hrule \hrule
* =quote= * =quote=
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:563:0= - defined in :: =src/./built_ins.cpp:530:0=
- type :: =:cfunction= - type :: =:cfunction=
- docu :: - docu ::
#+BEGIN: #+BEGIN:
@@ -199,7 +215,7 @@ TODO
\hrule \hrule
* =quasiquote= * =quasiquote=
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:568:0= - defined in :: =src/./built_ins.cpp:534:0=
- type :: =:cfunction= - type :: =:cfunction=
- docu :: - docu ::
#+BEGIN: #+BEGIN:
@@ -208,7 +224,7 @@ TODO
\hrule \hrule
* =and= * =and=
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:665:0= - defined in :: =src/./built_ins.cpp:631:0=
- type :: =:cfunction= - type :: =:cfunction=
- docu :: - docu ::
#+BEGIN: #+BEGIN:
@@ -217,7 +233,7 @@ TODO
\hrule \hrule
* =or= * =or=
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:676:0= - defined in :: =src/./built_ins.cpp:643:0=
- type :: =:cfunction= - type :: =:cfunction=
- docu :: - docu ::
#+BEGIN: #+BEGIN:
@@ -226,16 +242,7 @@ TODO
\hrule \hrule
* =not= * =not=
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:687:0= - defined in :: =src/./built_ins.cpp:655:0=
- type :: =:cfunction=
- docu ::
#+BEGIN:
TODO
#+END:
\hrule
* =while=
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:697:0=
- type :: =:cfunction= - type :: =:cfunction=
- docu :: - docu ::
#+BEGIN: #+BEGIN:
@@ -244,7 +251,7 @@ TODO
\hrule \hrule
* =lambda= * =lambda=
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:775:0= - defined in :: =src/./built_ins.cpp:689:0=
- type :: =:cfunction= - type :: =:cfunction=
- docu :: - docu ::
#+BEGIN: #+BEGIN:
@@ -253,7 +260,7 @@ TODO
\hrule \hrule
* =special-lambda= * =special-lambda=
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:787:0= - defined in :: =src/./built_ins.cpp:705:0=
- type :: =:cfunction= - type :: =:cfunction=
- docu :: - docu ::
#+BEGIN: #+BEGIN:
@@ -262,7 +269,7 @@ TODO
\hrule \hrule
* =eval= * =eval=
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:795:0= - defined in :: =src/./built_ins.cpp:721:0=
- type :: =:cfunction= - type :: =:cfunction=
- docu :: - docu ::
#+BEGIN: #+BEGIN:
@@ -271,7 +278,7 @@ TODO
\hrule \hrule
* =begin= * =begin=
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:807:0= - defined in :: =src/./built_ins.cpp:731:0=
- type :: =:cfunction= - type :: =:cfunction=
- docu :: - docu ::
#+BEGIN: #+BEGIN:
@@ -280,7 +287,7 @@ TODO
\hrule \hrule
* =list= * =list=
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:823:0= - defined in :: =src/./built_ins.cpp:743:0=
- type :: =:cfunction= - type :: =:cfunction=
- docu :: - docu ::
#+BEGIN: #+BEGIN:
@@ -289,7 +296,7 @@ TODO
\hrule \hrule
* =vector= * =vector=
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:827:0= - defined in :: =src/./built_ins.cpp:747:0=
- type :: =:cfunction= - type :: =:cfunction=
- docu :: - docu ::
#+BEGIN: #+BEGIN:
@@ -298,7 +305,7 @@ TODO
\hrule \hrule
* =pair= * =pair=
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:833:0= - defined in :: =src/./built_ins.cpp:754:0=
- type :: =:cfunction= - type :: =:cfunction=
- docu :: - docu ::
#+BEGIN: #+BEGIN:
@@ -307,7 +314,7 @@ TODO
\hrule \hrule
* =first= * =first=
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:843:0= - defined in :: =src/./built_ins.cpp:761:0=
- type :: =:cfunction= - type :: =:cfunction=
- docu :: - docu ::
#+BEGIN: #+BEGIN:
@@ -316,25 +323,25 @@ TODO
\hrule \hrule
* =rest= * =rest=
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:854:0= - defined in :: =src/./built_ins.cpp:768:0=
- type :: =:cfunction= - type :: =:cfunction=
- docu :: - docu ::
#+BEGIN: #+BEGIN:
TODO TODO
#+END: #+END:
\hrule \hrule
* =set-type= * =set-type!=
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:865:0= - defined in :: =src/./built_ins.cpp:775:0=
- type :: =:cfunction= - type :: =:cfunction=
- docu :: - docu ::
#+BEGIN: #+BEGIN:
TODO TODO
#+END: #+END:
\hrule \hrule
* =delete-type= * =delete-type!=
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:877:0= - defined in :: =src/./built_ins.cpp:781:0=
- type :: =:cfunction= - type :: =:cfunction=
- docu :: - docu ::
#+BEGIN: #+BEGIN:
@@ -343,7 +350,16 @@ TODO
\hrule \hrule
* =type= * =type=
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:884:0= - defined in :: =src/./built_ins.cpp:786:0=
- type :: =:cfunction=
- docu ::
#+BEGIN:
TODO
#+END:
\hrule
* =mem-reset=
- defined in :: =src/./built_ins.cpp:819:0=
- type :: =:cfunction= - type :: =:cfunction=
- docu :: - docu ::
#+BEGIN: #+BEGIN:
@@ -352,7 +368,7 @@ TODO
\hrule \hrule
* =info= * =info=
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:918:0= - defined in :: =src/./built_ins.cpp:828:0=
- type :: =:cfunction= - type :: =:cfunction=
- docu :: - docu ::
#+BEGIN: #+BEGIN:
@@ -361,7 +377,7 @@ TODO
\hrule \hrule
* =show= * =show=
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:999:0= - defined in :: =src/./built_ins.cpp:899:0=
- type :: =:cfunction= - type :: =:cfunction=
- docu :: - docu ::
#+BEGIN: #+BEGIN:
@@ -370,7 +386,7 @@ TODO
\hrule \hrule
* =addr-of= * =addr-of=
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:1011:0= - defined in :: =src/./built_ins.cpp:911:0=
- type :: =:cfunction= - type :: =:cfunction=
- docu :: - docu ::
#+BEGIN: #+BEGIN:
@@ -379,7 +395,7 @@ TODO
\hrule \hrule
* =generate-docs= * =generate-docs=
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:1017:0= - defined in :: =src/./built_ins.cpp:916:0=
- type :: =:cfunction= - type :: =:cfunction=
- docu :: - docu ::
#+BEGIN: #+BEGIN:
@@ -388,7 +404,7 @@ TODO
\hrule \hrule
* =print= * =print=
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:1026:0= - defined in :: =src/./built_ins.cpp:922:0=
- type :: =:cfunction= - type :: =:cfunction=
- docu :: - docu ::
#+BEGIN: #+BEGIN:
@@ -397,7 +413,7 @@ TODO
\hrule \hrule
* =read= * =read=
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:1034:0= - defined in :: =src/./built_ins.cpp:937:0=
- type :: =:cfunction= - type :: =:cfunction=
- docu :: - docu ::
#+BEGIN: #+BEGIN:
@@ -406,7 +422,7 @@ TODO
\hrule \hrule
* =exit= * =exit=
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:1051:0= - defined in :: =src/./built_ins.cpp:949:0=
- type :: =:cfunction= - type :: =:cfunction=
- docu :: - docu ::
#+BEGIN: #+BEGIN:
@@ -415,7 +431,7 @@ TODO
\hrule \hrule
* =break= * =break=
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:1062:0= - defined in :: =src/./built_ins.cpp:954:0=
- type :: =:cfunction= - type :: =:cfunction=
- docu :: - docu ::
#+BEGIN: #+BEGIN:
@@ -424,16 +440,7 @@ TODO
\hrule \hrule
* =memstat= * =memstat=
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:1067:0= - defined in :: =src/./built_ins.cpp:960:0=
- type :: =:cfunction=
- docu ::
#+BEGIN:
TODO
#+END:
\hrule
* =try=
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:1071:0=
- type :: =:cfunction= - type :: =:cfunction=
- docu :: - docu ::
#+BEGIN: #+BEGIN:
@@ -442,7 +449,7 @@ TODO
\hrule \hrule
* =load= * =load=
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:1086:0= - defined in :: =src/./built_ins.cpp:979:0=
- type :: =:cfunction= - type :: =:cfunction=
- docu :: - docu ::
#+BEGIN: #+BEGIN:
@@ -451,7 +458,7 @@ TODO
\hrule \hrule
* =import= * =import=
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:1097:0= - defined in :: =src/./built_ins.cpp:989:0=
- type :: =:cfunction= - type :: =:cfunction=
- docu :: - docu ::
#+BEGIN: #+BEGIN:
@@ -460,16 +467,7 @@ TODO
\hrule \hrule
* =copy= * =copy=
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:1108:0= - defined in :: =src/./built_ins.cpp:1000:0=
- type :: =:cfunction=
- docu ::
#+BEGIN:
TODO
#+END:
\hrule
* =error=
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:1116:0=
- type :: =:cfunction= - type :: =:cfunction=
- docu :: - docu ::
#+BEGIN: #+BEGIN:
@@ -478,7 +476,7 @@ TODO
\hrule \hrule
* =symbol->keyword= * =symbol->keyword=
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:1123:0= - defined in :: =src/./built_ins.cpp:1013:0=
- type :: =:cfunction= - type :: =:cfunction=
- docu :: - docu ::
#+BEGIN: #+BEGIN:
@@ -487,7 +485,7 @@ TODO
\hrule \hrule
* =string->symbol= * =string->symbol=
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:1132:0= - defined in :: =src/./built_ins.cpp:1018:0=
- type :: =:cfunction= - type :: =:cfunction=
- docu :: - docu ::
#+BEGIN: #+BEGIN:
@@ -496,7 +494,7 @@ TODO
\hrule \hrule
* =symbol->string= * =symbol->string=
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:1144:0= - defined in :: =src/./built_ins.cpp:1027:0=
- type :: =:cfunction= - type :: =:cfunction=
- docu :: - docu ::
#+BEGIN: #+BEGIN:
@@ -505,7 +503,7 @@ TODO
\hrule \hrule
* =concat-strings= * =concat-strings=
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:1153:0= - defined in :: =src/./built_ins.cpp:1034:0=
- type :: =:cfunction= - type :: =:cfunction=
- docu :: - docu ::
#+BEGIN: #+BEGIN:
@@ -514,7 +512,6 @@ TODO
\hrule \hrule
* =pe= * =pe=
- defined in :: =pre.slime:4:40=
- type :: =:macro= - type :: =:macro=
- arguments :: : - arguments :: :
- postitional :: =expr= - postitional :: =expr=
@@ -522,7 +519,6 @@ TODO
\hrule \hrule
* =when= * =when=
- defined in :: =pre.slime:23:41=
- type :: =:macro= - type :: =:macro=
- arguments :: : - arguments :: :
- postitional :: =condition=: - postitional :: =condition=:
@@ -547,7 +543,6 @@ condition is true.
\hrule \hrule
* =unless= * =unless=
- defined in :: =pre.slime:30:41=
- type :: =:macro= - type :: =:macro=
- arguments :: : - arguments :: :
- postitional :: =condition=: - postitional :: =condition=:
@@ -560,7 +555,6 @@ condition is false.
\hrule \hrule
* =n-times= * =n-times=
- defined in :: =pre.slime:37:35=
- type :: =:macro= - type :: =:macro=
- arguments :: : - arguments :: :
- postitional :: =times=, =action= - postitional :: =times=, =action=
@@ -571,7 +565,6 @@ Executes action times times.
\hrule \hrule
* =let= * =let=
- defined in :: =pre.slime:54:64=
- type :: =:macro= - type :: =:macro=
- arguments :: : - arguments :: :
- postitional :: =bindings=: - postitional :: =bindings=:
@@ -580,7 +573,6 @@ Executes action times times.
\hrule \hrule
* =cond= * =cond=
- defined in :: =pre.slime:68:17=
- type :: =:macro= - type :: =:macro=
- arguments :: : - arguments :: :
- rest :: =clauses= - rest :: =clauses=
@@ -588,7 +580,6 @@ Executes action times times.
\hrule \hrule
* =case= * =case=
- defined in :: =pre.slime:83:17=
- type :: =:macro= - type :: =:macro=
- arguments :: : - arguments :: :
- postitional :: =var=: - postitional :: =var=:
@@ -597,7 +588,6 @@ Executes action times times.
\hrule \hrule
* =define-special= * =define-special=
- defined in :: =pre.slime:86:81=
- type :: =:macro= - type :: =:macro=
- arguments :: : - arguments :: :
- postitional :: =name-and-args=: - postitional :: =name-and-args=:
@@ -606,7 +596,6 @@ Executes action times times.
\hrule \hrule
* =construct-list= * =construct-list=
- defined in :: =pre.slime:127:14=
- type :: =:macro= - type :: =:macro=
- arguments :: : - arguments :: :
- rest :: =body= - rest :: =body=
@@ -633,7 +622,6 @@ Executes action times times.
\hrule \hrule
* =apply= * =apply=
- defined in :: =pre.slime:132:28=
- type :: =:macro= - type :: =:macro=
- arguments :: : - arguments :: :
- postitional :: =fun=, =seq= - postitional :: =fun=, =seq=
@@ -645,7 +633,6 @@ ithe sequence as arguemens.
\hrule \hrule
* =define-typed= * =define-typed=
- defined in :: =pre.slime:144:16=
- type :: =:macro= - type :: =:macro=
- arguments :: : - arguments :: :
- postitional :: =args=: - postitional :: =args=:
@@ -654,7 +641,6 @@ ithe sequence as arguemens.
\hrule \hrule
* =define-module= * =define-module=
- defined in :: =pre.slime:158:27=
- type :: =:macro= - type :: =:macro=
- arguments :: : - arguments :: :
- postitional :: =module-name=: - postitional :: =module-name=:
@@ -804,7 +790,7 @@ Returns the last pair in the sqeuence.
{{{example_start}}} {{{example_start}}}
(define a (list 1 2 3 4)) (define a (list 1 2 3 4))
(printf (end a)) (print (end a))
{{{example_end}}} {{{example_end}}}
#+END: #+END:
@@ -820,7 +806,7 @@ Returns the (first) of the last (pair) of the given sequence.
{{{example_start}}} {{{example_start}}}
(define a (list 1 2 3 4)) (define a (list 1 2 3 4))
(printf (last a)) (print (last a))
{{{example_end}}} {{{example_end}}}
#+END: #+END:
@@ -916,15 +902,15 @@ Subtracts one from the argument.
- keyword :: =from= =(0)=, =to= - keyword :: =from= =(0)=, =to=
- docu :: - docu ::
#+BEGIN: #+BEGIN:
Returns a sequence of numbers starting with the number defined by the Returns a sequence of numbers starting with the number defined
key =from= and ends with the number defined in =to=. by the key =from= and ends with the number defined in =to=.
#+END: #+END:
\hrule \hrule
* =range-while= * =range-while=
- type :: =:lambda= - type :: =:lambda=
- arguments :: : - arguments :: :
- keyword :: =from= =(0)=, =to= - keyword :: =from= =(0)=
- docu :: - docu ::
#+BEGIN: #+BEGIN:
Returns a sequence of numbers starting with the number defined Returns a sequence of numbers starting with the number defined
@@ -950,10 +936,10 @@ elemens as argument to that function.
- postitional :: =fun=, =seq= - postitional :: =fun=, =seq=
- docu :: - docu ::
#+BEGIN: #+BEGIN:
Takes a function and a sequence as arguments and applies the Takes a function and a sequence as arguments and applies the
function to the argument sequence. This only works correctly if the function to the argument sequence. This only works correctly if the
given function accepts a variable amount of parameters. If your given function accepts a variable amount of parameters. If your
funciton is limited to two arguments, use [[=reduce-binary=]] funciton is limited to two arguments, use [[=reduce-binary=]]
instead. instead.
#+END: #+END:
\hrule \hrule
@@ -964,9 +950,9 @@ instead.
- postitional :: =fun=, =seq= - postitional :: =fun=, =seq=
- docu :: - docu ::
#+BEGIN: #+BEGIN:
Takes a function and a sequence as arguments and applies the Takes a function and a sequence as arguments and applies the
function to the argument sequence. reduce-binary applies the arguments function to the argument sequence. reduce-binary applies the arguments
*pair-wise* which means it works with binary functions as compared to *pair-wise* which means it works with binary functions as compared to
[[=reduce=]]. [[=reduce=]].
#+END: #+END:
\hrule \hrule
@@ -1003,309 +989,3 @@ added to a list, which in the end is returned.
- arguments :: : - arguments :: :
- postitional :: =seq= - postitional :: =seq=
- docu :: none - docu :: none
\hrule
* =printf=
- type :: =:lambda=
- arguments :: :
- keyword :: =sep= =(" ")=, =end= =("\n")=:
- rest :: =args=
- docu ::
#+BEGIN:
A wrapper for the built-in function [[=print=]] that accepts a
variable number of arguments and also provides keywords for specifying
the printed separators (=sep=) between the arguments and what should
be printed after the last argument (=end=).
#+END:
\hrule
* =key-not-found-index=
- defined in :: =alist.slime:28:31=
- type :: =:number=
- value :: =-1=
- docu :: none
\hrule
* =make-alist=
- type :: =:lambda=
- arguments :: none.
- docu :: none
\hrule
* =make-plist=
- type :: =:lambda=
- arguments :: none.
- docu :: none
\hrule
* =pprint-alist=
- type :: =:lambda=
- arguments :: :
- postitional :: =alist=
- docu :: none
\hrule
* =pprint-plist=
- type :: =:lambda=
- arguments :: :
- postitional :: =plist=
- docu :: none
\hrule
* =alist-get=
- type :: =:lambda=
- arguments :: :
- postitional :: =alist=, =key=
- docu :: none
\hrule
* =alist-find=
- type :: =:lambda=
- arguments :: :
- postitional :: =alist=, =key=
- docu :: none
\hrule
* =alist-key-exists?=
- type :: =:lambda=
- arguments :: :
- postitional :: =alist=, =key=
- docu :: none
\hrule
* =alist-remove!=
- type :: =:lambda=
- arguments :: :
- postitional :: =alist=, =key=
- docu :: none
\hrule
* =alist-set!=
- type :: =:lambda=
- arguments :: :
- postitional :: =alist=, =key=, =value=
- docu :: none
\hrule
* =alist-set-overwrite!=
- type :: =:lambda=
- arguments :: :
- postitional :: =alist=, =key=, =value=
- docu :: none
\hrule
* =plist-get=
- type :: =:lambda=
- arguments :: :
- postitional :: =plist=, =prop=
- docu :: none
\hrule
* =plist-set!=
- type :: =:lambda=
- arguments :: :
- postitional :: =plist=, =prop=, =value=
- docu :: none
\hrule
* =plist-set-overwrite!=
- type :: =:lambda=
- arguments :: :
- postitional :: =plist=, =prop=, =value=
- docu :: none
\hrule
* =plist-find=
- type :: =:lambda=
- arguments :: :
- postitional :: =plist=, =prop=
- docu :: none
\hrule
* =plist-prop-exists?=
- type :: =:lambda=
- arguments :: :
- postitional :: =plist=, =prop=
- docu :: none
\hrule
* =plist-remove!=
- type :: =:lambda=
- arguments :: :
- postitional :: =plist=, =prop=
- docu :: none
\hrule
* =cons=
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:833:0=
- type :: =:cfunction=
- docu ::
#+BEGIN:
TODO
#+END:
\hrule
* =car=
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:843:0=
- type :: =:cfunction=
- docu ::
#+BEGIN:
TODO
#+END:
\hrule
* =cdr=
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:854:0=
- type :: =:cfunction=
- docu ::
#+BEGIN:
TODO
#+END:
\hrule
* =caar=
- type :: =:lambda=
- arguments :: :
- postitional :: =seq=
- docu :: none
\hrule
* =cddr=
- type :: =:lambda=
- arguments :: :
- postitional :: =seq=
- docu :: none
\hrule
* =cadr=
- type :: =:lambda=
- arguments :: :
- postitional :: =seq=
- docu :: none
\hrule
* =cdar=
- type :: =:lambda=
- arguments :: :
- postitional :: =seq=
- docu :: none
\hrule
* =caaar=
- type :: =:lambda=
- arguments :: :
- postitional :: =seq=
- docu :: none
\hrule
* =caadr=
- type :: =:lambda=
- arguments :: :
- postitional :: =seq=
- docu :: none
\hrule
* =cadar=
- type :: =:lambda=
- arguments :: :
- postitional :: =seq=
- docu :: none
\hrule
* =caddr=
- type :: =:lambda=
- arguments :: :
- postitional :: =seq=
- docu :: none
\hrule
* =cdaar=
- type :: =:lambda=
- arguments :: :
- postitional :: =seq=
- docu :: none
\hrule
* =cdadr=
- type :: =:lambda=
- arguments :: :
- postitional :: =seq=
- docu :: none
\hrule
* =cddar=
- type :: =:lambda=
- arguments :: :
- postitional :: =seq=
- docu :: none
\hrule
* =cdddr=
- type :: =:lambda=
- arguments :: :
- postitional :: =seq=
- docu :: none
\hrule
* =define-class=
- defined in :: =oo.slime:22:22=
- type :: =:macro=
- arguments :: :
- postitional :: =name-and-members=:
- rest :: =body=
- docu ::
#+BEGIN:
Macro for creating simple classes.
#+END:
\hrule
* =->=
- defined in :: =oo.slime:25:24=
- type :: =:macro=
- arguments :: :
- postitional :: =obj=, =meth=:
- rest :: =args=
- docu :: none
\hrule
* =math::pi=
- defined in :: =pre.slime:338:12=
- type :: =:number=
- value :: =3.141593=
- docu ::
#+BEGIN:
Tha famous circle constant.
#+END:
\hrule
* =math::abs=
- defined in :: =pre.slime:338:12=
- type :: =:lambda=
- arguments :: :
- postitional :: =x=
- docu ::
#+BEGIN:
Accepts one argument and returns the absoulte value of it
#+END:
\hrule
* =math::sqrt=
- defined in :: =pre.slime:338:12=
- type :: =:lambda=
- arguments :: :
- postitional :: =x=
- docu ::
#+BEGIN:
Accepts one argument and returns the square root of it
#+END:
\hrule
* =math::make-vector3=
- defined in :: =pre.slime:338:12=
- type :: =:constructor=
- arguments :: :
- postitional :: =x=, =y=, =z=
- docu ::
#+BEGIN:
This is the handle to an object of the class vector3
#+END:
+29 -39
View File
@@ -1,5 +1,5 @@
inline proc maybe_wrap_body_in_begin(Lisp_Object* body) -> Lisp_Object* { inline proc maybe_wrap_body_in_begin(Lisp_Object* body) -> Lisp_Object* {
static Lisp_Object* begin_symbol = Memory::get_or_create_lisp_object_symbol("begin"); Lisp_Object* begin_symbol = Memory::get_or_create_lisp_object_symbol("begin");
if (body->value.pair.rest == Memory::nil) if (body->value.pair.rest == Memory::nil)
return body->value.pair.first; return body->value.pair.first;
else else
@@ -101,11 +101,11 @@ proc built_in_import(String* file_name) -> Lisp_Object* {
} }
proc load_built_ins_into_environment() -> void { proc load_built_ins_into_environment() -> void {
static String* file_name_built_ins = Memory::create_string(__FILE__); String* file_name_built_ins = Memory::create_string(__FILE__);
#define fetch1(var) \ #define fetch1(var) \
static Lisp_Object* var##_symbol = Memory::get_or_create_lisp_object_symbol(#var); \ Lisp_Object* var##_symbol = Memory::get_or_create_lisp_object_symbol(#var); \
Lisp_Object* var = lookup_symbol(var##_symbol, get_current_environment()); \ Lisp_Object* var = lookup_symbol(var##_symbol, get_current_environment()); \
if (Globals::error) printf("in %s:%d\n", __FILE__, __LINE__) if (Globals::error) printf("in %s:%d\n", __FILE__, __LINE__)
@@ -128,12 +128,12 @@ proc load_built_ins_into_environment() -> void {
// parser relys on being able to temporaily put in markers // parser relys on being able to temporaily put in markers
// in the code // in the code
#define _define_helper(def, docs, special) \ #define _define_helper(def, docs, special) \
static Lisp_Object* label(params,__LINE__) = Parser::parse_single_expression( \ auto label(params,__LINE__) = Parser::parse_single_expression( \
Memory::get_c_str(Memory::create_string(#def)) \ Memory::get_c_str(Memory::create_string(#def)) \
); \ ); \
assert_type(label(params,__LINE__), Lisp_Object_Type::Pair); \ assert_type(label(params,__LINE__), Lisp_Object_Type::Pair); \
assert_type(label(params,__LINE__)->value.pair.first, Lisp_Object_Type::Symbol); \ assert_type(label(params,__LINE__)->value.pair.first, Lisp_Object_Type::Symbol); \
static auto label(sym,__LINE__) = label(params,__LINE__)->value.pair.first; \ auto label(sym,__LINE__) = label(params,__LINE__)->value.pair.first; \
auto label(sfun,__LINE__) = Memory::create_lisp_object_cfunction(special); \ auto label(sfun,__LINE__) = Memory::create_lisp_object_cfunction(special); \
/*NOTE(Felix): for evaluating default args*/ \ /*NOTE(Felix): for evaluating default args*/ \
push_environment(get_root_environment()); \ push_environment(get_root_environment()); \
@@ -481,13 +481,13 @@ proc load_built_ins_into_environment() -> void {
fetch(sym, val); fetch(sym, val);
try assert_type(sym, Lisp_Object_Type::Symbol); try assert_type(sym, Lisp_Object_Type::Symbol);
Environment* target_env;
in_caller_env { in_caller_env {
val = eval_expr(val); val = eval_expr(val);
target_env = find_binding_environment(sym->value.symbol.identifier, get_current_environment());
try assert(target_env);
} }
Environment* target_env = find_binding_environment(sym->value.symbol.identifier, get_current_environment());
try assert(target_env);
push_environment(target_env); push_environment(target_env);
{ {
@@ -728,13 +728,14 @@ proc load_built_ins_into_environment() -> void {
return result; return result;
}; };
define((begin . args), "TODO") { define_special((begin . args), "TODO") {
fetch(args); fetch(args);
Lisp_Object* result = Memory::nil; Lisp_Object* result = Memory::nil;
for_lisp_list(args) { in_caller_env {
try result = eval_expr(it); for_lisp_list(args) {
try result = eval_expr(it);
}
} }
return result; return result;
}; };
define((list . args), "TODO") { define((list . args), "TODO") {
@@ -813,6 +814,10 @@ proc load_built_ins_into_environment() -> void {
} }
return Memory::get_or_create_lisp_object_keyword("unknown"); return Memory::get_or_create_lisp_object_keyword("unknown");
}; };
define((mem-reset), "TODO") {
Memory::reset();
return Memory::nil;
};
// NOTE(Felix): we need to define_special because the docstring is // NOTE(Felix): we need to define_special because the docstring is
// attached to the symbol. Because some object are singletons // attached to the symbol. Because some object are singletons
// (symbols, keyowrds, nil, t) we dont want to store docs on the // (symbols, keyowrds, nil, t) we dont want to store docs on the
@@ -887,20 +892,6 @@ proc load_built_ins_into_environment() -> void {
printf("}\n"); printf("}\n");
} }
// }
// // TODO(Felix): Maybe don't compare strings here?? Wtf
// if (Memory::get_type(type) == Lisp_Object_Type::Keyword &&
// (string_equal(type->value.symbol.identifier, "lambda") ||
// string_equal(type->value.symbol.identifier, "special-lambda") ||
// string_equal(type->value.symbol.identifier, "macro")))
// {
// Lisp_Object* fun = eval_expr(n);
// if (fun->docstring)
// printf("Docstring:\n==========\n%s\n\n", Memory::get_c_str(fun->docstring));
// else
// printf("No docstring avaliable\n");
return Memory::nil; return Memory::nil;
}; };
define((show n), "TODO") { define((show n), "TODO") {
@@ -968,21 +959,20 @@ proc load_built_ins_into_environment() -> void {
Memory::print_status(); Memory::print_status();
return Memory::nil; return Memory::nil;
}; };
// // defun("try", "TODO", __LINE__, cLambda { define_special((mytry try_part catch_part), "TODO") {
// // try arguments_length = list_length(arguments); fetch(try_part, catch_part);
// // try assert_arguments_length(2, arguments_length);
// // Lisp_Object* try_part = arguments->value.pair.first; Lisp_Object* result;
// // Lisp_Object* catch_part = arguments->value.pair.rest->value.pair.first;
// // Lisp_Object* result;
// // result = eval_expr(try_part); in_caller_env {
// // if (Globals::error) { result = eval_expr(try_part);
// // delete_error(); if (Globals::error) {
// // try result = eval_expr(catch_part); delete_error();
// // } try result = eval_expr(catch_part);
// // return result; }
// // }); }
return result;
};
define((load file), "TODO") { define((load file), "TODO") {
fetch(file); fetch(file);
try assert_type(file, Lisp_Object_Type::String); try assert_type(file, Lisp_Object_Type::String);
+3 -1
View File
@@ -84,7 +84,9 @@ inline proc get_current_environment() -> Environment* {
} }
proc lookup_symbol(Lisp_Object* node, Environment* env) -> Lisp_Object* { proc lookup_symbol(Lisp_Object* node, Environment* env) -> Lisp_Object* {
assert_type(node, Lisp_Object_Type::Symbol); // print(node);
// printf("\n");
assert_type(node, Lisp_Object_Type::Symbol);
Lisp_Object* result = try_lookup_symbol(node, env); Lisp_Object* result = try_lookup_symbol(node, env);
+1 -1
View File
@@ -16,7 +16,7 @@ proc create_error(const char* c_file_name, int c_file_line, Lisp_Object* type, S
delete_error(); delete_error();
if (Globals::breaking_on_errors) { if (Globals::breaking_on_errors) {
debug_break(); // debug_break();
} }
// visualize_lisp_machine(); // visualize_lisp_machine();
+1
View File
@@ -321,6 +321,7 @@ proc create_arguments_from_lambda_list_and_inject(Lisp_Object* arguments, Lisp_O
create_parsing_error("Default args must be a list of 2."); create_parsing_error("Default args must be a list of 2.");
} }
auto value = arguments->value.pair.first->value.pair.rest->value.pair.first; auto value = arguments->value.pair.first->value.pair.rest->value.pair.first;
value = eval_expr(value);
if (arguments->value.pair.first->value.pair.rest->value.pair.rest != Memory::nil) { if (arguments->value.pair.first->value.pair.rest->value.pair.rest != Memory::nil) {
create_parsing_error("Default args must be a list of 2."); create_parsing_error("Default args must be a list of 2.");
} }
+1 -1
View File
@@ -4,7 +4,7 @@ int main(int argc, char* argv[]) {
if (argc > 1) { if (argc > 1) {
if (Slime::string_equal(argv[1], "--run-tests")) { if (Slime::string_equal(argv[1], "--run-tests")) {
int res = Slime::run_all_tests(); int res = Slime::run_all_tests();
Slime::interprete_file((char*)"generate-docs.slime"); // Slime::interprete_file((char*)"generate-docs.slime");
return res ? 0 : 1; return res ? 0 : 1;
} }