added zk* function type to initiate the zkcircuit

This commit is contained in:
ada
2020-10-27 22:34:03 +01:00
parent 4d6b06b579
commit 06b382b033
2 changed files with 14 additions and 1 deletions

View File

@@ -269,6 +269,19 @@ fn eval(mut ast: MalVal, mut env: Env) -> MalRet {
_ => Ok(Nil),
}
}
Sym(ref a0sym) if a0sym == "zk*" => {
let (a1, a2) = (l[1].clone(), l[2].clone());
println!("---> {:?} {:?}", a1, a2);
// TODO add alloc name and nested eval to zkcircuit
Ok(MalFunc {
eval: eval,
ast: Rc::new(a2),
env: env,
params: Rc::new(a1),
is_macro: false,
meta: Rc::new(Nil),
})
}
Sym(ref a0sym) if a0sym == "fn*" => {
let (a1, a2) = (l[1].clone(), l[2].clone());
Ok(MalFunc {

View File

@@ -1,4 +1,4 @@
(def! circuit (fn* [x] (
(def! circuit (zk* [x] (
(def! bits (unpack-bits x 256))
(map (fn* [b] (println b
'(add lc0 one)