hetu_script 0.1.1+3 hetu_script: ^0.1.1+3 copied to clipboard
Hetu is a lightweight script language for embedding in Flutter apps.
import 'package:hetu_script/hetu_script.dart';
void main() async {
var hetu = Hetu();
await hetu.init();
await hetu.eval(r'''
fun closure(func) {
var i = 42
fun nested () {
i = i + 1
print(func(i))
}
return nested
}
fun main {
var func = closure( fun (n) { return n * n } )
func()
func()
}
''', invokeFunc: 'main');
}