mirror of
https://github.com/darkrenaissance/darkfi.git
synced 2026-04-28 03:00:18 -04:00
added zk* function type to initiate the zkcircuit
This commit is contained in:
13
lisp/lisp.rs
13
lisp/lisp.rs
@@ -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 {
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user