Section Intro: Primitive Operators
While most functions in Meta-HTML are used to create or manipulate Web pages, there may be times when you will wish to manipulate the Meta-HTML language itself, the low-level operation of the server, or have direct access to the current page that is executing, and information pertaining to the Meta-HTML parser itself.
The functions described in this section allow just this type of low-level access. Programming wizards may find these functions useful -- many of them are here to allow the implementation of core functionality in Meta-HTML in the Meta-HTML language itself.
All of the primitive language operators begin with the two-character sequence of double percent signs ("%%") in order to distinguish them from the other, higher-level functions in Meta-HTML.
Store BODY for execution at a later time, specifically, after the top
level process is completed. For the Meta-HTML server or engine, this is
after the requested page has been successfully delivered; for
I would be interested if anybody actually needs this function -- if you do, please drop me a line showing how it made your life easier.
Bootstrap the user defined functions which are compiled into Meta-HTML. This loads the definitions into the inpterpreter, and then calls <bootstrapper::system-initialize>.
When CALL-INITIALIZER? is non-empty, this function also calls <bootstrapper::initialize>.
The one obvious use for this function is in mhc programs which
are run with the `-z' flag (which prevents bootstrapping from taking place).
Such programs may read some files in order to define a set of functions,
remember those functions (by calling
Evaluate the result of evaluating BODY and return that value.
It would be a very rare case indeed, where a user-level program would require the use of this tag. If you think you want to use this tag, you probably want to use <apply> instead.
You may use this function to call another function on some arguments, where the other function is determined dynamically. For example:
<if <set-in-session> <set-var func=set-session-var> <set-var func=set-var>> <%%eval <<get-var-once func> <get-var-once name> = <get-var-once value>>>
Returns all information that we store about the user-defined function USER-FUNCTION, in the form of an alist. This function is used internally by the Meta-HTML grinder and beautifier -- it is unlikely in the extreme that one would use this in application programs -- it is meant for use in programs that manipulate the Meta-HTML language itself.
Returns an array of the formal parameters for USER-FUNCTION. Essentially, this returns exactly what was entered at the time the function definition was defined.
Returns a string, which, if read back into Meta-HTML, would result in the re-defining of the user function USER-FUNCTION. This function is used internally by the Meta-HTML compiler -- it is unlikely in the extreme that one would use this in application programs -- it is meant for use in programs that manipulate the Meta-HTML language itself.
Returns the documentation for USER-FUNCTION. Only works if the variable MHTML::GATHER-DOCUMENTATION was set at the time the USER-FUNCTION was defined.
Returns the current parser marker in the page. CAVEAT! Currently, can only be called at top level.
After evaluating BODY, the results are quoted in such a way that Meta-HTML will treat it as one argument. Used internally by the function invoker.
Reads package contents from the file specified by FILENAME, which
had best be created using
Reads one symbolic expression from STRING-VAR and returns it. Sets INDEX-VAR to the first unread character in STRING-VAR. If INDEX-VAR is empty, it defaults to zero. There isn't the slightest possibility that you need this in your programs.
Changes the current user to NEWUSER, and returns "true" if the switch was successful. This can only take place if Meta-HTML is running under the user ID of the superuser (root). After calling this function, it is impossible to switch back to another user, so it really isn't of much use in Meta-HTML programs.
Places the current page into VARNAME as a binary variable, or, returns the current page as text if VARNAME is not supplied.
Writes the contents of PACKAGES to the file specified by FILENAME. This function is used internally when creating libraries. There isn't the slightest possibility that you need this in your programs -- if you think you do, you probably simply want to use mklib.
If the keyword argument FLAGGED is set, is means to only write those
symbols whose flags contain a FLAGGED value, i.e., where
Keyword argument NO-CODE with a non-null value, means don't bother saving the textual body of functions with the machine code -- it isn't generally necessary to do so, but the default is to save the bodies so that Meta-HTML installations which don't have the modmachine.so library installed can still read and execute the resultant '.lib' files.
Apply FUNC to ARGS.
This weakmacro can either be used as a simple tag or as a complex tag -- its usage is dependent on the function being called.
Using <apply> as a simple tag:
<apply add 3 4 5> ==> 12 <defun foo &key bar baz> <get-var bar>, <get-var baz> </defun> <apply foo "bar=this baz=2"> ==> this,2
Using <apply> as a complex tag:
<defmacro upcase-text &key bold? &body body> <if <get-var-once bold?> <b>> <upcase <get-var-once body>> <if <get-var-once bold?> </b>> </defmacro> <apply upcase-text> This is a list of things to "change case of" </apply> <apply upcase-text bold?=true> And this is upcased <i>and</i> bold </apply>
The META-HTML Reference Manual V2.0 Copyright © 1995, 1998, Brian J. Fox
Found a bug? Send mail to firstname.lastname@example.org