API naming design

The API is designed to be easy to use and consistent. Ease of use is measured by the number of calls to achieve a concrete high-level action.

Naming scheme

The library uses a simple naming scheme that makes use of common abbreviations to keep the names short but meaningful. Since version 0.8.2 many symbols have been renamed to fit this scheme. The ultimate goal is that the programmer can guess a name.

English wordTo useNotes
initializeinitT init is used to create a value type T
newnewP new is used to create a reference type P
findfindshould return the position where something was found; for a bool result use contains
containscontainsoften short for find() >= 0
appendadduse add instead of append
comparecmpshould return an int with the < 0 == 0 or > 0 semantics; for a bool result use sameXYZ
putput, []=consider overloading []= for put
getget, []consider overloading [] for get; consider to not use get as a prefix: len instead of getLen
lengthlenalso used for number of elements
sizesize, lensize should refer to a byte size
capacitycap
memorymemimplies a low-level operation
itemsitemsdefault iterator over a collection
pairspairsiterator over (key, value) pairs
deletedelete, deldel is supposed to be faster than delete, because it does not keep the order; delete keeps the order
removedelete, delinconsistent right now
remove-and-returnpopTable/TableRef alias to take
includeincl
excludeexcl
commandcmd
executeexec
environmentenv
variablevar
valuevalue, val val is preferred, inconsistent right now
executableexe
directorydir
pathpathpath is the string "/usr/bin" (for example), dir is the content of "/usr/bin"; inconsistent right now
extensionext
separatorsep
columncol, column col is preferred, inconsistent right now
applicationapp
configurationcfg
messagemsg
argumentarg
objectobj
parameterparam
operatoropr
procedureproc
functionfunc
coordinatecoord
rectanglerect
pointpoint
symbolsym
literallit
stringstr
identifierident
indentationindent