Mercurial Hosting > luan
diff website/src/manual.html.luan @ 799:9c13a15a4002
Package.load() now returns false instead of null, and caches the result. This cleans up the luan.isLocked issues.
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Tue, 06 Sep 2016 18:03:19 -0600 |
parents | 60661a8e738c |
children | 616761e0b9f6 |
line wrap: on
line diff
--- a/website/src/manual.html.luan Tue Sep 06 12:23:03 2016 -0600 +++ b/website/src/manual.html.luan Tue Sep 06 18:03:19 2016 -0600 @@ -2268,7 +2268,7 @@ To load a new value, <code>Package.load</code> first checks if <code>mod_uri</code> starts with "<b>java:</b>". If yes, then this is a Java class which is loaded by special Java code. <p> -If <code>mod_uri</code> is not a Java class, then <code>Package.load</code> tries to read the text of the file referred to by <code>mod_uri</code>. If the file doesn't exist, then <code>Package.load</code> returns <b>nil</b>. If the file exists, then its content is compiled into a chunk calling <a href="#Luan.load"><code>Luan.load</code></a> and passing in an empty table as the <code>env</code> value. This chunk is run passing in <code>mod_uri</code> as an argument. If the chunk returns a value other than <b>nil</b>, then that value is the value of this module. Otherwise the <code>env</code> that was passed in is the value of this module. +Otherwise <code>Package.load</code> tries to read the text of the file referred to by <code>mod_uri</code>. If the file doesn't exist, then <code>Package.load</code> returns <b>false</b>. If the file exists, then its content is compiled into a chunk by calling <a href="#Luan.load"><code>Luan.load</code></a>. This chunk is run passing in <code>mod_uri</code> as an argument. The value returned by the chunk must not be <b>nil</b> and is loaded. <p> If a new value for the module successful loaded, then it is stored in <code>Package.loaded[mod_uri]</code>. The value is returned.