2016-07-16 21:35:07 +00:00
|
|
|
|
|
|
|
;; (define (run x)
|
|
|
|
;; (define (test? y) (display "testing:") (display y) (newline) (eq? x y))
|
|
|
|
;; (test? 3)
|
|
|
|
;; )
|
|
|
|
|
|
|
|
;; (display "(run 3):")
|
|
|
|
;; (display (run 3))
|
|
|
|
;; (newline)
|
|
|
|
;; (display "(run 4):")
|
|
|
|
;; (display (run 4))
|
|
|
|
;; (newline)
|
|
|
|
|
2016-07-17 08:38:29 +00:00
|
|
|
;; (define (fm a)
|
|
|
|
;; (define-macro (a b)
|
|
|
|
;; (display b)
|
|
|
|
;; (newline)
|
|
|
|
;; "boo"))
|
2016-07-16 21:35:07 +00:00
|
|
|
|
2016-07-17 08:38:29 +00:00
|
|
|
;; (display "f-define-macro: ")
|
|
|
|
;; (fm 'dinges)
|
|
|
|
;; (a c)
|
|
|
|
;; (newline)
|
2016-07-16 21:35:07 +00:00
|
|
|
|
|
|
|
|
2016-07-17 08:38:29 +00:00
|
|
|
;; (define-macro (m a)
|
|
|
|
;; `(define-macro (,a b)
|
|
|
|
;; (display "b")
|
|
|
|
;; (display b)
|
|
|
|
;; (newline)))
|
|
|
|
|
|
|
|
;; (display "define-macro: ")
|
|
|
|
;; (m dinges)
|
|
|
|
;; (newline)
|
|
|
|
;; (display "running dinges: ")
|
|
|
|
;; (dinges c)
|
|
|
|
;; (newline)
|
|
|
|
|
|
|
|
|
|
|
|
(define-macro (d-s n t)
|
|
|
|
;; (display "D-S: ")
|
|
|
|
;; (display `(define-macro (,n . a)
|
|
|
|
;; (,t (cons ',n a))))
|
|
|
|
;; (newline)
|
|
|
|
`(define-macro (,n . args)
|
|
|
|
;; (display "CALLING: t: ")
|
|
|
|
;; (display ,t)
|
|
|
|
;; (display " args: ")
|
|
|
|
;; (display (cons ',n a))
|
|
|
|
;; (newline)
|
|
|
|
;; (display "HALLO: ==>")
|
|
|
|
;; (display (,t (cons ',n a)))
|
|
|
|
;; ;; (display "HALLO: ==>")
|
|
|
|
;; ;; (display (,t (cons ',n a)))
|
|
|
|
;; (newline)
|
|
|
|
(,t (cons ',n args))
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
(d-s s-r
|
2016-07-17 09:37:22 +00:00
|
|
|
(;; let () ;; syntax-rules uses (let () ...),
|
|
|
|
;; mes doesn't support that yet; use ((lambda () ...))
|
|
|
|
(lambda ()
|
|
|
|
;; syntax-rules uses defines that get closured-in
|
|
|
|
;; mes doesn't support that yet; move down
|
|
|
|
;; (define name? symbol?)
|
|
|
|
(lambda (. n-a)
|
|
|
|
(define name? symbol?)
|
|
|
|
|
|
|
|
(display "YEAH:")
|
|
|
|
(display n-a)
|
|
|
|
(display (name? n-a))
|
|
|
|
(newline)
|
|
|
|
'(lambda (. i) ;;(i r c)
|
|
|
|
(display "transformers")
|
|
|
|
(newline)
|
|
|
|
''tee-hee-hee
|
|
|
|
)
|
|
|
|
;; (define (foo) (display "Footje") (newline) 'f-f-f)
|
|
|
|
;; foo
|
|
|
|
;;"blaat"
|
|
|
|
)))
|
2016-07-17 08:38:29 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
(display "calling s-r")
|
2016-07-16 21:35:07 +00:00
|
|
|
(newline)
|
2016-07-17 08:38:29 +00:00
|
|
|
(d-s when
|
|
|
|
(s-r 0 1 2)
|
|
|
|
)
|
2016-07-16 21:35:07 +00:00
|
|
|
|
2016-07-17 08:38:29 +00:00
|
|
|
(display "calling when")
|
|
|
|
(newline)
|
|
|
|
(display (when 3 4 5))
|
2016-07-16 21:35:07 +00:00
|
|
|
(newline)
|
2016-07-17 08:38:29 +00:00
|
|
|
'dun
|