The following code implements our help command such that help.txt is incorperated into the runtime executable. If we are executing this from the development environment, this will actually return a stream to the gelp.txt itself. When executed from the saved-state, the stream will actually be a stream opened on the program resource file, taking care of the offset and length of the resource. This predicate is defined as a dynamic predicate in the module user . Clauses for it may be defined in any module, including the user module.
Class describes the what kind of object is stored in the resource.
In the current implementation, it is just an atom. For proper generation of the saved state, it must be possible to enumerate the available resources by calling this predicate with all its arguments unbound. Dynamic rules are useful to turn all files in a certain directory into resources, without specifying a resources for each file. Opens the resource specified by Name and Class . If the latter is a variable, it will be unified to the class of the first resource found that has the specified Name .