소스 검색

fixing map and zkcons syntax

ada 5 년 전
부모
커밋
f7877f0ea3
2개의 변경된 파일12개의 추가작업 그리고 4개의 파일을 삭제
  1. 2 1
      lisp/lisp.rs
  2. 10 3
      lisp/new.lisp

+ 2 - 1
lisp/lisp.rs

@@ -277,7 +277,8 @@ fn eval(mut ast: MalVal, mut env: Env) -> MalRet {
                         let value = eval_ast(&a2, &env)?;
                         match value {
                             List(ref el, _)  => {
-                                zkcons_eval(el.to_vec(), &a1, &env);
+                                println!("{:?}", el);
+                              //zkcons_eval(el.to_vec(), &a1, &env);
                             }
                             _ => println!("invalid format"),
                         }

+ 10 - 3
lisp/new.lisp

@@ -9,12 +9,19 @@
 ;;                    (sub lc0 x)
 ;;                    )
 ;;              )
-    (zkcons! circuit (map (fn* [b] (
+    (map (fn* [b] (
+                    (zkcons! circuit (
                     (add lc0 one) 
                     (sub lc0 b)
-                    (add lc1 x)
+                    (add lc1 x))
 ;;                    'enforce)
-              )) bits))
+              ))) bits)
+;;    (zkcons! circuit (map (fn* [b] (
+;;                    (add lc0 one) 
+;;                    (sub lc0 b)
+;;                    (add lc1 x)
+;;                    'enforce)
+;;              )) bits))
 ;;    (def! enforce-loop-const (map (fn* [b] (
 ;;                    (add lc0 one) 
 ;;                    (sub lc0 b)