-
Notifications
You must be signed in to change notification settings - Fork 26
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
Add support for command-line arguments #12
Comments
As soon as we have limited support for arrays, then |
(Right now, I have to recompile if I want to change test sizes. It is making me crazy. And I don't want to use temp files and sed…) |
Couldn't we just pass on
(and then of course add them as proper arguments when we have array support in encore) |
What do you mean "pass on"? As in we add those parameters to the I guess this would solve the problem but it is way more hacky than anything I suggested. What is the rationale for doing it this way? To be able to solve it in <5 minutes? |
The rationale is that doing it this way first, we will only add features that we will use when we have array support as well (the arguments have to make their way into the main functions anyway). It would also require the lowest total amount of work, since we don't need to redo or throw away any intermediate work. Since parameter passing is something we are going to want in the language anyway, I would rather have a simple "hacky" version before implementing it properly (when we have the proper machinery). |
OK. I thought of my first one as very hacky too, just way less hacky. :) As long as I don't have to go crazy, I am fine. |
Fixed, as of 8432b64 (although commit messages are messed up). |
Here is a program that shows how one can go about to get the command line arguments. Note the (now common) trick to define an empty passive class to be able to type an embedded value.
|
Currently, the
PONY_MAIN
case in each actor's dispatch is set up to allocate its heap and then to callMSG_Main_main
. However, in this process, all command-line arguments are lost. One obstacle on the way to supporting this is our current lack of array support. As an intermediate step, I therefore suggest that we support the following scheme:PONY_MAIN
passes on arity number of arguments toMSG_Main_main
where arity is the the arity ofMSG_Main_main
from its declaration. Ifargc
inPONY_MAIN
is less than arity, the "missing arguments" will benull
, 0 or false depending on type.argc
.The text was updated successfully, but these errors were encountered: