SWI-Prolog / packages-cpp

The SWI-Prolog C++ interface
30 stars 14 forks source link

Simplified "throw exception" interface, used std::string instead of char* where possible #25

Closed kamahen closed 1 year ago

kamahen commented 1 year ago

Renamed test files Changed some functions to return std::string instead of char* (to avoid lifetime errors) Provided wrappers for PL_atom_mbchars, PL_get_nchars Simplified some of the "throw exception" interface

kamahen commented 1 year ago

@JanWielemaker : please take a look at the section that's removed from pl2cpp.doc, starting \constructor{PlException}{const PlTerm \&t} in change https://github.com/kamahen/packages-cpp/commit/c8d70cb93f11b9a6dca1dd5988f75bf5f1ba5d51

JanWielemaker commented 1 year ago

removed from pl2cpp.doc

I'm mostly wondering why. When we embed Prolog in C++, how do we print exceptions when we call Prolog?

JanWielemaker commented 1 year ago

Thanks. Merged after rebase. We could probably squash some commits, but I think there is some value in the commit messages that makes it worthwhile preserving them.