Several functions are built into the WebL programming language (in contrast to functions written by the programmer). We distinguish between normal built-ins and special built-ins. Normal built-ins evaluate all their actual arguments before invoking the function. Special built-ins defer the evaluation of their arguments to the function being invoked. Examples of special built-ins include Time, Timeout, and Retry.
Most built-ins accept only a fixed number of arguments. Some built-ins like PrintLn accept any number of arguments of any value type. Variable length argument builtins are specified with ellipses (...) in See Core Built-in Functions. An actual argument can be of any value type if no explicit type is given in the table. The pseudotype any denotes values of any type.
As a shorthand we sometimes use the notation
to indicate that argname can be of type1 or type2. (See See Functions to Retrieve Web Pages.)
|
Boolp(x): bool |
|
|
Executes a shell command and returns the output written to standard out while the command is running. The command string may contain references to variables in lexical scope by writing $var or ${var}. The value of these referenced variables are expanded before the command is executed. |
|
|
Makes a new object by copying all the fields of the objects passed as arguments. Fields of p have precedence over fields of o (and so on). The field ordering of the resulting object is defined by enumerating the fields of o, p, and so on in that sequence. |
|
|
Prints arguments to standard error output followed by end-of-line. |
|
|
Executes a shell command and returns the exit code returned by the command. The command string may contain references to variables in lexical scope by writing $var or ${var}. The value of these referenced variables are expanded before the command is executed. |
|
|
Loads a WebL function1 implemented in Java. |
|
|
Prints arguments to standard output followed by end-of-line. |
|
|
Reads a line from standard input (throws away the end-of-line character). |
|
|
Returns a list of all list elements except the first element. |
|
|
Executes expression x and returns its value. In case x throws an exception, x is re-executed as many times as needed until it is successful. |
|
|
Extracts a sublist of l starting at element number from and ending at element number to (exclusive). |
|
|
Extracts a substring of starting at character number from and ending at character number to (exclusive). |
|
|
Select(s: set, f: fun): set |
Maps sets, lists, and piecesets to sets, lists, and piecesets respectively according to a membership function f. Function f must have a single argument and must return a boolean value indicating whether the actual argument is to be included in the set, list or pieceset. |
|
Suspends thread execution for the specified number of milliseconds. |
|
|
Sorts the elements of l according to the comparison function f. The function f needs to take two formal arguments and return -1, 0, or +1 if the actual arguments are less, equal, or more than each other. |
|
|
Returns the time (in milliseconds) it takes to evaluate the expression x. |
|
|
Performs the expression x and returns its value. If the evaluation takes more than the specified amount of time (in milliseconds), an exception is thrown instead. |
|
|
Truncates the real value to an integer (rounding towards zero). |
|
|
ToList(s: set): list |
Enumerates all the elements of the argument and returns a list. (See Every Statement) |
|
ToSet(s: set): set |
Enumerates all the elements of the argument and returns a set. (See Every Statement) |
|
Executes x and returns the exception object that was caught. In case no exception is thrown in x, nil is returned. In addition, the exception object contains a field trace that has extra information why the exception occurred. This information is useful for logging unexpected exception events in your WebL programs. |
|
|
Returns the type of x (nil, int, real, bool, char, string, meth, fun, set, list, object, page, piece, pieceset, tag). |