Fork: Difference between revisions
Content added Content deleted
(Dialects of BASIC moved to the BASIC section.) |
m (→{{header|Wren}}: Minor tidy) |
||
Line 1,673: | Line 1,673: | ||
{{trans|C}} |
{{trans|C}} |
||
The ability to call C library functions such as ''fork'' may be added to Wren-cli in the next release. In the meantime, we embed the following Wren script in a minimal C host (no error checking) to complete this task. |
The ability to call C library functions such as ''fork'' may be added to Wren-cli in the next release. In the meantime, we embed the following Wren script in a minimal C host (no error checking) to complete this task. |
||
<syntaxhighlight lang=" |
<syntaxhighlight lang="wren">/* Fork.wren */ |
||
class C { |
class C { |
||
Line 1,756: | Line 1,756: | ||
WrenVM* vm = wrenNewVM(&config); |
WrenVM* vm = wrenNewVM(&config); |
||
const char* module = "main"; |
const char* module = "main"; |
||
const char* fileName = " |
const char* fileName = "Fork.wren"; |
||
char *script = readFile(fileName); |
char *script = readFile(fileName); |
||
wrenInterpret(vm, module, script); |
wrenInterpret(vm, module, script); |