Talk:Executable library: Difference between revisions

Content added Content deleted
(→‎Pike problem: I might be dense, but could you spell it out for me?)
Line 63: Line 63:
: the first file IS the one file you are looking for. it is the complete library, usable as an executable. the other two files are to satisfy the second requirement to build a second executable to use the library. since usage as a class and as a module are different, this solution provides both. i have added that to the explanations. thank you for pointing out that this was not clear.
: the first file IS the one file you are looking for. it is the complete library, usable as an executable. the other two files are to satisfy the second requirement to build a second executable to use the library. since usage as a class and as a module are different, this solution provides both. i have added that to the explanations. thank you for pointing out that this was not clear.
: to elaborate:
: to elaborate:
:: every source file in Pike can be used as an executable if it has a <code>main()</code> function.
:: every source file in Pike with any extension can be used as an executable if it has a <code>main()</code> function.
:: every source file can be used as a module if it has a <code>.pmod</code> extension.
:: every source file can be used as a module if it has a <code>.pmod</code> extension.
:: every source file can always be used as a class (because it is one)
:: every source file can always be used as a class (because it is one)
Line 69: Line 69:


:::Hi eMBee, Are you saying then that the correctly formulated file with a .pmod extension can be used ''both'' as a module and as an executable (without name change)? If so, then all is well. --[[User:Paddy3118|Paddy3118]] 08:40, 7 November 2011 (UTC)
:::Hi eMBee, Are you saying then that the correctly formulated file with a .pmod extension can be used ''both'' as a module and as an executable (without name change)? If so, then all is well. --[[User:Paddy3118|Paddy3118]] 08:40, 7 November 2011 (UTC)
:::: yes, without name change. when used as an executable the extension is ignored. it only matters to separate class and module use.
:::: the .pike extension is only needed to let pike detect the class automatically, otherwise, since classes can be compiled at runtime, i could compile any file as a class manually using <code>program Hailstone_class = compile_file("hailstone.pmod");</code>.--[[User:EMBee|eMBee]] 08:55, 7 November 2011 (UTC)