Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

example average/3 does not clear exceptions #52

Open
kamahen opened this issue Aug 19, 2023 · 2 comments
Open

example average/3 does not clear exceptions #52

kamahen opened this issue Aug 19, 2023 · 2 comments

Comments

@kamahen
Copy link
Member

kamahen commented Aug 19, 2023

Running the tests with

$HOME//src/swipl-devel/build/src/swipl "-p" "foreign=" "-f" "none" "--no-packs" "--on-error=status" "-s" "$HOME/src/swipl-devel/packages/cpp/test_cpp.pl" 
?- average(X, foo(X), Average).
ERROR: Unknown procedure: foo/1
ERROR: In:
ERROR:   [13] foo(_6142)
ERROR:   [12] call(user:foo(_6176)) at /home/peter/src/swipl-devel/build/home/boot/init.pl:500
ERROR:   [11] <meta call>
ERROR:   [10] average(_6224,foo(_6232),_6228) <foreign>
ERROR:    [9] toplevel_call(user:user: ...) at /home/peter/src/swipl-devel/build/home/boot/toplevel.pl:1173
   Exception: (13) foo(_5138) ? l
Thread 1 (main): foreign predicate average/3 did not clear exception:
	error(existence_error(procedure,foo/1),context(prolog_stack([frame(13,call(user:foo/1),foo(_140)),frame(12,clause(<clause>(0x5c7a323bc120),3),call(user:foo(_174))),frame(11,meta_call,0),frame(10,foreign(user:average/3),average(_222,foo(_230),_226)),frame(9,clause(<clause>(0x5c7a325e8fc0),3),toplevel_call(user:user: ...))]),_102))
Average = 1.5NaN.
@JanWielemaker
Copy link
Member

Where does this come from? ctest -R cpp runs fine. So does

src/swipl ../packages/cpp/test_cpp.pl
?- test_cpp.

@kamahen
Copy link
Member Author

kamahen commented Aug 19, 2023

This isn't a test case (yet). I ran the tests, then manually loaded the foreign code with the command line I gave above (which is what the test cases run)

$HOME/src/swipl-devel/build/src/swipl "-p" "foreign=" "-f" "none" "--no-packs" "--on-error=status" "-s" "$HOME/src/swipl-devel/packages/cpp/test_cpp.pl" 

and then ran the example query average(X, foo(X), Average).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants