Alles aangepast.

This commit is contained in:
2026-06-08 12:55:08 +02:00
parent a9610e6e0c
commit 823130e3ac
24 changed files with 418 additions and 2621 deletions
+11 -14
View File
@@ -1,16 +1,13 @@
#lang racket/base
(require "../main.rkt")
(displayln "--- and ---")
(displayln (js/expression (and (> x 10) (< x 15))))
(displayln "--- t2 ---")
(displayln (js (define (f x)
(if (and (> x 10) (< x 15))
(begin (console.log x)
(return x))
(return (* x x))))))
(displayln "--- let* ---")
(displayln (js (let* ((x 10)
(y (+ x x)))
(return y))))
(displayln "--- let* tdz ---")
(displayln (js/expression (let ([x 4]) (let* ([x x] [y x]) (+ x y)))))
;; There is no separate optimizer in js-maker 3. This demo shows the compact
;; named-let loop output produced directly by the `js` macro.
(module+ main
(display
(js (define (factorial n)
(let loop ([i n] [acc 1])
(if (<= i 1)
(return acc)
(loop (- i 1) (* acc i))))))))