[Contents]
[Prev] [Next] [Limbo Basics] [Limbo Programming] [Language Definition]

The init Function

When a program is executed from the Inferno shell, the shell looks for a special function called init. This function tells Inferno where execution of the program starts. It is somewhat analogous to the main function in C.

That init function must have two arguments: ref Draw->Context and list of string.

ref Draw->Context

The ref Draw->Context is used to grab the context of the display and is defined in draw.m. This argument is required even if the program does not do any graphics. If it is not used, it can be named nil.

list of string

The list of string is a list of the arguments passed to this module via the command line. If the program does not expect any arguments passed from the command line, it can be named nil.

This is functionally equivalent to the argv variable in C, and is conventionally named argv in Limbo.



[Contents]
[Prev] [Next] [Limbo Basics] [Limbo Programming] [Language Definition]

Copyright © 1998, Lucent Technologies, Inc. All rights reserved.