Difference between revisions of "Guide:Importing"

From IokeWiki
Jump to: navigation, search
(New page: = Importing = To import new code into Ioke, the method "use" should be used. The terminology is that you give "use" a name of a module to include, and if that module h...)
 
(Importing)
 
Line 1: Line 1:
 
= Importing =
 
= Importing =
  
To import new code into Ioke, the method "use" should be used. The terminology is that you give "use" a name of a module to include, and if that module has already been included it will not be evaluated again. If it has not been included, "use" will try to find the module using several different heuristics. It will add an ".ik" to the name and try to look up a file of that name - but it will also try to look it up without a ".ik", if a full file name has been given. Several different places will be searched, and the exact order and what will be searched can be found by calling the "System loadPath" method. This will return a list of all the places to search for modules. This list can be modified to add more directories to the load path.
+
To import new code into Ioke, the method <code>use</code> should be used. The terminology is that you give &quot;use&quot; a name of a module to include, and if that module has already been included it will not be evaluated again. If it has not been included, <code>use</code> will try to find the module using several different heuristics. It will add a <tt>.ik</tt> to the name and try to look up a file of that name - but it will also try to look it up without a <tt>.ik</tt>, if a full file name has been given. Several different places will be searched, and the exact order and what will be searched can be found by calling the <code>System loadPath</code> method. This will return a list of all the places that Ioke uses to search for modules. This list can be modified to add more directories to the load path at runtime.
  
 
If a module of the specified name can't be found, a condition will be signalled.
 
If a module of the specified name can't be found, a condition will be signalled.

Latest revision as of 04:47, 26 January 2009

Importing

To import new code into Ioke, the method use should be used. The terminology is that you give "use" a name of a module to include, and if that module has already been included it will not be evaluated again. If it has not been included, use will try to find the module using several different heuristics. It will add a .ik to the name and try to look up a file of that name - but it will also try to look it up without a .ik, if a full file name has been given. Several different places will be searched, and the exact order and what will be searched can be found by calling the System loadPath method. This will return a list of all the places that Ioke uses to search for modules. This list can be modified to add more directories to the load path at runtime.

If a module of the specified name can't be found, a condition will be signalled.