PlEncoding headers for frequent Pl-objects#110
PlEncoding headers for frequent Pl-objects#110mgondan wants to merge 2 commits intoSWI-Prolog:masterfrom
Conversation
Would you please check if I am on the right path? Then I will add a few unit tests and make a few cosmetic changes.
| explicit PlModule(const std::string& name) | ||
| : WrappedC<module_t>(Plx_new_module(PlAtom(name).unwrap())) | ||
| explicit PlModule(const std::string& name, PlEncoding rep=ENC_INPUT) | ||
| : WrappedC<module_t>(Plx_new_module(PlAtom(name, rep).unwrap())) |
There was a problem hiding this comment.
You would need to add a Plx_new_module with the additional parameter (which should also default).
|
Please also add test cases for the new methods/functions. (I'm travelling right now, so I might take a few days to respond) |
I take your responses as a yes :-) |
|
it's probably a good idea to do one function or constructor change all the way through (including a test case) to confirm that the compiler is happy with it (I've been fooled before). |
|
Added constructors and "compiler" tests such as PlAtom atom(3, "äöü", PlEncoding::UTF8), i.e., just the declarations, no tests so far. Happy to hear your feedback. I will continue thereafter. |
|
If you don't have a test that uses a constructor (or function), then the compiler won't do all the semantic checks because it won't generate any code. BTW, one of my earlier comments was wrong -- you shouldn't make any changes to SWI-cpp2-plx.h unless there has been a change to SWI-Prolog.h. |
This seems to be on cpp's todo list. Would you please check if I am on the right path? Then I will add a few unit tests and make a few cosmetic changes.