Site Tools


stub

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

stub [2006/08/29 20:18] (current)
Line 1: Line 1:
 +# $EPIC: stub.txt,v 1.5 2006/08/29 18:22:56 sthalik Exp $
 +
 +======Synopsis:​======
 +__stub__ alias|assign <​alias/​var>​[,<​alias/​var>​] <​filename>​ [<​filename>​ ...]
 +
 +======Description:​======
 +The __STUB__ allows you to set up a load-on-demand alias or assign.
 +You may __STUB__ any alias or variable name to a filename. ​ Whenever a
 +stubbed alias or variable name is looked up, the stub is deleted, and 
 +the lookup is interrupted while the filename to which the alias is stubbed
 +is loaded. ​ After the load, the lookup continues as normal. ​ If the script
 +that is loaded does not actually define a real value for the alias or 
 +assign, then after the load the alias or assign is treated as any other
 +undefined value.  ​
 +
 +__STUB__s are automatically deleted whenever they are first used.  They
 +can also be deleted if a real alias or assign value is given to them.
 +(So for example, you can stub 3 aliases to the same file, and when that
 +file is loaded, it /[[alias command|aliases]] all 3 of them, so all 3 stubs go away)
 +
 +__STUB__s can load more than one file at a time.
 +
 +The idea of using __STUB__s is to shorten load times by not having to 
 +take the time to load files implementing features your script may offer
 +that the user will never use.  If the user does use the feature, then it
 +is loaded on demand and they never know the difference.
 +
 +======Examples:​======
 +To load the file foobar.irc when the /foo command is issued:
 +      stub alias foo foobar.irc
 +      ​
 +To load footoo.irc when $foo and $bar are accessed:
 +      stub assign foo,bar footoo.irc
  
stub.txt ยท Last modified: 2006/08/29 20:18 (external edit)