Site Tools


standard_loader

Synopsis:

load -std <file> [<file> …]

Description:

The standard loader converts a text file into a sequence of blocks which are executed one after another until the text file has been exhausted.

The standard loaders behavior does not follow the normal ircii syntax, and many people confuse the behavior of the loader with the behavior of ircii. Because of this, newcomers are easily confounded, and for no good purpose.

The standard loader works by using an accumulator to build up blocks and then runs them when they are completed.

  1. A logical line is read in from the file
    • A physical line is read from the file, and leading whitespace is ignored
    • If the line starts with # it is ignored
    • If the line ends with a backslash, the next line is appended to the logical line, and whitespace is not ignored and # is not a comment character.
  2. Append this logical line to the accumulator.
  3. If the accumulator starts with /* [a comment], remove everything up to the matching */. If there is no matching */, keep accumulating.
  4. If there is an unmatched { in the accumulator, append a semicolon to the end of the accumulator if there isn't already one, and keep accumulating.
  5. If the first character of the next line is {, do not append a semicolon, but keep accumulating.
  6. Eventually you get an accumulator with no unmatched {'s. This is a block of code and it is executed, and the accumulator is cleared.

Repeat this process until the file is exhausted. The problem with the above description is it is only approximately correct, and there are too many weird edge cases that don't obey the above rules. I won't lie to you, a right and proper explanation of the standard loader would have to involve profanity. So I won't do that here.

The reason the std loader confuses new users is because it has its own syntax which is not the ircII syntax, and it rewrites your script behind your back to conform to ircII syntax. This is lame because if you have to actually write stuff in ircII syntax, you don't know what rules apply where. Plus, the std loader lamely puts semicolons on the end of every line, and there's no way to make it not do this if you don't want it done.

The solution to these problems is to use the pf loader which treats your entire file as one gigantic block and runs it without processing. This, at least, means you write your scripts in standard ircii syntax, and doesn't have the loader rewriting your script behind your back.

All of the scripts that come with epic5 are in the pf format, and the std loader should die the quick and painful death it so richly deserves.

standard_loader.txt · Last modified: 2006/09/05 16:56 by 127.0.0.1