mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-18 21:29:18 +02:00
14 lines
465 B
Scheme
14 lines
465 B
Scheme
;; A program to use all available memory, and eventually crash
|
|
(letrec ((foo (lambda (x)
|
|
(write (length x))
|
|
(bar (cons 1 x))))
|
|
(bar (lambda (x) (foo (cons 1 x)))))
|
|
(foo '()))
|
|
|
|
;; TODO: try rewriting it so memory is reclaimed. Does it run
|
|
;; forever now?
|
|
;(letrec ((foo (lambda (x)
|
|
; (write (length x))
|
|
; (bar (cons 1 x))))
|
|
; (bar (lambda (x) (foo (cons 1 x)))))
|
|
; (foo '()))
|