fixes
This commit is contained in:
parent
d9d954abe1
commit
36ae500118
@ -23,6 +23,23 @@ ex(hello) :-
|
|||||||
:= $c:stroke(path:line(0, 0, 2, 0)),
|
:= $c:stroke(path:line(0, 0, 2, 0)),
|
||||||
:= $c:writePDFfile('hello').
|
:= $c:writePDFfile('hello').
|
||||||
|
|
||||||
|
ex(pathitem) :-
|
||||||
|
c := canvas:canvas(_),
|
||||||
|
rect1 := path:path(path:moveto(0, 0), path:lineto(1, 0),
|
||||||
|
path:moveto(1, 0), path:lineto(1, 1),
|
||||||
|
path:moveto(1, 1), path:lineto(0, 1),
|
||||||
|
path:moveto(0, 1), path:lineto(0, 0)),
|
||||||
|
rect2 := path:path(path:moveto(2, 0), path:lineto(3, 0),
|
||||||
|
path:lineto(3, 1), path:lineto(2, 1),
|
||||||
|
path:lineto(2, 0)),
|
||||||
|
rect3 := path:path(path:moveto(4, 0), path:lineto(5, 0),
|
||||||
|
path:lineto(5, 1), path:lineto(4, 1),
|
||||||
|
path:closepath(_)),
|
||||||
|
:= $c:stroke($rect1, [style:linewidth:'THICK']),
|
||||||
|
:= $c:stroke($rect2, [style:linewidth:'THICK']),
|
||||||
|
:= $c:stroke($rect3, [style:linewidth:'THICK']),
|
||||||
|
:= $c:writePDFfile('pathitem').
|
||||||
|
|
||||||
ex(changebar) :-
|
ex(changebar) :-
|
||||||
g := graph:graphxy(width=8, x=graph:axis:bar(_)),
|
g := graph:graphxy(width=8, x=graph:axis:bar(_)),
|
||||||
base(Source), atomic_concat(Source, 'minimal.dat', Data),
|
base(Source), atomic_concat(Source, 'minimal.dat', Data),
|
||||||
|
@ -1294,13 +1294,13 @@ python_apply(term_t tin, term_t targs, term_t keywds, term_t tf)
|
|||||||
term_t targ = PL_new_term_ref();
|
term_t targ = PL_new_term_ref();
|
||||||
|
|
||||||
pF = term_to_python(tin);
|
pF = term_to_python(tin);
|
||||||
|
if ( pF == NULL ) {
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
if (PL_is_atom(keywds) )
|
if (PL_is_atom(keywds) )
|
||||||
pKeywords = NULL;
|
pKeywords = NULL;
|
||||||
else
|
else
|
||||||
pKeywords = term_to_python(keywds);
|
pKeywords = term_to_python(keywds);
|
||||||
if ( pF == NULL ) {
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
if (! PL_get_name_arity( targs, &aname, &arity) ) {
|
if (! PL_get_name_arity( targs, &aname, &arity) ) {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
@ -117,11 +117,11 @@ python_class(Obj) :-
|
|||||||
|
|
||||||
process_obj(Obj, _, S, Obj, NS, Dict) :-
|
process_obj(Obj, _, S, Obj, NS, Dict) :-
|
||||||
python_callable(Obj), !,
|
python_callable(Obj), !,
|
||||||
python_check_args(Obj, Obj, S, NS, Dict).
|
python_check_args(S, NS, Dict).
|
||||||
process_obj(Obj, _, S, Obj, NS, Dict) :-
|
process_obj(Obj, _, S, Obj, NS, Dict) :-
|
||||||
python_class(Obj),
|
python_class(Obj),
|
||||||
descend_object(Obj:'__init__', FObj, _, _),
|
descend_object(Obj:'__init__', FObj, _, _),
|
||||||
python_check_args(Obj, FObj, S, NS, Dict).
|
python_check_args(S, NS, Dict).
|
||||||
|
|
||||||
python_eval_term(Obj, Obj) :-
|
python_eval_term(Obj, Obj) :-
|
||||||
var(Obj), !.
|
var(Obj), !.
|
||||||
@ -134,10 +134,14 @@ python_eval_term([H|T], [NH|NT]) :- !,
|
|||||||
python_eval_term(N, N) :- atomic(N), !.
|
python_eval_term(N, N) :- atomic(N), !.
|
||||||
python_eval_term(Exp, O) :-
|
python_eval_term(Exp, O) :-
|
||||||
descend_exp(Exp, Obj, Old, S), !,
|
descend_exp(Exp, Obj, Old, S), !,
|
||||||
python_check_args(S, NS, Dict),
|
(functor(S, _, 0) ->
|
||||||
python_apply(Obj, NS, Dict, O).
|
O = Obj
|
||||||
|
;
|
||||||
|
python_check_args(S, NS, Dict),
|
||||||
|
python_apply(Obj, NS, Dict, O)
|
||||||
|
).
|
||||||
python_eval_term(S, O) :-
|
python_eval_term(S, O) :-
|
||||||
python_check_args('.', '.', S, NS, {}),
|
python_check_args(S, NS, {}),
|
||||||
python_is(NS, O).
|
python_is(NS, O).
|
||||||
|
|
||||||
python_check_args(Exp, t, {}) :-
|
python_check_args(Exp, t, {}) :-
|
||||||
|
Reference in New Issue
Block a user