Documentation ¶
Index ¶
- func Nop(env *Env) (r.Value, []r.Value)
- func VarInt0(env *Env) int
- type Env
- type Func
- type FuncInt
- type SParam
- type SReturn
- type X
- func Block(list ...X) X
- func Const(value interface{}) X
- func DeclVar(idx int, expr X) X
- func For(init X, pred XBool, post X, body X) X
- func If(pred XBool, then, els X) X
- func IntToX(f XInt) X
- func Return(exprs ...X) X
- func ReturnInt(expr XInt) X
- func Var(upn, idx int) X
- func VarIncInt(idx int) X
- func VarSetInt(idx int, expr XInt) X
- type X1
- type XBool
- type XFunc
- type XFuncInt
- type XInt
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type FuncInt ¶
func DeclCollatz ¶
interpreted version of: func collatz(n int) { for n > 1 { if n&1 != 0 { n = ((n * 3) + 1) / 2 } else { n = n / 2 } } }
func DeclFibonacci ¶
interpreted version of: func fibonacci(n int) int { if (n <= 2) { return 1 } return fibonacci(n-1) + fibonacci(n-2) }
Click to show internal directories.
Click to hide internal directories.