ichiban / prolog

The only reasonable scripting engine for Go.
MIT License
620 stars 31 forks source link

type check output list arguments #239

Closed ichiban closed 2 years ago

ichiban commented 2 years ago

235

codecov[bot] commented 2 years ago

Codecov Report

Merging #239 (9886c78) into main (862b26a) will increase coverage by 0.06%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #239      +/-   ##
==========================================
+ Coverage   97.46%   97.52%   +0.06%     
==========================================
  Files          21       21              
  Lines        6700     6758      +58     
==========================================
+ Hits         6530     6591      +61     
+ Misses        138      136       -2     
+ Partials       32       31       -1     
Impacted Files Coverage Δ
engine/builtin.go 96.85% <100.00%> (+0.07%) :arrow_up:
engine/exception.go 100.00% <100.00%> (ø)
engine/iterator.go 100.00% <100.00%> (ø)
engine/clause.go 100.00% <0.00%> (+2.17%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 862b26a...9886c78. Read the comment docs.

ichiban commented 2 years ago
$ go run cmd/1pl/main.go cmd/1pl/interpreter.go 
Top level for ichiban/prolog 
This is for testing purposes only!
See https://github.com/ichiban/prolog for more details.
Type Ctrl-C or 'halt.' to exit.
?- sort([],[t|1]).
2022/07/31 15:25:02 error(type_error(list,[t|1]),sort/2)
?- a =.. [t|1].
2022/07/31 15:25:12 error(type_error(list,[t|1]),=.. /2)
?- term_variables(_,[t|1]).
2022/07/31 15:25:20 error(type_error(list,[t|1]),term_variables/2)
?- findall(t,true,[t|1]).
2022/07/31 15:25:29 error(type_error(list,[t|1]),findall/3)
?- bagof(t,true,[t|1]).
2022/07/31 15:25:36 error(type_error(list,[t|1]),bagof/3)
?- setof(t,true,[t|1]).
2022/07/31 15:25:44 error(type_error(list,[t|1]),setof/3)
?- atom_chars(a, [t|1]).
2022/07/31 15:25:55 error(type_error(list,[t|1]),atom_chars/2)
?- atom_codes(a, [t|1]).
2022/07/31 15:26:02 error(type_error(integer,t),atom_codes/2)
?- atom_codes(a, [1|1]).
2022/07/31 15:26:07 error(type_error(list,[1|1]),atom_codes/2)
?-