Commits

Pjotr Kourzanov committed 7d87eff

fix map/for-each and add for-all...

Comments (0)

Files changed (1)

 		(pair? ((sxpath ,(symbol->string s)) p)))
 	     (define (,(symbol-append 'is-not- s) p)
 		(null? ((sxpath ,(symbol->string s)) p))))))
+
 (gen-predicate const)
 (gen-predicate static)
 (gen-predicate restrict)
-(gen-getter size)
+(gen-getter type)
 (gen-getter-num size)
 
 <<process>>=
+(define (for-all l p) (for-each p l))
+
 (define (gxf:activate n in)
-   (map (lambda (p)
-	   (if (is-not-const p)
-	       (pp (get-size p)))
-	   )
-        (pre-post-order in
-	`((*TOP* *macro*    . ,(lambda top ((sxpath "gxf/node[id=$n]/port") in
-				    `([n . ,((sxpath "gxf/node[id=$n]/stereo-type/text()") in
-						`([n . ,(symbol->string n)]))]))))
-	  (*text*   	. ,Unmeta)
-	  (*default*  	. ,Id)
-	  )))
-   )
+   (for-all ((sxpath "gxf/node[id=$n]/node") in
+		`([n . ,((sxpath "gxf/node[id=$n]/stereo-type/text()") in
+			`([n . ,(symbol->string n)]))]))
+	     (lambda (n)
+		(for-all ((sxpath "port") n)
+			  (lambda (p)
+			     (and (is-const p) (pp p))))
+		)
+	     ))
 
 (define (gxf:collapse-code in)
    (let* ([ll (gxf:incidence in)]
 			      "]")
 			     ";")
 		        )) edges (array->list mb))
-	      (for-each (lambda (x)
+	      (for-all cy (lambda (x)
 			   (labels ([find-activation (v a)
 					(do [(i 0 (+ 1 i))]
 					    ((or (positive? (vector-ref v i))
 				 ;(gxf:activate n in)
 				 (out (symbol->string n) "(" ");" )
 				 ))
-			   ) cy)
+			   ))
 	      )))
 	 ))))
 
 <<Miscellaneous>>=
 (define (out . x)
    (let ([first #t])
-      (for-each (lambda (x)
+      (for-all x (lambda (x)
 	   (begin
 	      (or first (display " "))
 	      (set! first #f)
 	      (display x))
-	   ) x))
+	   )))
       (newline))
 
 @ Check whether a certain property [[p]] holds for all elements of a vector.