rosella/src/examples/test-foldl.rla

36 lines
689 B
Plaintext

#S(#="lambda"
; (define (test-foldl)
; (foldl + 0 '(2 3 4 5)))
#(
#i"../lib/primitive/foldl.rla"
(
#S(#="lambda"
; (define (+ x y)
; (fix+ x y))
#(#f)
#()
2
"\x00\x80\x03\xfd\; (set! f0 (car argv))
\x00\x81\x04\xfd\; (set! f1 (cdr argv))
\x00\x81\x03\x81\; (set! f1 (car f1))
\x08\x80\x80\x81\; (set! f0 (fix+ f0 f1))
\x02\x80\x80\x00"; (set! f0 (cons f0 nil))
0xff ; k
0x80 ; f0
0x01 ; g1
0x01 ; g1
)
0
(2 3 4 5)
)
)
#()
0
""
0x01 ; g1
0x02 ; g2
0xfe ; ctx
0xff ; k
)
; vim:set syntax= sw=2 expandtab: