Commit first working Rosella program.
Takes a string argument, converts it with string->number, and returns the factorial.
This commit is contained in:
parent
c01f0838f1
commit
861f1f7617
|
|
@ -0,0 +1,77 @@
|
|||
#S(#="lambda"
|
||||
#(
|
||||
#S(#="template"
|
||||
#(
|
||||
#0=#S(#="lambda"
|
||||
#(
|
||||
#S(#="lambda"
|
||||
#(1 #f)
|
||||
#()
|
||||
1
|
||||
"\x02\x80\x01\x00"; (set! 128 (cons 1 0))
|
||||
254
|
||||
128
|
||||
2
|
||||
255
|
||||
)
|
||||
#S(#="template"
|
||||
#(
|
||||
#=0
|
||||
#S(#="template"
|
||||
#(#f)
|
||||
"\x40\xff\xfe" ; i0 ctx k
|
||||
1
|
||||
"\x00\x80\x03\xfd\; (set! 128 (car 253))
|
||||
\x0a\x80\x40\x80\; (set! 128 (fix* 64 128))
|
||||
\x02\x80\x80\x00"; (set! 128 (cons 128 0))
|
||||
66
|
||||
128
|
||||
1
|
||||
65
|
||||
)
|
||||
1
|
||||
)
|
||||
"\x80" ; f0
|
||||
2
|
||||
"\x09\x80\x40\x03\; (set! 128 (fix- 64 3))
|
||||
\x02\x80\x80\x00\; (set! 128 (cons 128 0))
|
||||
\x00\x81\x1b\x02"; (set! 129 (lambda 2))
|
||||
1
|
||||
128
|
||||
129
|
||||
255
|
||||
)
|
||||
1
|
||||
)
|
||||
#()
|
||||
2
|
||||
"\x00\x80\x03\xfd\; (set! 128 (car 253))
|
||||
\x0d\x81\x80\x03\; (set! 129 (fix< 128 3))
|
||||
\x81\x81\x01\x02\; (set! 129 (if 129 1 2))
|
||||
\x00\x81\x1b\x81"; (set! 129 (lambda 129))
|
||||
129
|
||||
0
|
||||
254
|
||||
255
|
||||
)
|
||||
#f
|
||||
)
|
||||
"\xfe\xff" ; k ctx
|
||||
0
|
||||
""
|
||||
1
|
||||
253
|
||||
64
|
||||
65
|
||||
)
|
||||
#="string->number"
|
||||
)
|
||||
#()
|
||||
1
|
||||
"\x00\x80\x1b\x01"; (set! 128 (lambda 1))
|
||||
2
|
||||
253
|
||||
128
|
||||
255
|
||||
)
|
||||
; vim:set sw=2 expandtab syntax=:
|
||||
Loading…
Reference in New Issue