alists and plists now
This commit is contained in:
+2
-1
@@ -15,4 +15,5 @@ todo.html
|
|||||||
*.expanded
|
*.expanded
|
||||||
/bin/vgcore.*
|
/bin/vgcore.*
|
||||||
/manual/manual.pdf
|
/manual/manual.pdf
|
||||||
/manual/manual.tex
|
/manual/manual.tex
|
||||||
|
*.out
|
||||||
|
|||||||
+94
-3
@@ -13,10 +13,29 @@
|
|||||||
;; key1 key2
|
;; key1 key2
|
||||||
;;
|
;;
|
||||||
;; '(((key1 . value1) (key2 . value2)))
|
;; '(((key1 . value1) (key2 . value2)))
|
||||||
|
|
||||||
|
;; plist:
|
||||||
|
;; [ |/]
|
||||||
|
;; |
|
||||||
|
;; V
|
||||||
|
;; [ | ]------------->[ | ]-------------> ...
|
||||||
|
;; | |
|
||||||
|
;; V V
|
||||||
|
;; :key1 value1
|
||||||
|
;;
|
||||||
|
;; '((:key1 value1 :key2 value2))
|
||||||
|
|
||||||
(define key-not-found-index -1)
|
(define key-not-found-index -1)
|
||||||
|
|
||||||
(define (make-alist)
|
(define (make-alist)
|
||||||
'(()))
|
(set-type
|
||||||
|
'(())
|
||||||
|
:alist))
|
||||||
|
|
||||||
|
(define (make-plist)
|
||||||
|
(set-type
|
||||||
|
'(())
|
||||||
|
:plist))
|
||||||
|
|
||||||
(define (pprint-alist alist)
|
(define (pprint-alist alist)
|
||||||
(let ((associations (first alist)))
|
(let ((associations (first alist)))
|
||||||
@@ -32,6 +51,19 @@
|
|||||||
(pprint-intern associations))
|
(pprint-intern associations))
|
||||||
(print ")\n")))
|
(print ")\n")))
|
||||||
|
|
||||||
|
(define (pprint-plist plist)
|
||||||
|
(let ((props (first plist)))
|
||||||
|
(define (pprint-intern props)
|
||||||
|
(when props
|
||||||
|
(printf " "
|
||||||
|
(car props) "->"
|
||||||
|
(cadr props))
|
||||||
|
(pprint-intern (cddr props))))
|
||||||
|
(print "(")
|
||||||
|
(when props
|
||||||
|
(print "\n")
|
||||||
|
(pprint-intern props))
|
||||||
|
(print ")\n")))
|
||||||
|
|
||||||
(define (alist-get alist key)
|
(define (alist-get alist key)
|
||||||
(let ((associations (first alist)))
|
(let ((associations (first alist)))
|
||||||
@@ -76,7 +108,8 @@
|
|||||||
|
|
||||||
(cond ((= index key-not-found-index) (error "key to remove was not found"))
|
(cond ((= index key-not-found-index) (error "key to remove was not found"))
|
||||||
((= index 0) (mutate alist (pair (cdar alist) ())))
|
((= index 0) (mutate alist (pair (cdar alist) ())))
|
||||||
(else (alist-remove!-internal alist index)))))
|
(else (alist-remove!-internal alist index))))
|
||||||
|
alist)
|
||||||
|
|
||||||
|
|
||||||
(define (alist-set! alist key value)
|
(define (alist-set! alist key value)
|
||||||
@@ -93,4 +126,62 @@
|
|||||||
((null? associations) (alist-set! alist key value))
|
((null? associations) (alist-set! alist key value))
|
||||||
(else (alist-set-overwrite-intern
|
(else (alist-set-overwrite-intern
|
||||||
(rest associations) key value))))
|
(rest associations) key value))))
|
||||||
(alist-set-overwrite-intern associations key value)))
|
(alist-set-overwrite-intern associations key value))
|
||||||
|
alist)
|
||||||
|
|
||||||
|
|
||||||
|
(define (plist-get plist prop)
|
||||||
|
(let ((props (first plist)))
|
||||||
|
(define (plist-get-intern props prop)
|
||||||
|
(cond ((null? props)
|
||||||
|
(error "property was not found in plist"))
|
||||||
|
((= (car props) prop)
|
||||||
|
(cadr props))
|
||||||
|
(else (plist-get-intern (cddr props) prop))))
|
||||||
|
(plist-get-intern props prop)))
|
||||||
|
|
||||||
|
(define (plist-set! plist prop value)
|
||||||
|
(mutate plist (pair (pair prop (pair value (first plist))) ())))
|
||||||
|
|
||||||
|
(define (plist-set-overwrite! plist prop value)
|
||||||
|
(let ((props (first plist)))
|
||||||
|
(define (plist-set-overwrite-intern props prop value)
|
||||||
|
(cond ((= (car props) prop)
|
||||||
|
(mutate (cdr props) (pair value (cddr props))))
|
||||||
|
((null? props) (plist-set! plist prop value))
|
||||||
|
(else (plist-set-overwrite-intern
|
||||||
|
(cddr props) prop value))))
|
||||||
|
(plist-set-overwrite-intern props prop value))
|
||||||
|
plist)
|
||||||
|
|
||||||
|
(define (plist-find plist prop)
|
||||||
|
(let ((props (first plist)))
|
||||||
|
(define (plist-find-intern props prop current-index)
|
||||||
|
(cond ((null? props) key-not-found-index)
|
||||||
|
((= (car props) prop) current-index)
|
||||||
|
(else (plist-find-intern (cddr props) prop
|
||||||
|
(+ 1 current-index)))))
|
||||||
|
(plist-find-intern props prop 0)))
|
||||||
|
|
||||||
|
(define (plist-prop-exists? plist prop)
|
||||||
|
(not (= (plist-find plist prop)
|
||||||
|
key-not-found-index)))
|
||||||
|
|
||||||
|
(define (plist-remove! plist prop)
|
||||||
|
(let ((index (plist-find plist prop)))
|
||||||
|
(define (plist-remove!-internal props index)
|
||||||
|
;; reminder: we only get called if we are not replacing the
|
||||||
|
;; first element in the alist
|
||||||
|
;; reminder2: we know that the key exists
|
||||||
|
(if (= index 1)
|
||||||
|
;; we want to remove the next one, so we set our
|
||||||
|
;; cdr to the next next one
|
||||||
|
(mutate (cdar props) (pair (cadar props) ;; xD nice meme dude!!!
|
||||||
|
(cdr (cdr (cdr (cdar props))))))
|
||||||
|
;; else cdr-recurse
|
||||||
|
(plist-remove!-internal (cddr props) (- index 1))))
|
||||||
|
|
||||||
|
(cond ((= index key-not-found-index) (error "prop to remove was not found"))
|
||||||
|
((= index 0) (mutate plist (pair (cddar plist) ())))
|
||||||
|
(else (plist-remove!-internal plist index))))
|
||||||
|
plist)
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
(import "alist.slime")
|
||||||
(import "oo.slime")
|
(import "oo.slime")
|
||||||
(import "math.slime")
|
(import "math.slime")
|
||||||
|
|
||||||
|
|||||||
+71
-17
@@ -17,8 +17,8 @@ condition is true.
|
|||||||
{{{example_end}}}
|
{{{example_end}}}
|
||||||
"
|
"
|
||||||
(if (= (rest body) ())
|
(if (= (rest body) ())
|
||||||
`(if ,condition @body)
|
`(if ,condition @body nil)
|
||||||
`(if ,condition (begin @body))))
|
`(if ,condition (begin @body) nil)))
|
||||||
|
|
||||||
(define-syntax (unless condition :rest body)
|
(define-syntax (unless condition :rest body)
|
||||||
"Special form for when multiple actions should be done if a
|
"Special form for when multiple actions should be done if a
|
||||||
@@ -57,13 +57,28 @@ condition is false."
|
|||||||
nil
|
nil
|
||||||
(if (= (first (first clauses)) 'else)
|
(if (= (first (first clauses)) 'else)
|
||||||
(begin
|
(begin
|
||||||
(if (not (= () (rest clauses)))
|
(if (not (= (rest clauses) ()))
|
||||||
(error "There are additional clauses after the else clause!")
|
(error "There are additional clauses after the else clause!")
|
||||||
(pair 'begin (rest (first clauses)))))
|
(pair 'begin (rest (first clauses)))))
|
||||||
`(if ,(first (first clauses))
|
`(if ,(first (first clauses))
|
||||||
(begin @(rest (first clauses)))
|
(begin @(rest (first clauses)))
|
||||||
,(rec (rest clauses))))))
|
,(rec (rest clauses))))))
|
||||||
(rec clauses))
|
(rec clauses))
|
||||||
|
|
||||||
|
|
||||||
|
(define-syntax (case var :rest 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 (member? ,var ',(first (first clauses)))
|
||||||
|
(begin @(rest (first clauses)))
|
||||||
|
,(rec (rest clauses))))))
|
||||||
|
(rec clauses))
|
||||||
|
|
||||||
(define-syntax (define-special name-and-args :rest body)
|
(define-syntax (define-special name-and-args :rest body)
|
||||||
`(define ,(first name-and-args) (special-lambda ,(rest name-and-args) @body)))
|
`(define ,(first name-and-args) (special-lambda ,(rest name-and-args) @body)))
|
||||||
@@ -110,10 +125,24 @@ condition is false."
|
|||||||
(rec body))
|
(rec body))
|
||||||
|
|
||||||
(define-syntax (apply fun seq)
|
(define-syntax (apply fun seq)
|
||||||
"Applies the funciton to the sequence, as in calls the function with
|
"Applies the function to the sequence, as in calls the function with
|
||||||
ithe sequence as arguemens."
|
ithe sequence as arguemens."
|
||||||
`(eval (pair ,fun ,seq)))
|
`(eval (pair ,fun ,seq)))
|
||||||
|
|
||||||
|
(define-syntax (define-typed args :rest 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 @arg-names)
|
||||||
|
(assert-types= @lambda-list)
|
||||||
|
@body)))
|
||||||
|
|
||||||
|
(define-typed (ttt a :number b :alist)
|
||||||
|
(printf a b))
|
||||||
|
|
||||||
(define-syntax (define-package name :rest body)
|
(define-syntax (define-package name :rest body)
|
||||||
`(define ,(string->symbol (concat-strings (symbol->string name) "->"))
|
`(define ,(string->symbol (concat-strings (symbol->string name) "->"))
|
||||||
@@ -131,43 +160,62 @@ ithe sequence as arguemens."
|
|||||||
|
|
||||||
(define (null? x)
|
(define (null? x)
|
||||||
"Checks if the argument is =nil=."
|
"Checks if the argument is =nil=."
|
||||||
(= x nil))
|
(= x ()))
|
||||||
|
|
||||||
|
(define (type=? obj typ)
|
||||||
|
"Checks if the argument =obj= is of type =typ="
|
||||||
|
(= (type obj) typ))
|
||||||
|
|
||||||
|
(define (types=? :rest objs)
|
||||||
|
;; TODO make inner rec functoin to avoid evalutating every time
|
||||||
|
(if objs
|
||||||
|
(begin
|
||||||
|
(assert (keyword? (first (rest objs))))
|
||||||
|
(if (type=? (first objs) (first (rest objs)))
|
||||||
|
(apply types=? (rest (rest objs)))
|
||||||
|
()))
|
||||||
|
t))
|
||||||
|
|
||||||
|
(define (assert-types= :rest objs)
|
||||||
|
(break)
|
||||||
|
(unless (apply types=? objs)
|
||||||
|
(error "assert-types=: types do not match")))
|
||||||
|
|
||||||
(define (number? x)
|
(define (number? x)
|
||||||
"Checks if the argument is a number."
|
"Checks if the argument is a number."
|
||||||
(= (type x) :number))
|
(type=? x :number))
|
||||||
|
|
||||||
(define (symbol? x)
|
(define (symbol? x)
|
||||||
"Checks if the argument is a symbol."
|
"Checks if the argument is a symbol."
|
||||||
(= (type x) :symbol))
|
(type=? x :symbol))
|
||||||
|
|
||||||
(define (keyword? x)
|
(define (keyword? x)
|
||||||
"Checks if the argument is a keyword."
|
"Checks if the argument is a keyword."
|
||||||
(= (type x) :keyword))
|
(type=? x :keyword))
|
||||||
|
|
||||||
(define (pair? x)
|
(define (pair? x)
|
||||||
"Checks if the argument is a pair."
|
"Checks if the argument is a pair."
|
||||||
(= (type x) :pair))
|
(type=? x :pair))
|
||||||
|
|
||||||
(define (string? x)
|
(define (string? x)
|
||||||
"Checks if the argument is a string."
|
"Checks if the argument is a string."
|
||||||
(= (type x) :string))
|
(type=? x :string))
|
||||||
|
|
||||||
(define (lambda? x)
|
(define (lambda? x)
|
||||||
"Checks if the argument is a function."
|
"Checks if the argument is a function."
|
||||||
(= (type x) :lambda))
|
(type=? x :lambda))
|
||||||
|
|
||||||
(define (macro? x)
|
(define (macro? x)
|
||||||
"Checks if the argument is a macro."
|
"Checks if the argument is a macro."
|
||||||
(= (type x) :macro))
|
(type=? x :macro))
|
||||||
|
|
||||||
(define (special-lambda? x)
|
(define (special-lambda? x)
|
||||||
"Checks if the argument is a special-lambda."
|
"Checks if the argument is a special-lambda."
|
||||||
(= (type x) :dynamic-macro))
|
(type=? x :dynamic-macro))
|
||||||
|
|
||||||
(define (built-in-function? x)
|
(define (built-in-function? x)
|
||||||
"Checks if the argument is a built-in function."
|
"Checks if the argument is a built-in function."
|
||||||
(= (type x) :built-in-function))
|
(type=? x :built-in-function))
|
||||||
|
|
||||||
(define (callable? x)
|
(define (callable? x)
|
||||||
(or (lambda? x)
|
(or (lambda? x)
|
||||||
@@ -229,6 +277,12 @@ with (pair elem nil)."
|
|||||||
0
|
0
|
||||||
(+ 1 (length (rest seq)))))
|
(+ 1 (length (rest seq)))))
|
||||||
|
|
||||||
|
(define (member? elem seq)
|
||||||
|
(when (pair? seq)
|
||||||
|
(if (= elem (first seq))
|
||||||
|
t
|
||||||
|
(member? elem (rest seq)))))
|
||||||
|
|
||||||
(define (sublist-starting-at-index seq index)
|
(define (sublist-starting-at-index seq index)
|
||||||
(cond ((< index 0)
|
(cond ((< index 0)
|
||||||
(error "sublist-starting-at-index: index must be positive"))
|
(error "sublist-starting-at-index: index must be positive"))
|
||||||
|
|||||||
+20
-10
@@ -1,22 +1,30 @@
|
|||||||
(define (null? x) "Checks if the argument is =nil=." (= x nil))
|
(define-typed (ttt a :number b :alist) (printf a b))
|
||||||
|
|
||||||
(define (number? x) "Checks if the argument is a number." (= (type x) :number))
|
(define (null? x) "Checks if the argument is =nil=." (= x ()))
|
||||||
|
|
||||||
(define (symbol? x) "Checks if the argument is a symbol." (= (type x) :symbol))
|
(define (type=? obj typ) "Checks if the argument =obj= is of type =typ=" (= (type obj) typ))
|
||||||
|
|
||||||
(define (keyword? x) "Checks if the argument is a keyword." (= (type x) :keyword))
|
(define (types=? :rest objs) (if objs (begin (assert (keyword? (first (rest objs)))) (if (type=? (first objs) (first (rest objs))) (apply types=? (rest (rest objs))) ())) t))
|
||||||
|
|
||||||
(define (pair? x) "Checks if the argument is a pair." (= (type x) :pair))
|
(define (assert-types= :rest objs) (break) (unless (apply types=? objs) (error "assert-types=: types do not match")))
|
||||||
|
|
||||||
(define (string? x) "Checks if the argument is a string." (= (type x) :string))
|
(define (number? x) "Checks if the argument is a number." (type=? x :number))
|
||||||
|
|
||||||
(define (lambda? x) "Checks if the argument is a function." (= (type x) :lambda))
|
(define (symbol? x) "Checks if the argument is a symbol." (type=? x :symbol))
|
||||||
|
|
||||||
(define (macro? x) "Checks if the argument is a macro." (= (type x) :macro))
|
(define (keyword? x) "Checks if the argument is a keyword." (type=? x :keyword))
|
||||||
|
|
||||||
(define (special-lambda? x) "Checks if the argument is a special-lambda." (= (type x) :dynamic-macro))
|
(define (pair? x) "Checks if the argument is a pair." (type=? x :pair))
|
||||||
|
|
||||||
(define (built-in-function? x) "Checks if the argument is a built-in function." (= (type x) :built-in-function))
|
(define (string? x) "Checks if the argument is a string." (type=? x :string))
|
||||||
|
|
||||||
|
(define (lambda? x) "Checks if the argument is a function." (type=? x :lambda))
|
||||||
|
|
||||||
|
(define (macro? x) "Checks if the argument is a macro." (type=? x :macro))
|
||||||
|
|
||||||
|
(define (special-lambda? x) "Checks if the argument is a special-lambda." (type=? x :dynamic-macro))
|
||||||
|
|
||||||
|
(define (built-in-function? x) "Checks if the argument is a built-in function." (type=? x :built-in-function))
|
||||||
|
|
||||||
(define (callable? x) (or (lambda? x) (special-lambda? x) (macro? x) (built-in-function? x)))
|
(define (callable? x) (or (lambda? x) (special-lambda? x) (macro? x) (built-in-function? x)))
|
||||||
|
|
||||||
@@ -32,6 +40,8 @@
|
|||||||
|
|
||||||
(define (length seq) "Returns the length of the given sequence." (if (null? seq) 0 (+ 1 (length (rest seq)))))
|
(define (length seq) "Returns the length of the given sequence." (if (null? seq) 0 (+ 1 (length (rest seq)))))
|
||||||
|
|
||||||
|
(define (member? elem seq) (when (pair? seq) (if (= elem (first seq)) t (member? elem (rest seq)))))
|
||||||
|
|
||||||
(define (sublist-starting-at-index seq index) (cond ((< index 0) (error "sublist-starting-at-index: index must be positive")) ((null? seq) ()) ((= 0 index) seq) (else (sublist-starting-at (rest seq) (- index 1)))))
|
(define (sublist-starting-at-index seq index) (cond ((< index 0) (error "sublist-starting-at-index: index must be positive")) ((null? seq) ()) ((= 0 index) seq) (else (sublist-starting-at (rest seq) (- index 1)))))
|
||||||
|
|
||||||
(define (list-without-index seq index) (cond ((or (< index 0) (null? seq)) (error "list-remove-index!: index out of range")) ((= 0 index) (rest seq)) (else (pair (first seq) (list-without-index (rest seq) (- index 1))))))
|
(define (list-without-index seq index) (cond ((or (< index 0) (null? seq)) (error "list-remove-index!: index out of range")) ((= 0 index) (rest seq)) (else (pair (first seq) (list-without-index (rest seq) (- index 1))))))
|
||||||
|
|||||||
+54
-1
@@ -1,7 +1,7 @@
|
|||||||
(import "alist.slime")
|
(import "alist.slime")
|
||||||
|
|
||||||
(define a (make-alist))
|
(define a (make-alist))
|
||||||
;; a == ()
|
;; a == (())
|
||||||
|
|
||||||
(assert (= (first a) ()))
|
(assert (= (first a) ()))
|
||||||
|
|
||||||
@@ -46,3 +46,56 @@
|
|||||||
(assert (= (length (first a)) 2))
|
(assert (= (length (first a)) 2))
|
||||||
(assert (= (alist-get a 'key1) 'value1))
|
(assert (= (alist-get a 'key1) 'value1))
|
||||||
(assert (= (alist-get a 'key2) 'value2))
|
(assert (= (alist-get a 'key2) 'value2))
|
||||||
|
|
||||||
|
|
||||||
|
;; -------------
|
||||||
|
;;
|
||||||
|
;; PLISTS
|
||||||
|
;;
|
||||||
|
;; -------------
|
||||||
|
|
||||||
|
(define p (make-plist))
|
||||||
|
;; p == (())
|
||||||
|
|
||||||
|
(assert (= (first p) ()))
|
||||||
|
|
||||||
|
(plist-set! p :key1 'value1)
|
||||||
|
;; p == ((:key1 value1))
|
||||||
|
|
||||||
|
(assert (= (plist-get p :key1) 'value1))
|
||||||
|
(assert (plist-prop-exists? p :key1))
|
||||||
|
(assert (not (plist-prop-exists? p :key2)))
|
||||||
|
|
||||||
|
(plist-set! p :key2 'value2)
|
||||||
|
;; p == ((:key2 value2,
|
||||||
|
;; :key1 value1))
|
||||||
|
|
||||||
|
(assert (= (plist-get p :key2) 'value2))
|
||||||
|
(assert (plist-prop-exists? p :key2))
|
||||||
|
(assert (= (plist-find p :key2) 0))
|
||||||
|
(assert (= (plist-find p :key1) 1))
|
||||||
|
(assert (= (length (first p)) 4))
|
||||||
|
|
||||||
|
(plist-set! p :key1 'value3)
|
||||||
|
;; p == ((:key1 value3,
|
||||||
|
;; :key2 value2,
|
||||||
|
;; :key1 value1))
|
||||||
|
|
||||||
|
(assert (= (length (first p)) 6))
|
||||||
|
(assert (= (plist-get p :key1) 'value3))
|
||||||
|
|
||||||
|
(plist-set-overwrite! p :key1 'value4)
|
||||||
|
;; p == ((:key1 value4,
|
||||||
|
;; :key2 value2,
|
||||||
|
;; :key1 value1))
|
||||||
|
|
||||||
|
(assert (= (length (first p)) 6))
|
||||||
|
(assert (= (plist-get p :key1) 'value4))
|
||||||
|
|
||||||
|
(plist-remove! p :key1)
|
||||||
|
;; p == ((:key2 value2,
|
||||||
|
;; :key1 value1))
|
||||||
|
|
||||||
|
(assert (= (length (first p)) 4))
|
||||||
|
(assert (= (plist-get p :key1) 'value1))
|
||||||
|
(assert (= (plist-get p :key2) 'value2))
|
||||||
|
|||||||
@@ -0,0 +1,37 @@
|
|||||||
|
(define (test-cond x)
|
||||||
|
(cond ((< 0 x) +1)
|
||||||
|
((> 0 x) -1)
|
||||||
|
(else 0)))
|
||||||
|
|
||||||
|
(assert (= (test-cond 10) 1))
|
||||||
|
(assert (= (test-cond 1) 1))
|
||||||
|
(assert (= (test-cond 123) 1))
|
||||||
|
|
||||||
|
(assert (= (test-cond -10) -1))
|
||||||
|
(assert (= (test-cond -1) -1))
|
||||||
|
(assert (= (test-cond -123) -1))
|
||||||
|
|
||||||
|
(assert (= (test-cond 0) 0))
|
||||||
|
(assert (= (test-cond -0) 0))
|
||||||
|
(assert (= (test-cond +0) 0))
|
||||||
|
|
||||||
|
|
||||||
|
(define (test-case x)
|
||||||
|
(case x
|
||||||
|
((a b 3) 1)
|
||||||
|
((4 5 6) -1)
|
||||||
|
(else 'xD)))
|
||||||
|
|
||||||
|
|
||||||
|
(assert (= (test-case 'a) 1))
|
||||||
|
(assert (= (test-case 'b) 1))
|
||||||
|
(assert (= (test-case 3) 1))
|
||||||
|
|
||||||
|
(assert (= (test-case 4) -1))
|
||||||
|
(assert (= (test-case 5) -1))
|
||||||
|
(assert (= (test-case 6) -1))
|
||||||
|
|
||||||
|
(assert (= (test-case 0) 'xD))
|
||||||
|
(assert (= (test-case 1) 'xD))
|
||||||
|
(assert (= (test-case :asd) 'xD))
|
||||||
|
|
||||||
@@ -14,9 +14,14 @@ call timecmd cl ../src/main.cpp /std:c++latest /Fe%exeName% /W3 /Zi /nologo /EHs
|
|||||||
popd
|
popd
|
||||||
if %errorlevel% == 0 (
|
if %errorlevel% == 0 (
|
||||||
echo.
|
echo.
|
||||||
echo Done
|
echo ---- Running Tests ----
|
||||||
echo.
|
echo.
|
||||||
call timecmd bin\slime.exe --run-tests
|
call timecmd bin\slime.exe --run-tests
|
||||||
|
echo.
|
||||||
|
echo ---- Genderating Docs ----
|
||||||
|
echo.
|
||||||
|
call timecmd bin\slime generate-docs.slime
|
||||||
|
|
||||||
) else (
|
) else (
|
||||||
echo.
|
echo.
|
||||||
echo Fuckin' ell
|
echo Fuckin' ell
|
||||||
|
|||||||
+348
-64
@@ -1,7 +1,7 @@
|
|||||||
\hrule
|
\hrule
|
||||||
* ===
|
* ===
|
||||||
|
|
||||||
- defined in :: =src/./built_ins.cpp:158:0=
|
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:158:0=
|
||||||
- type :: =:cfunction=
|
- type :: =:cfunction=
|
||||||
- docu ::
|
- docu ::
|
||||||
#+BEGIN:
|
#+BEGIN:
|
||||||
@@ -10,7 +10,7 @@ Takes 0 or more arguments and returns =t= if all arguments are equal and =()= ot
|
|||||||
\hrule
|
\hrule
|
||||||
* =>=
|
* =>=
|
||||||
|
|
||||||
- defined in :: =src/./built_ins.cpp:175:0=
|
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:175:0=
|
||||||
- type :: =:cfunction=
|
- type :: =:cfunction=
|
||||||
- docu ::
|
- docu ::
|
||||||
#+BEGIN:
|
#+BEGIN:
|
||||||
@@ -19,7 +19,7 @@ TODO
|
|||||||
\hrule
|
\hrule
|
||||||
* =>==
|
* =>==
|
||||||
|
|
||||||
- defined in :: =src/./built_ins.cpp:193:0=
|
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:193:0=
|
||||||
- type :: =:cfunction=
|
- type :: =:cfunction=
|
||||||
- docu ::
|
- docu ::
|
||||||
#+BEGIN:
|
#+BEGIN:
|
||||||
@@ -28,7 +28,7 @@ TODO
|
|||||||
\hrule
|
\hrule
|
||||||
* =<=
|
* =<=
|
||||||
|
|
||||||
- defined in :: =src/./built_ins.cpp:211:0=
|
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:211:0=
|
||||||
- type :: =:cfunction=
|
- type :: =:cfunction=
|
||||||
- docu ::
|
- docu ::
|
||||||
#+BEGIN:
|
#+BEGIN:
|
||||||
@@ -37,7 +37,7 @@ TODO
|
|||||||
\hrule
|
\hrule
|
||||||
* =<==
|
* =<==
|
||||||
|
|
||||||
- defined in :: =src/./built_ins.cpp:231:0=
|
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:231:0=
|
||||||
- type :: =:cfunction=
|
- type :: =:cfunction=
|
||||||
- docu ::
|
- docu ::
|
||||||
#+BEGIN:
|
#+BEGIN:
|
||||||
@@ -46,7 +46,7 @@ TODO
|
|||||||
\hrule
|
\hrule
|
||||||
* =+=
|
* =+=
|
||||||
|
|
||||||
- defined in :: =src/./built_ins.cpp:249:0=
|
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:249:0=
|
||||||
- type :: =:cfunction=
|
- type :: =:cfunction=
|
||||||
- docu ::
|
- docu ::
|
||||||
#+BEGIN:
|
#+BEGIN:
|
||||||
@@ -55,7 +55,7 @@ TODO
|
|||||||
\hrule
|
\hrule
|
||||||
* =-=
|
* =-=
|
||||||
|
|
||||||
- defined in :: =src/./built_ins.cpp:262:0=
|
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:262:0=
|
||||||
- type :: =:cfunction=
|
- type :: =:cfunction=
|
||||||
- docu ::
|
- docu ::
|
||||||
#+BEGIN:
|
#+BEGIN:
|
||||||
@@ -64,7 +64,7 @@ TODO
|
|||||||
\hrule
|
\hrule
|
||||||
* =*=
|
* =*=
|
||||||
|
|
||||||
- defined in :: =src/./built_ins.cpp:285:0=
|
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:285:0=
|
||||||
- type :: =:cfunction=
|
- type :: =:cfunction=
|
||||||
- docu ::
|
- docu ::
|
||||||
#+BEGIN:
|
#+BEGIN:
|
||||||
@@ -73,7 +73,7 @@ TODO
|
|||||||
\hrule
|
\hrule
|
||||||
* =/=
|
* =/=
|
||||||
|
|
||||||
- defined in :: =src/./built_ins.cpp:306:0=
|
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:306:0=
|
||||||
- type :: =:cfunction=
|
- type :: =:cfunction=
|
||||||
- docu ::
|
- docu ::
|
||||||
#+BEGIN:
|
#+BEGIN:
|
||||||
@@ -82,7 +82,7 @@ TODO
|
|||||||
\hrule
|
\hrule
|
||||||
* =**=
|
* =**=
|
||||||
|
|
||||||
- defined in :: =src/./built_ins.cpp:327:0=
|
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:327:0=
|
||||||
- type :: =:cfunction=
|
- type :: =:cfunction=
|
||||||
- docu ::
|
- docu ::
|
||||||
#+BEGIN:
|
#+BEGIN:
|
||||||
@@ -91,7 +91,7 @@ TODO
|
|||||||
\hrule
|
\hrule
|
||||||
* =%=
|
* =%=
|
||||||
|
|
||||||
- defined in :: =src/./built_ins.cpp:343:0=
|
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:343:0=
|
||||||
- type :: =:cfunction=
|
- type :: =:cfunction=
|
||||||
- docu ::
|
- docu ::
|
||||||
#+BEGIN:
|
#+BEGIN:
|
||||||
@@ -100,7 +100,7 @@ TODO
|
|||||||
\hrule
|
\hrule
|
||||||
* =assert=
|
* =assert=
|
||||||
|
|
||||||
- defined in :: =src/./built_ins.cpp:359:0=
|
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:359:0=
|
||||||
- type :: =:cfunction=
|
- type :: =:cfunction=
|
||||||
- docu ::
|
- docu ::
|
||||||
#+BEGIN:
|
#+BEGIN:
|
||||||
@@ -109,7 +109,7 @@ TODO
|
|||||||
\hrule
|
\hrule
|
||||||
* =define=
|
* =define=
|
||||||
|
|
||||||
- defined in :: =src/./built_ins.cpp:371:0=
|
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:371:0=
|
||||||
- type :: =:cfunction=
|
- type :: =:cfunction=
|
||||||
- docu ::
|
- docu ::
|
||||||
#+BEGIN:
|
#+BEGIN:
|
||||||
@@ -118,7 +118,7 @@ TODO
|
|||||||
\hrule
|
\hrule
|
||||||
* =mutate=
|
* =mutate=
|
||||||
|
|
||||||
- defined in :: =src/./built_ins.cpp:433:0=
|
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:433:0=
|
||||||
- type :: =:cfunction=
|
- type :: =:cfunction=
|
||||||
- docu ::
|
- docu ::
|
||||||
#+BEGIN:
|
#+BEGIN:
|
||||||
@@ -127,7 +127,7 @@ TODO
|
|||||||
\hrule
|
\hrule
|
||||||
* =if=
|
* =if=
|
||||||
|
|
||||||
- defined in :: =src/./built_ins.cpp:458:0=
|
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:458:0=
|
||||||
- type :: =:cfunction=
|
- type :: =:cfunction=
|
||||||
- docu ::
|
- docu ::
|
||||||
#+BEGIN:
|
#+BEGIN:
|
||||||
@@ -136,7 +136,7 @@ TODO
|
|||||||
\hrule
|
\hrule
|
||||||
* =quote=
|
* =quote=
|
||||||
|
|
||||||
- defined in :: =src/./built_ins.cpp:480:0=
|
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:478:0=
|
||||||
- type :: =:cfunction=
|
- type :: =:cfunction=
|
||||||
- docu ::
|
- docu ::
|
||||||
#+BEGIN:
|
#+BEGIN:
|
||||||
@@ -145,7 +145,7 @@ TODO
|
|||||||
\hrule
|
\hrule
|
||||||
* =quasiquote=
|
* =quasiquote=
|
||||||
|
|
||||||
- defined in :: =src/./built_ins.cpp:485:0=
|
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:483:0=
|
||||||
- type :: =:cfunction=
|
- type :: =:cfunction=
|
||||||
- docu ::
|
- docu ::
|
||||||
#+BEGIN:
|
#+BEGIN:
|
||||||
@@ -154,7 +154,7 @@ TODO
|
|||||||
\hrule
|
\hrule
|
||||||
* =and=
|
* =and=
|
||||||
|
|
||||||
- defined in :: =src/./built_ins.cpp:583:0=
|
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:581:0=
|
||||||
- type :: =:cfunction=
|
- type :: =:cfunction=
|
||||||
- docu ::
|
- docu ::
|
||||||
#+BEGIN:
|
#+BEGIN:
|
||||||
@@ -163,7 +163,7 @@ TODO
|
|||||||
\hrule
|
\hrule
|
||||||
* =or=
|
* =or=
|
||||||
|
|
||||||
- defined in :: =src/./built_ins.cpp:594:0=
|
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:592:0=
|
||||||
- type :: =:cfunction=
|
- type :: =:cfunction=
|
||||||
- docu ::
|
- docu ::
|
||||||
#+BEGIN:
|
#+BEGIN:
|
||||||
@@ -172,7 +172,7 @@ TODO
|
|||||||
\hrule
|
\hrule
|
||||||
* =not=
|
* =not=
|
||||||
|
|
||||||
- defined in :: =src/./built_ins.cpp:605:0=
|
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:603:0=
|
||||||
- type :: =:cfunction=
|
- type :: =:cfunction=
|
||||||
- docu ::
|
- docu ::
|
||||||
#+BEGIN:
|
#+BEGIN:
|
||||||
@@ -181,7 +181,7 @@ TODO
|
|||||||
\hrule
|
\hrule
|
||||||
* =while=
|
* =while=
|
||||||
|
|
||||||
- defined in :: =src/./built_ins.cpp:615:0=
|
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:613:0=
|
||||||
- type :: =:cfunction=
|
- type :: =:cfunction=
|
||||||
- docu ::
|
- docu ::
|
||||||
#+BEGIN:
|
#+BEGIN:
|
||||||
@@ -190,7 +190,7 @@ TODO
|
|||||||
\hrule
|
\hrule
|
||||||
* =lambda=
|
* =lambda=
|
||||||
|
|
||||||
- defined in :: =src/./built_ins.cpp:693:0=
|
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:691:0=
|
||||||
- type :: =:cfunction=
|
- type :: =:cfunction=
|
||||||
- docu ::
|
- docu ::
|
||||||
#+BEGIN:
|
#+BEGIN:
|
||||||
@@ -199,7 +199,7 @@ TODO
|
|||||||
\hrule
|
\hrule
|
||||||
* =special-lambda=
|
* =special-lambda=
|
||||||
|
|
||||||
- defined in :: =src/./built_ins.cpp:705:0=
|
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:703:0=
|
||||||
- type :: =:cfunction=
|
- type :: =:cfunction=
|
||||||
- docu ::
|
- docu ::
|
||||||
#+BEGIN:
|
#+BEGIN:
|
||||||
@@ -208,7 +208,7 @@ TODO
|
|||||||
\hrule
|
\hrule
|
||||||
* =eval=
|
* =eval=
|
||||||
|
|
||||||
- defined in :: =src/./built_ins.cpp:713:0=
|
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:711:0=
|
||||||
- type :: =:cfunction=
|
- type :: =:cfunction=
|
||||||
- docu ::
|
- docu ::
|
||||||
#+BEGIN:
|
#+BEGIN:
|
||||||
@@ -217,7 +217,7 @@ TODO
|
|||||||
\hrule
|
\hrule
|
||||||
* =begin=
|
* =begin=
|
||||||
|
|
||||||
- defined in :: =src/./built_ins.cpp:725:0=
|
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:723:0=
|
||||||
- type :: =:cfunction=
|
- type :: =:cfunction=
|
||||||
- docu ::
|
- docu ::
|
||||||
#+BEGIN:
|
#+BEGIN:
|
||||||
@@ -226,7 +226,7 @@ TODO
|
|||||||
\hrule
|
\hrule
|
||||||
* =list=
|
* =list=
|
||||||
|
|
||||||
- defined in :: =src/./built_ins.cpp:741:0=
|
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:739:0=
|
||||||
- type :: =:cfunction=
|
- type :: =:cfunction=
|
||||||
- docu ::
|
- docu ::
|
||||||
#+BEGIN:
|
#+BEGIN:
|
||||||
@@ -235,7 +235,7 @@ TODO
|
|||||||
\hrule
|
\hrule
|
||||||
* =pair=
|
* =pair=
|
||||||
|
|
||||||
- defined in :: =src/./built_ins.cpp:745:0=
|
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:743:0=
|
||||||
- type :: =:cfunction=
|
- type :: =:cfunction=
|
||||||
- docu ::
|
- docu ::
|
||||||
#+BEGIN:
|
#+BEGIN:
|
||||||
@@ -244,7 +244,7 @@ TODO
|
|||||||
\hrule
|
\hrule
|
||||||
* =first=
|
* =first=
|
||||||
|
|
||||||
- defined in :: =src/./built_ins.cpp:755:0=
|
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:753:0=
|
||||||
- type :: =:cfunction=
|
- type :: =:cfunction=
|
||||||
- docu ::
|
- docu ::
|
||||||
#+BEGIN:
|
#+BEGIN:
|
||||||
@@ -253,7 +253,7 @@ TODO
|
|||||||
\hrule
|
\hrule
|
||||||
* =rest=
|
* =rest=
|
||||||
|
|
||||||
- defined in :: =src/./built_ins.cpp:766:0=
|
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:764:0=
|
||||||
- type :: =:cfunction=
|
- type :: =:cfunction=
|
||||||
- docu ::
|
- docu ::
|
||||||
#+BEGIN:
|
#+BEGIN:
|
||||||
@@ -262,7 +262,7 @@ TODO
|
|||||||
\hrule
|
\hrule
|
||||||
* =set-type=
|
* =set-type=
|
||||||
|
|
||||||
- defined in :: =src/./built_ins.cpp:777:0=
|
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:775:0=
|
||||||
- type :: =:cfunction=
|
- type :: =:cfunction=
|
||||||
- docu ::
|
- docu ::
|
||||||
#+BEGIN:
|
#+BEGIN:
|
||||||
@@ -271,7 +271,7 @@ TODO
|
|||||||
\hrule
|
\hrule
|
||||||
* =delete-type=
|
* =delete-type=
|
||||||
|
|
||||||
- defined in :: =src/./built_ins.cpp:789:0=
|
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:787:0=
|
||||||
- type :: =:cfunction=
|
- type :: =:cfunction=
|
||||||
- docu ::
|
- docu ::
|
||||||
#+BEGIN:
|
#+BEGIN:
|
||||||
@@ -280,7 +280,7 @@ TODO
|
|||||||
\hrule
|
\hrule
|
||||||
* =type=
|
* =type=
|
||||||
|
|
||||||
- defined in :: =src/./built_ins.cpp:796:0=
|
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:794:0=
|
||||||
- type :: =:cfunction=
|
- type :: =:cfunction=
|
||||||
- docu ::
|
- docu ::
|
||||||
#+BEGIN:
|
#+BEGIN:
|
||||||
@@ -289,7 +289,7 @@ TODO
|
|||||||
\hrule
|
\hrule
|
||||||
* =info=
|
* =info=
|
||||||
|
|
||||||
- defined in :: =src/./built_ins.cpp:828:0=
|
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:826:0=
|
||||||
- type :: =:cfunction=
|
- type :: =:cfunction=
|
||||||
- docu ::
|
- docu ::
|
||||||
#+BEGIN:
|
#+BEGIN:
|
||||||
@@ -298,7 +298,7 @@ TODO
|
|||||||
\hrule
|
\hrule
|
||||||
* =show=
|
* =show=
|
||||||
|
|
||||||
- defined in :: =src/./built_ins.cpp:910:0=
|
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:908:0=
|
||||||
- type :: =:cfunction=
|
- type :: =:cfunction=
|
||||||
- docu ::
|
- docu ::
|
||||||
#+BEGIN:
|
#+BEGIN:
|
||||||
@@ -307,7 +307,7 @@ TODO
|
|||||||
\hrule
|
\hrule
|
||||||
* =addr-of=
|
* =addr-of=
|
||||||
|
|
||||||
- defined in :: =src/./built_ins.cpp:922:0=
|
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:920:0=
|
||||||
- type :: =:cfunction=
|
- type :: =:cfunction=
|
||||||
- docu ::
|
- docu ::
|
||||||
#+BEGIN:
|
#+BEGIN:
|
||||||
@@ -316,7 +316,7 @@ TODO
|
|||||||
\hrule
|
\hrule
|
||||||
* =generate-docs=
|
* =generate-docs=
|
||||||
|
|
||||||
- defined in :: =src/./built_ins.cpp:928:0=
|
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:926:0=
|
||||||
- type :: =:cfunction=
|
- type :: =:cfunction=
|
||||||
- docu ::
|
- docu ::
|
||||||
#+BEGIN:
|
#+BEGIN:
|
||||||
@@ -325,7 +325,7 @@ TODO
|
|||||||
\hrule
|
\hrule
|
||||||
* =print=
|
* =print=
|
||||||
|
|
||||||
- defined in :: =src/./built_ins.cpp:937:0=
|
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:935:0=
|
||||||
- type :: =:cfunction=
|
- type :: =:cfunction=
|
||||||
- docu ::
|
- docu ::
|
||||||
#+BEGIN:
|
#+BEGIN:
|
||||||
@@ -334,7 +334,7 @@ TODO
|
|||||||
\hrule
|
\hrule
|
||||||
* =read=
|
* =read=
|
||||||
|
|
||||||
- defined in :: =src/./built_ins.cpp:945:0=
|
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:943:0=
|
||||||
- type :: =:cfunction=
|
- type :: =:cfunction=
|
||||||
- docu ::
|
- docu ::
|
||||||
#+BEGIN:
|
#+BEGIN:
|
||||||
@@ -343,7 +343,7 @@ TODO
|
|||||||
\hrule
|
\hrule
|
||||||
* =exit=
|
* =exit=
|
||||||
|
|
||||||
- defined in :: =src/./built_ins.cpp:962:0=
|
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:960:0=
|
||||||
- type :: =:cfunction=
|
- type :: =:cfunction=
|
||||||
- docu ::
|
- docu ::
|
||||||
#+BEGIN:
|
#+BEGIN:
|
||||||
@@ -352,7 +352,7 @@ TODO
|
|||||||
\hrule
|
\hrule
|
||||||
* =break=
|
* =break=
|
||||||
|
|
||||||
- defined in :: =src/./built_ins.cpp:973:0=
|
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:971:0=
|
||||||
- type :: =:cfunction=
|
- type :: =:cfunction=
|
||||||
- docu ::
|
- docu ::
|
||||||
#+BEGIN:
|
#+BEGIN:
|
||||||
@@ -361,7 +361,7 @@ TODO
|
|||||||
\hrule
|
\hrule
|
||||||
* =memstat=
|
* =memstat=
|
||||||
|
|
||||||
- defined in :: =src/./built_ins.cpp:978:0=
|
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:976:0=
|
||||||
- type :: =:cfunction=
|
- type :: =:cfunction=
|
||||||
- docu ::
|
- docu ::
|
||||||
#+BEGIN:
|
#+BEGIN:
|
||||||
@@ -370,7 +370,7 @@ TODO
|
|||||||
\hrule
|
\hrule
|
||||||
* =try=
|
* =try=
|
||||||
|
|
||||||
- defined in :: =src/./built_ins.cpp:982:0=
|
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:980:0=
|
||||||
- type :: =:cfunction=
|
- type :: =:cfunction=
|
||||||
- docu ::
|
- docu ::
|
||||||
#+BEGIN:
|
#+BEGIN:
|
||||||
@@ -379,7 +379,7 @@ TODO
|
|||||||
\hrule
|
\hrule
|
||||||
* =load=
|
* =load=
|
||||||
|
|
||||||
- defined in :: =src/./built_ins.cpp:997:0=
|
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:995:0=
|
||||||
- type :: =:cfunction=
|
- type :: =:cfunction=
|
||||||
- docu ::
|
- docu ::
|
||||||
#+BEGIN:
|
#+BEGIN:
|
||||||
@@ -388,7 +388,7 @@ TODO
|
|||||||
\hrule
|
\hrule
|
||||||
* =import=
|
* =import=
|
||||||
|
|
||||||
- defined in :: =src/./built_ins.cpp:1008:0=
|
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:1006:0=
|
||||||
- type :: =:cfunction=
|
- type :: =:cfunction=
|
||||||
- docu ::
|
- docu ::
|
||||||
#+BEGIN:
|
#+BEGIN:
|
||||||
@@ -397,7 +397,7 @@ TODO
|
|||||||
\hrule
|
\hrule
|
||||||
* =copy=
|
* =copy=
|
||||||
|
|
||||||
- defined in :: =src/./built_ins.cpp:1019:0=
|
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:1017:0=
|
||||||
- type :: =:cfunction=
|
- type :: =:cfunction=
|
||||||
- docu ::
|
- docu ::
|
||||||
#+BEGIN:
|
#+BEGIN:
|
||||||
@@ -406,7 +406,7 @@ TODO
|
|||||||
\hrule
|
\hrule
|
||||||
* =error=
|
* =error=
|
||||||
|
|
||||||
- defined in :: =src/./built_ins.cpp:1027:0=
|
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:1025:0=
|
||||||
- type :: =:cfunction=
|
- type :: =:cfunction=
|
||||||
- docu ::
|
- docu ::
|
||||||
#+BEGIN:
|
#+BEGIN:
|
||||||
@@ -415,7 +415,7 @@ TODO
|
|||||||
\hrule
|
\hrule
|
||||||
* =symbol->keyword=
|
* =symbol->keyword=
|
||||||
|
|
||||||
- defined in :: =src/./built_ins.cpp:1034:0=
|
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:1032:0=
|
||||||
- type :: =:cfunction=
|
- type :: =:cfunction=
|
||||||
- docu ::
|
- docu ::
|
||||||
#+BEGIN:
|
#+BEGIN:
|
||||||
@@ -424,7 +424,7 @@ TODO
|
|||||||
\hrule
|
\hrule
|
||||||
* =string->symbol=
|
* =string->symbol=
|
||||||
|
|
||||||
- defined in :: =src/./built_ins.cpp:1043:0=
|
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:1041:0=
|
||||||
- type :: =:cfunction=
|
- type :: =:cfunction=
|
||||||
- docu ::
|
- docu ::
|
||||||
#+BEGIN:
|
#+BEGIN:
|
||||||
@@ -433,7 +433,7 @@ TODO
|
|||||||
\hrule
|
\hrule
|
||||||
* =symbol->string=
|
* =symbol->string=
|
||||||
|
|
||||||
- defined in :: =src/./built_ins.cpp:1055:0=
|
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:1053:0=
|
||||||
- type :: =:cfunction=
|
- type :: =:cfunction=
|
||||||
- docu ::
|
- docu ::
|
||||||
#+BEGIN:
|
#+BEGIN:
|
||||||
@@ -442,7 +442,7 @@ TODO
|
|||||||
\hrule
|
\hrule
|
||||||
* =concat-strings=
|
* =concat-strings=
|
||||||
|
|
||||||
- defined in :: =src/./built_ins.cpp:1064:0=
|
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:1062:0=
|
||||||
- type :: =:cfunction=
|
- type :: =:cfunction=
|
||||||
- docu ::
|
- docu ::
|
||||||
#+BEGIN:
|
#+BEGIN:
|
||||||
@@ -459,7 +459,7 @@ TODO
|
|||||||
\hrule
|
\hrule
|
||||||
* =when=
|
* =when=
|
||||||
|
|
||||||
- defined in :: =pre.slime:21:37=
|
- defined in :: =pre.slime:21:41=
|
||||||
- type :: =:macro=
|
- type :: =:macro=
|
||||||
- arguments :: :
|
- arguments :: :
|
||||||
- postitional :: =condition=:
|
- postitional :: =condition=:
|
||||||
@@ -517,15 +517,24 @@ Executes action times times.
|
|||||||
\hrule
|
\hrule
|
||||||
* =cond=
|
* =cond=
|
||||||
|
|
||||||
- defined in :: =pre.slime:66:19=
|
- defined in :: =pre.slime:66:17=
|
||||||
- type :: =:macro=
|
- type :: =:macro=
|
||||||
- arguments :: :
|
- arguments :: :
|
||||||
- rest :: =clauses=
|
- rest :: =clauses=
|
||||||
- docu :: none
|
- docu :: none
|
||||||
\hrule
|
\hrule
|
||||||
|
* =case=
|
||||||
|
|
||||||
|
- defined in :: =pre.slime:81:17=
|
||||||
|
- type :: =:macro=
|
||||||
|
- arguments :: :
|
||||||
|
- postitional :: =var=:
|
||||||
|
- rest :: =clauses=
|
||||||
|
- docu :: none
|
||||||
|
\hrule
|
||||||
* =define-special=
|
* =define-special=
|
||||||
|
|
||||||
- defined in :: =pre.slime:69:81=
|
- defined in :: =pre.slime:84:81=
|
||||||
- type :: =:macro=
|
- type :: =:macro=
|
||||||
- arguments :: :
|
- arguments :: :
|
||||||
- postitional :: =name-and-args=:
|
- postitional :: =name-and-args=:
|
||||||
@@ -534,7 +543,7 @@ Executes action times times.
|
|||||||
\hrule
|
\hrule
|
||||||
* =construct-list=
|
* =construct-list=
|
||||||
|
|
||||||
- defined in :: =pre.slime:110:14=
|
- defined in :: =pre.slime:125:14=
|
||||||
- type :: =:macro=
|
- type :: =:macro=
|
||||||
- arguments :: :
|
- arguments :: :
|
||||||
- rest :: =body=
|
- rest :: =body=
|
||||||
@@ -561,25 +570,41 @@ Executes action times times.
|
|||||||
\hrule
|
\hrule
|
||||||
* =apply=
|
* =apply=
|
||||||
|
|
||||||
- defined in :: =pre.slime:115:28=
|
- defined in :: =pre.slime:130:28=
|
||||||
- type :: =:macro=
|
- type :: =:macro=
|
||||||
- arguments :: :
|
- arguments :: :
|
||||||
- postitional :: =fun=, =seq=
|
- postitional :: =fun=, =seq=
|
||||||
- docu ::
|
- docu ::
|
||||||
#+BEGIN:
|
#+BEGIN:
|
||||||
Applies the funciton to the sequence, as in calls the function with
|
Applies the function to the sequence, as in calls the function with
|
||||||
ithe sequence as arguemens.
|
ithe sequence as arguemens.
|
||||||
#+END:
|
#+END:
|
||||||
\hrule
|
\hrule
|
||||||
|
* =define-typed=
|
||||||
|
|
||||||
|
- defined in :: =pre.slime:142:16=
|
||||||
|
- type :: =:macro=
|
||||||
|
- arguments :: :
|
||||||
|
- postitional :: =args=:
|
||||||
|
- rest :: =body=
|
||||||
|
- docu :: none
|
||||||
|
\hrule
|
||||||
* =define-package=
|
* =define-package=
|
||||||
|
|
||||||
- defined in :: =pre.slime:129:24=
|
- defined in :: =pre.slime:158:24=
|
||||||
- type :: =:macro=
|
- type :: =:macro=
|
||||||
- arguments :: :
|
- arguments :: :
|
||||||
- postitional :: =name=:
|
- postitional :: =name=:
|
||||||
- rest :: =body=
|
- rest :: =body=
|
||||||
- docu :: none
|
- docu :: none
|
||||||
\hrule
|
\hrule
|
||||||
|
* =ttt=
|
||||||
|
|
||||||
|
- type :: =:lambda=
|
||||||
|
- arguments :: :
|
||||||
|
- postitional :: =a=, =b=
|
||||||
|
- docu :: none
|
||||||
|
\hrule
|
||||||
* =null?=
|
* =null?=
|
||||||
|
|
||||||
- type :: =:lambda=
|
- type :: =:lambda=
|
||||||
@@ -590,6 +615,30 @@ ithe sequence as arguemens.
|
|||||||
Checks if the argument is =nil=.
|
Checks if the argument is =nil=.
|
||||||
#+END:
|
#+END:
|
||||||
\hrule
|
\hrule
|
||||||
|
* =type=?=
|
||||||
|
|
||||||
|
- type :: =:lambda=
|
||||||
|
- arguments :: :
|
||||||
|
- postitional :: =obj=, =typ=
|
||||||
|
- docu ::
|
||||||
|
#+BEGIN:
|
||||||
|
Checks if the argument =obj= is of type =typ=
|
||||||
|
#+END:
|
||||||
|
\hrule
|
||||||
|
* =types=?=
|
||||||
|
|
||||||
|
- type :: =:lambda=
|
||||||
|
- arguments :: :
|
||||||
|
- rest :: =objs=
|
||||||
|
- docu :: none
|
||||||
|
\hrule
|
||||||
|
* =assert-types==
|
||||||
|
|
||||||
|
- type :: =:lambda=
|
||||||
|
- arguments :: :
|
||||||
|
- rest :: =objs=
|
||||||
|
- docu :: none
|
||||||
|
\hrule
|
||||||
* =number?=
|
* =number?=
|
||||||
|
|
||||||
- type :: =:lambda=
|
- type :: =:lambda=
|
||||||
@@ -762,6 +811,13 @@ with (pair elem nil).
|
|||||||
Returns the length of the given sequence.
|
Returns the length of the given sequence.
|
||||||
#+END:
|
#+END:
|
||||||
\hrule
|
\hrule
|
||||||
|
* =member?=
|
||||||
|
|
||||||
|
- type :: =:lambda=
|
||||||
|
- arguments :: :
|
||||||
|
- postitional :: =elem=, =seq=
|
||||||
|
- docu :: none
|
||||||
|
\hrule
|
||||||
* =sublist-starting-at-index=
|
* =sublist-starting-at-index=
|
||||||
|
|
||||||
- type :: =:lambda=
|
- type :: =:lambda=
|
||||||
@@ -905,9 +961,237 @@ the printed separators (=sep=) between the arguments and what should
|
|||||||
be printed after the last argument (=end=).
|
be printed after the last argument (=end=).
|
||||||
#+END:
|
#+END:
|
||||||
\hrule
|
\hrule
|
||||||
|
* =key-not-found-index=
|
||||||
|
|
||||||
|
- defined in :: =d:\Code\Gitlab\slime\bin\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:743:0=
|
||||||
|
- type :: =:cfunction=
|
||||||
|
- docu ::
|
||||||
|
#+BEGIN:
|
||||||
|
TODO
|
||||||
|
#+END:
|
||||||
|
\hrule
|
||||||
|
* =car=
|
||||||
|
|
||||||
|
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:753:0=
|
||||||
|
- type :: =:cfunction=
|
||||||
|
- docu ::
|
||||||
|
#+BEGIN:
|
||||||
|
TODO
|
||||||
|
#+END:
|
||||||
|
\hrule
|
||||||
|
* =cdr=
|
||||||
|
|
||||||
|
- defined in :: =d:\code\gitlab\slime\src\./built_ins.cpp:764: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=
|
* =define-class=
|
||||||
|
|
||||||
- defined in :: =oo.slime:22:22=
|
- defined in :: =d:\Code\Gitlab\slime\bin\oo.slime:22:22=
|
||||||
- type :: =:macro=
|
- type :: =:macro=
|
||||||
- arguments :: :
|
- arguments :: :
|
||||||
- postitional :: =name-and-members=:
|
- postitional :: =name-and-members=:
|
||||||
@@ -919,7 +1203,7 @@ Macro for creating simple classes.
|
|||||||
\hrule
|
\hrule
|
||||||
* =->=
|
* =->=
|
||||||
|
|
||||||
- defined in :: =oo.slime:25:24=
|
- defined in :: =d:\Code\Gitlab\slime\bin\oo.slime:25:24=
|
||||||
- type :: =:macro=
|
- type :: =:macro=
|
||||||
- arguments :: :
|
- arguments :: :
|
||||||
- postitional :: =obj=, =meth=:
|
- postitional :: =obj=, =meth=:
|
||||||
@@ -935,7 +1219,7 @@ Macro for creating simple classes.
|
|||||||
\hrule
|
\hrule
|
||||||
* =math-> pi=
|
* =math-> pi=
|
||||||
|
|
||||||
- defined in :: =math.slime:5:4=
|
- defined in :: =d:\Code\Gitlab\slime\bin\math.slime:5:4=
|
||||||
- type :: =:number=
|
- type :: =:number=
|
||||||
- value :: =3.141593=
|
- value :: =3.141593=
|
||||||
- docu ::
|
- docu ::
|
||||||
@@ -945,7 +1229,7 @@ Tha famous circle constant.
|
|||||||
\hrule
|
\hrule
|
||||||
* =math-> abs=
|
* =math-> abs=
|
||||||
|
|
||||||
- defined in :: =math.slime:9:4=
|
- defined in :: =d:\Code\Gitlab\slime\bin\math.slime:9:4=
|
||||||
- type :: =:lambda=
|
- type :: =:lambda=
|
||||||
- arguments :: :
|
- arguments :: :
|
||||||
- postitional :: =x=
|
- postitional :: =x=
|
||||||
@@ -956,7 +1240,7 @@ Accepts one argument and returns the absoulte value of it
|
|||||||
\hrule
|
\hrule
|
||||||
* =math-> sqrt=
|
* =math-> sqrt=
|
||||||
|
|
||||||
- defined in :: =math.slime:13:4=
|
- defined in :: =d:\Code\Gitlab\slime\bin\math.slime:13:4=
|
||||||
- type :: =:lambda=
|
- type :: =:lambda=
|
||||||
- arguments :: :
|
- arguments :: :
|
||||||
- postitional :: =x=
|
- postitional :: =x=
|
||||||
@@ -978,7 +1262,7 @@ This is the handle to an object of the class vector3
|
|||||||
\hrule
|
\hrule
|
||||||
* =math-> make-vector3 define-class=
|
* =math-> make-vector3 define-class=
|
||||||
|
|
||||||
- defined in :: =oo.slime:22:22=
|
- defined in :: =d:\Code\Gitlab\slime\bin\oo.slime:22:22=
|
||||||
- type :: =:macro=
|
- type :: =:macro=
|
||||||
- arguments :: :
|
- arguments :: :
|
||||||
- postitional :: =name-and-members=:
|
- postitional :: =name-and-members=:
|
||||||
@@ -990,7 +1274,7 @@ Macro for creating simple classes.
|
|||||||
\hrule
|
\hrule
|
||||||
* =math-> make-vector3 ->=
|
* =math-> make-vector3 ->=
|
||||||
|
|
||||||
- defined in :: =oo.slime:25:24=
|
- defined in :: =d:\Code\Gitlab\slime\bin\oo.slime:25:24=
|
||||||
- type :: =:macro=
|
- type :: =:macro=
|
||||||
- arguments :: :
|
- arguments :: :
|
||||||
- postitional :: =obj=, =meth=:
|
- postitional :: =obj=, =meth=:
|
||||||
|
|||||||
+1
-1
@@ -948,7 +948,7 @@ embedded scripting language.
|
|||||||
#+mail: felix.brendel@airmail.cc
|
#+mail: felix.brendel@airmail.cc
|
||||||
#+options: H:2 toc:nil
|
#+options: H:2 toc:nil
|
||||||
|
|
||||||
#+macro: slime_header (eval (concat "#+header: :exports both" "\n" "#+attr_latex: :options keywordstyle=\\color{slimeKeyword}, commentstyle=\\color{slimeComment}, stringstyle=\\color{slimeString}"))
|
#+macro: slime_header (eval (concat "#+header: :cache yes :exports both" "\n" "#+attr_latex: :options keywordstyle=\\color{slimeKeyword}, commentstyle=\\color{slimeComment}, stringstyle=\\color{slimeString}"))
|
||||||
#+macro: ditaa_header (eval (concat "#+header: :exports results :cmdline --no-separation --no-shadows"))
|
#+macro: ditaa_header (eval (concat "#+header: :exports results :cmdline --no-separation --no-shadows"))
|
||||||
|
|
||||||
#+latex_class:article
|
#+latex_class:article
|
||||||
|
|||||||
+3
-5
@@ -48,7 +48,7 @@ proc built_in_load(String* file_name, Environment* env) -> Lisp_Object* {
|
|||||||
|
|
||||||
fullpath[0] = '\0';
|
fullpath[0] = '\0';
|
||||||
sprintf(fullpath, "%s%s", exe_path, Memory::get_c_str(file_name));
|
sprintf(fullpath, "%s%s", exe_path, Memory::get_c_str(file_name));
|
||||||
printf("Fullpath: %s\n", fullpath);
|
// printf("Fullpath: %s\n", fullpath);
|
||||||
file_content = read_entire_file(fullpath);
|
file_content = read_entire_file(fullpath);
|
||||||
|
|
||||||
if (!file_content) {
|
if (!file_content) {
|
||||||
@@ -466,14 +466,12 @@ proc load_built_ins_into_environment(Environment* env) -> void {
|
|||||||
|
|
||||||
bool truthy;
|
bool truthy;
|
||||||
try truthy = is_truthy(condition, env);
|
try truthy = is_truthy(condition, env);
|
||||||
|
// printf("arg len is: %d\n", arguments_length);
|
||||||
Lisp_Object* result;
|
Lisp_Object* result;
|
||||||
|
|
||||||
if (truthy)
|
if (truthy)
|
||||||
try result = eval_expr(then_part->value.pair.first, env);
|
try result = eval_expr(then_part->value.pair.first, env);
|
||||||
else if (arguments_length == 3)
|
else
|
||||||
try result = eval_expr(else_part->value.pair.first, env);
|
try result = eval_expr(else_part->value.pair.first, env);
|
||||||
else return Memory::nil;
|
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
});
|
});
|
||||||
|
|||||||
+4
-2
@@ -518,8 +518,10 @@ proc interprete_stdin(bool is_emacs_repl = false) -> void {
|
|||||||
delete_error();
|
delete_error();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
print(evaluated);
|
if (evaluated != Memory::nil) {
|
||||||
|
print(evaluated);
|
||||||
|
printf("\n");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
printf("\n");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -630,6 +630,7 @@ proc run_all_tests() -> bool {
|
|||||||
printf("\n-- Test Files --\n");
|
printf("\n-- Test Files --\n");
|
||||||
|
|
||||||
invoke_test_script("alists");
|
invoke_test_script("alists");
|
||||||
|
invoke_test_script("case_and_cond");
|
||||||
invoke_test_script("evaluation_of_default_args");
|
invoke_test_script("evaluation_of_default_args");
|
||||||
invoke_test_script("lexical_scope");
|
invoke_test_script("lexical_scope");
|
||||||
invoke_test_script("class_macro");
|
invoke_test_script("class_macro");
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
|
* TODO create global environment- and callstack
|
||||||
* TODO rename slime to plisk
|
* TODO rename slime to plisk
|
||||||
* TODO rename modifying functions to prefix '!'
|
* TODO rename modifying functions to prefix '!'
|
||||||
* TODO go through sicp and use the examples as test files
|
* TODO go through sicp and use the examples as test files
|
||||||
|
|
||||||
|
|
||||||
* TODO test macro expanding to macro
|
* TODO test macro expanding to macro
|
||||||
* TODO create global environment- and callstack
|
|
||||||
* TODO BUG 1: eval dot notation
|
* TODO BUG 1: eval dot notation
|
||||||
#+BEGIN_SRC lisp
|
#+BEGIN_SRC lisp
|
||||||
(eval `(+ . ,(list 1 2 3)))
|
(eval `(+ . ,(list 1 2 3)))
|
||||||
@@ -18,3 +20,4 @@
|
|||||||
;; should output 6
|
;; should output 6
|
||||||
;; outputs 0
|
;; outputs 0
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user