NAME
std/path/z/functions - Function definitions for ZPath.
IMPLEMENTATION SUPPORT
This module is supported by all implementations of ZuzuScript.
DESCRIPTION
This module defines the function objects and standard function table used by std/path/z.
EXPORTS
Classes
Func({ spelling: String, f: Function })Constructs a ZPath function definition. Returns:
Func.func.has_name(n)Parameters:
nis a function name. Returns:Boolean. Returns true whennmatches the function spelling.
Functions
replace(haystack, needle, replacement)Parameters:
haystackis source text,needleis a pattern, andreplacementis replacement text. Returns:String. Performs ZPath replacement with capture substitutions.mk_single_number_function(String name, Function impl)Parameters:
nameis a ZPath function name andimplmaps one number. Returns:Function. Builds a function wrapper for per-node numeric functions.mk_aggregate_number_function(String name, Function impl)Parameters:
nameis a ZPath function name andimplmaps an array of numbers. Returns:Function. Builds a function wrapper for aggregate numeric functions.mk_single_string_function(String name, Function impl)Parameters:
nameis a ZPath function name andimplmaps one string. Returns:Function. Builds a function wrapper for per-node string functions.mk_match_function()Parameters: none. Returns:
Function. Builds the standard ZPathmatchfunction implementation.
Constants
STANDARD_FUNCTIONSType:
Array. Standard ZPath function definitions.
COPYRIGHT AND LICENCE
std/path/z/functions is copyright Toby Inkster.
It is free software; you may redistribute it and/or modify it under the terms of either the Artistic License 1.0 or the GNU General Public License version 2.