>1. the function returns a value, which can be a string (limited by
>the value size of a CI variable to 1024 bytes), Boolean, or signed
>32 bit integer, in place of its name and arguments.
Good
>2. the function value will be returned via the CI's :RETURN command,
>which will have an optional expression arg added.
Good
>3. a function that does not explicitly return a value will either be
>an error (dislike), or will be void (prefer). A void function would
>simply be executed inline and erased from the command line image.
So a function called from the CI
:myfunc()
would just throw away the result. I would have to force an echo or
assignment to see its value.
:echo ![myfunc()]
:setvar A myfunc()
Good
>4. a user function is located via the same mechanisms used to locate
>UDCs and command files/scripts. That is, HPPATH is used to find scripts
>and the UDC directory is used to find UDCs. UDCs have precedence over
>scripts of the same name. A script could invoke UDC and script functions.
>A UDC could do the same. Option RECURSION UDCs would cause the search
>to start over at the beginning of the UDC catalog. "NoRecursion" UDCs,
>which are the default, would start from where the current UDC resides
>(in file order and user, account, system order).
Good
>5. a script or UDC can invoke itself as a function and today's nesting
>limits will apply.
Good
>6. (sadly) I/O redirection will not be supported for many function
>invocations. This is because the CI does not perform I/O redirection
>on the most important commands involved with expression evaluation,
>such as: if, elseif, while, setvar, calc.
OK
>7. function precedence order is that predefined functions take
>precedence over user defined functions. So, if you define your own
>"string" function, you need to name it some other name besides "STR",
>since the CI will always execute the built-in str() function.
hmmm, it may be nice to "replace" a CI function, much like UDC's
can replace CI commands.
Then again, I could change all my scripts to use my string function
instead of STR, and my script can optionally call STR or do
something new.
OK
>8. user function names follow the same rules as UDC and script
>names as far as legal characters and the length of the name.
Good
___________________________________________________________________
Keven Miller mailto:[log in to unmask] http://www.exegesys.com
* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
|