Implement modules support and import() function #1
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
In scope of this ticket, we need to implement a module system for P# Interpreter. It is a necessary step in order to divide the existing code into separate, dynamically loadable modules. This includes import() function, that can be called from inside a script. It should return a boolean value (false on any error, or true otherwise). What is more, some 'dummy' module has to be written for tests.
Requirements are:
Some code snippet:
Above code gives the following output now:
Still TODO:
Still TODO:
I think it is fully implemented now by
28dbeeb1ad
&0dc9a04f0e
.If we re going into WIN32 api vs unixes. Would it be useful to make wrappers around some few types (e.g.
HINSTANCE
/FILE *
orvoid *
) at least ?Maybe it is not perfect, but PH7 itself is already multiplatform and I think we want to go for it.
No the code is good but if we go further and need to call more and more specific win32 api in the future and as HINSTANCE, for example, is quite common ... Or another approach (if it happens not necessary at all for now), to have specific c with all win32 api implementation and one separated for unixes Makefile caring only about the latter the vs project for former ... but might be early to think that way, just food for future thoughts ... sort of.
I hope there won't be much more WinAPI in use.