update symbol handling so that less warnings applies to non defined variables

parent 0f35ea88
......@@ -5,6 +5,7 @@
#:export (freeze frozen when dif))
(define doWhen (gp-make-var))
#|
(define do_all_atts #f)
(define freezeId #f)
(define combine_atts #f)
......@@ -15,6 +16,7 @@
(define diffId #f)
(define mk_cond #f)
(define membereq #f)
|#
(compile-prolog-string
"
......@@ -63,21 +65,24 @@ do_all_atts_when(Val, [Id, G | L]) :-
call(G) -> (!,do_all_atts_when(Val, L)) ; (!,do_all_atts_when(Val, L)).
do_all_atts_when(Val, []).
whenId(Val,Var) :-
(
var(Val);attvar(Val);
(var(scm[doWhen]) ->
(
get_attr(Var,whenId,Atts),!,
del_attr(Var, whenId),
Var = Val;
do_all_atts_when(Atts)
get_attr(Var,whenId,Atts),!,
del_attr(Var, whenId),
Var = Val,
do_all_atts_when(Atts)
);
(
get_attr(Var,whenId,[VV|_]), VV=Val,!,
get_attr(Var,whenId,[VV|_]), VV=Val
)
),!,
)
),!.
difId(Val, Var) :-
var(Val);attvar(Val);
(
......@@ -99,7 +104,7 @@ process_cond((X;Y), Vars) :- !,
% This is very non multithreading, let doWhen be a kanren style variable and
% we are golden.
process_cond(X=Y, [X], (\\+(scm[doWhen] = true, X=Y) -> false ; true)) :- !.
%process_cond(X=Y, [X], (\\+(scm[doWhen] = true, X=Y) -> false ; true)) :- !.
process_cond(nonvar(X), [X], nonvar(X)) :- !.
%process_cond(ground(X), [X], ground(X)) :- !.
......
......@@ -141,7 +141,8 @@
(#:term (#:atom simple-1276 #f #f ,n ,m) ,args #f ,n ,m)
,rs ,n ,m)) ))
(((('xfx _ ":-" _) (#:term (#:atom v . _) y . _) z n m))
(((('xfx _ ":-" _) (#:term (and sym (#:atom v . _)) y . _) z n m))
(add-sym #f #f sym)
(if (is-dynamic? v)
`(#:translated
1 ,#`(prolog-run
......@@ -154,7 +155,8 @@
(_
(list v (get.. "," y) z)))))
(((('xfx _ ":-" _) (#:atom v . _) z n m))
(((('xfx _ ":-" _) (and sym (#:atom v . _)) z n m))
(add-sym #f #f sym)
(if (is-dynamic? v)
`(#:translated
1 ,#`(prolog-run
......@@ -182,7 +184,8 @@
((#:translated _ _)
x)
((#:atom v _ _ n m)
((and sym (#:atom v _ _ n m))
(add-sym #f #f sym)
(if (is-dynamic? v)
`(#:translated
1 ,#`(prolog-run
......@@ -191,7 +194,8 @@
,x _ ,n ,m))))
(list v '() '())))
((#:term (#:atom v . _) y _ n m)
((#:term (and sym (#:atom v . _)) y _ n m)
(add-sym #f #f sym)
(if (is-dynamic? v)
`(#:translated
1 ,#`(prolog-run
......@@ -316,10 +320,13 @@
(cons x (lp l)))
(() '())))))
(ppp 'res #`(begin
(add-non-defined
(quote #,(datum->syntax stx (get-syms))))
lam-def ... #,@l #,@evl)))))))))
(let* ((syms (get-syms))
(syms (union syms syms)))
(ppp 'res #`(begin
(eval-when (compile load eval)
(add-non-defined
(quote #,(datum->syntax stx syms))))
lam-def ... #,@l #,@evl))))))))))
(define-syntax save-operator-table
(lambda (x)
......@@ -396,7 +403,6 @@
(count-variables (map (lambda (x) (cons x 0)) v-all) (cons l r))
(with-syntax (((((lhs ...) ...) ...) lhs)
(((rhs ...) ...) rhs)
((((loc ...) ...) ...) loc)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment