Blatte::Builtins - Blatte-callable intrinsics
package MyPackage; use Blatte::Builtins; eval(...compiled Blatte program...);
This module defines the standard Blatte-callable intrinsic functions.
A Blatte intrinsic is simply a Perl subroutine that (a) has been assigned (by reference) to a scalar variable (whose name begins with a letter), and (b) takes a hash reference as its first argument, in which named parameter values are passed.
Calls Perl function FUNCNAME with given arguments in array context. See also \scall.
Adds the given numbers.
Calls the METHNAME method (i.e., member function) on the Perl object OBJ (a blessed reference) with given arguments in array context. See also \smeth.
Given one or more lists, combines their top-level elements into a single list.
Calls Blatte function FN on given arguments. If ARGn is a list, then it's interpreted as a list of arguments. (Use \funcall if you don't want this behavior.)
Any named parameters passed to \apply are passed along to FN.
Returns the Nth element of LIST. LIST is a Blatte list (which is really a Perl ARRAY reference). N is 0-based.
Sets the Nth element of LIST to VAL.
Concatenates the given strings.
True iff VAL is a defined value (in the Perl sense).
Divides its arguments. If there's only one, returns its multiplicative inverse.
Renders each OBJ as a string and concatenates them.
Returns a list resulting from calling FN on each member of LIST.
Calls Blatte function FN on the given arguments.
Deletes from HASH the entry with the given key. HASH is a Blatte hash (which is a Perl hash references).
Returns the keys of HASH, a Blatte hash, in a Blatte list.
True iff OBJ is a Blatte hash.
Returns the element of HASH whose key is KEY.
Sets the entry in HASH with key KEY to the given value.
True iff HASH contains an element with the given key.
Returns the integer portion of NUM.
Converts all letters in STR to lowercase.
Converts the first letter of STR to lowercase.
Returns of length of OBJ -- in elements, if OBJ is a list, or in characters, if OBJ is a string.
Makes a Blatte list out of the given arguments.
True iff OBJ is a Blatte list.
True if STR contains a match for the Perl regular expression REGEX. The optional flag letters correspond to Perl's regular expression flags. If REGEX includes parenthesized subexpressions, the return value is a list of the matched strings, otherwise it's the list {1}.
Blatte implements this by performing a Perl regex match in array context. This means you can't use the g flag in scalar mode, which is a bit of a drag.
g
Returns the numerically largest argument.
Returns the numerically smallest argument.
Makes a new Blatte hash (a Perl HASH reference), initializing it with the optional key-value pairs.
Multiplies its arguments.
Negates the truth value of VAL.
True iff all arguments are numerically equal.
True iff N1 >= N2 >= ... (monotonically non-increasing).
True if N1 > N2 > ... (monotonically decreasing).
True if N1 <= N2 <= ... (monotonically non-decreasing).
True if N1 < N2 < ... (monotonically increasing).
Removes the last element from LIST and return it.
Adds the given OBJs to the end of LIST.
Returns a random integer from 0 to N-1. If N is omitted, returns a random floating-point number in [0, 1).
Does a Perl require.
require
Calls Perl function FUNCNAME with given arguments in scalar context. See also \acall.
Removes the first element of LIST and returns it.
Calls the METHNAME method (i.e., member function) on the Perl object OBJ (a blessed reference) with given arguments in scalar context. See also \ameth.
Calls Perl's split function, splitting STR at occurrences of REGEX into a Blatte list, which is returned. If optional LIMIT is supplied, the result will have no more than that many elements. The optional \flags argument is the same as in \match.
split
Constructs a string out of the given sprintf format and arguments.
sprintf
True if S1, S2, etc. are identical strings.
True iff S1 ge S2 ge ...
True iff S1 gt S2 gt ...
True iff S1 le S2 le ...
True iff S1 lt S2 lt ...
Extracts a sublist from LIST beginning at START, LEN elements long.
If START is negative, counts backward from the end of LIST.
If LEN is omitted, all elements to the end of LIST are included.
Replaces matches in STR for REGEX with REPLACEMENT. The optional flags, and the syntax of REGEX and REPLACEMENT, are as in Perl's s/// operator.
Unlike Perl, STR is not modified in place. Instead, the modified string is returned.
Extracts a substring from STR beginning at START, LEN characters long.
If START is negative, counts backward from the end of STR.
If LEN is omitted, all characters to the end of STR are included.
Subtracts its second and subsequent arguments from its first one. If only one argument is given, returns its additive inverse.
Converts all letters in STR to uppercase.
Converts the first letter in STR to uppercase.
Adds the given OBJs to the beginning of LIST.
Does a Perl use.
use
Bob Glickstein <bobg@zanshin.com>.
Visit the Blatte website, <http://www.blatte.org/>.
Copyright 2001 Bob Glickstein. All rights reserved.
Blatte is distributed under the terms of the GNU General Public License, version 2. See the file LICENSE that accompanies the Blatte distribution.
Blatte(3).
To install Blatte, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Blatte
CPAN shell
perl -MCPAN -e shell install Blatte
For more information on module installation, please visit the detailed CPAN module installation guide.