Talk:Modulinos: Difference between revisions

(→‎Name change?: Easy search)
Line 36:
<lang c>#include "scriptedmain.h"</lang>
 
Meanwhile, thisThis whole concept of "startup" is an OS issue, and not a language issue. Some operating systems have various ways of starting programs, and "main" may or may not be a part of them. (For example, using drag&drop to start a program might work differently from starting the program from a command line.)
And since this is a locally defined include, and not a system include it could be anything. And, the program is incomplete (will not compile) without it. Ironically, when I follow the link to github, I find an empty file for scriptedmain.h: https://github.com/mcandre/scriptedmain/blob/master/scriptedmain.h
 
Meanwhile, this whole concept of "startup" is an OS issue, and not a language issue. Some operating systems have various ways of starting programs, and "main" may or may not be a part of them. (For example, using drag&drop to start a program might work differently from starting the program from a command line.)
 
Furthermore, different concepts of what this all means depend very much on how the code is represented. A compiled language may be represented as a shared library, or not, where an interpreted language may be represented as neither. But a compiled language may also be represented as source code. And if you have source code as a set of files, you could perhaps simply ignore the file that defines main (if the language even uses that name -- some might abstract it away even if the OS requires its use).
 
So, anyways, I think this task needs some work. Specifically, I think it needs some kind of illustration requirement (where the "scripted main" code gets used by some other code that has its own "main"). Also, the C implementation should compile.
 
-- [[User:Rdm|Rdm]] 17:51, 4 March 2011 (UTC)
 
Test the C program yourself. As long as scriptedmain.h is missing the main() prototype, a second file test.c will not execute scriptedmain.c's main(). --[[User:Mcandre|Mcandre]]
: P.S. perhaps the C version works by defining
 
:I see that you have updated the description of the C program, to specify that
<lang c>#define main notmain</lang>
scriptedmain.h is blank, so I have removed those comments that referred to this issue. However, since the example does not demonstrate the use of any API, I think the example is useless and unclear. (We have to imagine that we know what you are trying to illustrate.) --[[User:Rdm|Rdm]]
 
in scriptedmain.c, when the main file is being used in a library?
 
Test the C program yourself. As long as scriptedmain.h is missing the main() prototype, a second file test.c will not execute scriptedmain.c's main(). --[[User:Mcandre|Mcandre]]
6,951

edits