This commit is contained in:
2026-05-30 09:12:55 -04:00
parent 18e5275a76
commit f7810ac1a6
3 changed files with 464 additions and 0 deletions
+40
View File
@@ -0,0 +1,40 @@
#lang racket
(define-syntax let*
(syntax-rules () ;; special tokens
[(let* () body ...)
(let () body ...)]
[(let* ((x v) (xs vs) ...) body ...)
(let ((x v)) (let* ((xs vs) ...) body ...))]))
(let* [(x 5)
(y (+ x 2))]
y)
;; ->
(let ((x 5))
(let* ((y (+ x 2)))
y))
;; ->
(let ((x 5))
(let ((y (+ x 2)))
(let* ()
y)))
;; ->
(let ((x 5))
(let ((y (+ x 2)))
(let ()
y)))
(define-syntax annd
(syntax-rules ()
[(annd) #t]
[(annd x) (if x x #f)]
[(annd x y ...) (if x (annd y ...) #f)]))
(annd #f (/ 5 0))
(and 5 2 3)
(annd 5 2 3)