removed special-lambdas to make evaluatino of arfgs more regular
This commit is contained in:
@@ -85,9 +85,6 @@ condition is false."
|
||||
,(rec (rest clauses))))))
|
||||
(rec clauses))
|
||||
|
||||
(define-syntax (define-special name-and-args . body)
|
||||
`(define ,(first name-and-args) (special-lambda ,(rest name-and-args) @body)))
|
||||
|
||||
(define-syntax (construct-list . body)
|
||||
:doc "
|
||||
{{{example_start}}}
|
||||
@@ -471,7 +468,6 @@ added to a list, which in the end is returned."
|
||||
;; (vector-ref v2 0))))
|
||||
|
||||
|
||||
|
||||
;; (unless (bound? generic-+-map)
|
||||
;; (set! generic-+-map (create-hash-map)))
|
||||
;; (hm/set! generic-+-map '(:vector :vector) (lambda (v1 v2)
|
||||
|
||||
@@ -18,8 +18,6 @@
|
||||
|
||||
(define-syntax (case var . clauses) (define (rec clauses) (if (= nil clauses) nil (if (= (first (first clauses)) 'else) (begin (if (not (= (rest clauses) ())) (error :syntax-error "There are additional clauses after the else clause!") (pair 'begin (rest (first clauses))))) `(if (member? ,var ',(first (first clauses))) (begin (unquote-splicing (rest (first clauses)))) ,(rec (rest clauses)))))) (rec clauses))
|
||||
|
||||
(define-syntax (define-special name-and-args . body) `(define ,(first name-and-args) (special-lambda ,(rest name-and-args) (unquote-splicing body))))
|
||||
|
||||
(define-syntax (construct-list . body) :doc "\n{{{example_start}}}\n(construct-list\n i <- '(1 2 3 4 5)\n yield (* i i))\n{{{example_end}}}\n\n(construct-list\n i <- '(1 2 3 4)\n j <- '(A B)\n yield (pair i j))\n\n(construct-list\n i <- '(1 2 3 4 5 6 7 8)\n if (= 0 (% i 2))\n yield i)\n" (define (append-map f ll) (unless (= ll ()) (define val (f (first ll))) (if (= (first val) ()) (append-map f (rest ll)) (extend val (append-map f (rest ll)))))) (define (rec body) (cond ((= () body) ()) ((= () (rest body)) (first body)) ((= (first (rest body)) '<-) `(,append-map (lambda (,(first body)) (list ,(rec (rest (rest (rest body)))))) ,(first (rest (rest body))))) ((= (first body) 'if) `(when ,(first (rest body)) ,(rec (rest (rest body))))) ((= (first (rest body)) 'yield) (first (rest body))) (else (error :syntax-error "Not a do-able expression")))) (rec 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))))
|
||||
|
||||
Reference in New Issue
Block a user