Intrinsic Functions - craterdog-archives/js-bali-virtual-machine GitHub Wiki

Contents

$addItem($collection, $item)

This function attempts to add the specified item to the specified collection. It returns the updated collection.

$ancestry($component)

This function returns a list of names for the types that the specified component has in its ancestry.

$and($first, $second)

This function returns the logical conjunction (AND) of the specified logical components. The logical components must be of the same type.

$arccosine($ratio)

This function returns the angle that is the inverse cosine of the specified ratio of sides of a triangle.

$arcsine($ratio)

This function returns the angle that is the inverse sine of the specified ratio of sides of a triangle.

$arctangent($opposite, $adjacent)

This function returns the angle that is the inverse tangent of the ratio of the specified sides of a triangle.

$areEqual($first, $second)

This function determines whether or not the specified components are equal to each other.

$areSame($first, $second)

This function determines whether or not the specified components are actually the same component.

$association($key, $value)

This function returns a new association between the specified key and value.

$attribute($composite, $key)

This function returns the attribute value associated with the specified key from the specified composite component.

$authority($resource)

This function returns as text the authority part of the specified resource.

$base02($binary, [$indentation])

This function returns as text a base 2 encoding of the specified binary string prepending the specified indentation to each line.

$base16($binary, [$indentation])

This function returns as text a base 16 encoding of the specified binary string prepending the specified indentation to each line.

$base32($binary, [$indentation])

This function returns as text a base 32 encoding of the specified binary string prepending the specified indentation to each line.

$base64($binary, [$indentation])

This function returns as text a base 64 encoding of the specified binary string prepending the specified indentation to each line.

$binary($size, [$parameters])

This function returns a new binary string composed of the specified number of random bytes and parameterized using the specified parameters.

$bytes($tag)

This function returns a binary string containing the bytes that make up the specified tag.

$catalog([$parameters])

This function returns a new empty catalog parameterized using the specified parameters.

$chain($first, $second)

This function returns a new chainable component that is the result of appending the second specified chainable component to the first specified chainable component. Both components must be of the same type.

$citation($document)

This function returns a citation to the specified document.

$code($procedure)

This function returns the statement tree structure that define the specified procedure.

$coinToss($weight)

This function returns the results of a random coin toss where the coin is weighted with the specified probability.

$comparator()

This function returns a canonical comparator agent that can be used to rank components in their natural order.

$complement($angle)

This function returns an angle component that is the complement of the specified angle component. The complementary angle adds to the specified angle to equal π/2.

$component($source)

This function returns the component defined by the specified source text.

$conjugate($number)

This function returns the complex conjugate of the specified complex number.

$connector($range)

This function returns the endpoint inclusion connector text string for the specified range.

$cosine($angle)

This function returns a number that is the ratio of the adjacent side to the hypotenuse of a right triangle with the specified angle component.

$day($moment)

This function returns a number representing the day part of the specified moment.

$days($duration)

This function returns the number of days in the specified duration.

$default($component, $value)

This function returns the specified component if its boolean representation is true and the specified (default) value if it is false.

$degrees($angle)

This function returns the number of degrees that is represented by the specified angle.

$difference($first, $second)

This function returns the difference between the two specified scalables. Both scalables must be of the same type.

$document($component)

This function returns a text document representation of the specified component.

$doesMatch($component, $pattern)

This function determines whether or not the specified component matches the specified pattern.

$duplicate($component)

This function returns an exact copy of the specified component.

$duration($first, $second)

This function returns the duration of time between the first specified moment and the last specified moment.

$earlier($moment, $duration)

This function returns the moment in time that is earlier than the specified moment in time by the specified duration of time.

$effective($range)

This function the effective range of integers for the specified range.

$emptyCollection($collection)

This function removes all items from the specified collection. It returns the updated collection.

$exponential($base, $exponent)

This function returns the number which is the specified base number raised to the specified exponent.

$factorial($number)

This function returns the number that is the factorial of the specified number.

$first($range)

This function returns the first number in the specified range, or none if it does not exist.

$format($moment)

This function returns the text defining the ISO 8601 standard format of the specified moment.

$fragment($resource)

This function returns as text the fragment part of the specified resource.

$hash($component)

This function returns a number in the range -2147483648..2147483647 for the specified component that is statistically spread evenly over the that range depending on the value of the component.

$hasNext($iterator)

This function determines whether or not the specified iterator has another item after the current slot.

$hasPrevious($iterator)

This function determines whether or not the specified iterator has another item before the current slot.

$head($queue)

This function returns the item that is currently at the head of the specified queue.

$hour($moment)

This function returns a number representing the hour part of the specified moment.

$hours($duration)

This function returns the number of hours in the specified duration.

$html($component, $style)

This function returns an HTML representation of the specified component using the specified style sheet for formatting.

$imaginary($number)

This function returns the imaginary part of the specified complex number.

$insertItem($list, $slot, $item)

This function inserts the specified item into the specified list in the specified slot. It returns the updated list.

$insertItems($list, $slot, $item)

This function inserts the specified sequence of items into the specified list in the specified slot. It returns the updated list.

$integer($discrete)

This function returns the value of a discrete component as an integer number.

$interfaces($component)

This function returns a list of the names of the interfaces supported by the type of the specified component.

$inverse($scalable)

This function returns the inverse of the specified scalable component.

$isEnumerable($range)

This function determines whether or not the specified ranges is an enumerable range of integers.

$isLess($first, $second)

This function determines whether or not the value of the first specified component is less than the value of the second specified component.

$isMore($first, $second)

This function determines whether or not the value of the first specified component is more than the value of the second specified component.

$isNegative($polarized)

This function determines whether or not the specified polarized component has a negative numerical value.

$isSignificant($component)

This function determines whether or not the specified component has an interesting value. Values that are not considered interesting include none, false, "", '', [ ], [:], 0, 0%, ~0, ~P0Dand probabilities that are less than .5.

$item($sequential, $index)

This function returns the item that is at the specified index in the specified sequence.

$iterator($sequential)

This function returns an iterator for the specified sequence.

$key($association)

This function returns the key for the specified association.

$keys($catalog)

This function returns the list of keys for the specified catalog.

$last($range)

This function returns the last number in the specified range, or none if it does not exist.

$later($moment, $duration)

This function returns the moment in time that is later than the specified moment in time by the specified duration of time.

$levels($version)

This function returns a list of numbers corresponding to the version levels for the specified version string.

$list([$parameters])

This function returns a new empty list parameterized using the specified parameters.

$logarithm($base, $value)

This function returns the number which is the logarithm for the specified base number of the specified number value.

$magnitude($number)

This function returns the magnitude of the specified complex number.

$matchesText($pattern, $text)

This function determines whether or not the specified pattern matches the specified text string.

$millisecond($moment)

This function returns a number representing the millisecond part of the specified moment.

$milliseconds($duration)

This function returns the number of milliseconds in the specified duration.

$minute($moment)

This function returns a number representing the minute part of the specified moment.

$minutes($duration)

This function returns the number of minutes in the specified duration.

$month($moment)

This function returns a number representing the month part of the specified moment.

$months($duration)

This function returns the number of months in the specified duration.

$nextItem($iterator)

This function returns the item following the current slot position for the specified iterator.

$nextVersion($version, [$level])

This function returns the next version string for the specified version string incremented at the specified level.

$node($type)

This function returns a new empty node component of the specified type name.

$not($logical)

This function returns the logical inverse (NOT) of the specified logical component.

$now()

This function returns the current moment in time.

$or($first, $second)

This function returns the logical disjunction (OR) of the specified logical components. The logical components must be of the same type.

$parameters($component)

This function returns the catalog of parameters associated with the specified component.

$path($resource)

This function returns as text the path part of the specified resource.

$phase($number)

This function returns the phase angle of the specified complex number.

$previousItem($iterator)

This function returns the item preceding the current slot position for the specified iterator.

$procedure($code, [$parameters])

This function returns a new procedure component containing the specified code and parameterized using the specified parameters.

$product($first, $second)

This function returns a number that is the product of the first specified number and the second specified number.

$query($resource)

This function returns as text the query part of the specified resource.

$queue([$parameters])

This function returns a new empty queue parameterized using the specified parameters.

$quotient($first, $second)

This function returns a number that is the quotient of the first specified number and the second specified number.

$radians($angle)

This function returns the number of radians that is represented by the specified angle.

$random()

This function returns a new random probability in the range from 0 (false) to 1 (true).

$range([$first], [$last], [$parameters])

This function returns a range element defined by the specified first and last numbers and parameterized by the specified parameters.

$ranking($first, $second)

This function returns the relative ranking of the specified components using a canonical comparator.

$real($numerical)

This function returns the value of a numerical component as a real number.

$reciprocal($number)

This function returns the number that is the reciprocal of the specified number.

$remainder($first, $second)

This function returns a number that is the remainder of the quotient of the first specified number and the second specified number.

$removeAttribute($catalog, $key)

This function removes from the specified catalog the value associated with the specified key. The updated catalog is returned.

$removeHead($queue)

This function removes from the specified queue the head item and returns it.

$removeIndex($list, $index)

This function removes from the specified list the item at the specified index. The removed item is returned.

$removeIndices($list, $indices)

This function removes from the specified list the items at the specified indices. The indices must be in increasing order or the results are unpredictable. A list of the removed items is returned.

$removeItem($set, $item)

This function removes from the specified set the specified item. The updated set is returned.

$removeTop($stack)

This function removes from the specified stack the top item and returns it.

$reverseItems($sortable)

This function reverses the order of the items in the specified sortable collection. The updated sortable collection is returned.

$sans($first, $second)

This function returns the logical material nonimplication (SANS) of the specified logical components. The logical components must be of the same type.

$scaled($scalable, $factor)

This function returns the specified scalable component multiplied by the specified factor.

$scheme($resource)

This function returns as text the scheme part of the specified resource.

$second($moment)

This function returns a number representing the second part of the specified moment.

$seconds($duration)

This function returns the number of seconds in the specified duration.

$set([$parameters])

This function returns a new empty set parameterized using the specified parameters.

$setAttribute($composite, $key, $value)

This function sets the specified attribute in the specified composite component to the specified value. The updated composite component is returned.

$setFirst($range, $value)

This function sets the first value of the specified range to the specified value. The updated range is returned.

$setItem($list, $index, $item)

This function sets the value at the specified index in the specified list to the specified item. The updated list is returned.

$setLast($range, $value)

This function sets the last value of the specified range to the specified value. The updated range is returned.

$setParameter($component, $key, $value)

This function sets the specified parameter in the specified component to the specified value. The updated component is returned.

$setValue($association, $value)

This function sets the value of the specified association to the specified value. The updated association is returned.

$shuffleItems($list)

This function randomly shuffles the order of the items in the specified list. The updated list is returned.

$sine($angle)

This function returns a number that is the ratio of the opposite side to the hypotenuse of a right triangle with the specified angle component.

$size($sequential)

This function returns the number of items that are in the specified sequence.

$sortItems($sortable)

This function places the items in the specified sortable collection in their natural order. The updated sortable collection is returned.

$sorter([$comparator])

This function returns a merge sorter agent that can be used to sort the items in a sortable collection using the specified comparator agent.

$source($component, [$indentation])

This function returns a text narrative representation of the specified component prepending the specified indentation to each line.

$stack([$parameters])

This function returns a new empty stack parameterized using the specified parameters.

$sum($first, $second)

This function returns the sum of the two specified scalables. Both scalables must be of the same type.

$supplement($angle)

This function returns an angle component that is the supplement of the specified angle component. The supplementary angle adds to the specified angle to equal π.

$tag([$size])

This function returns a new random tag with the specified number of bytes.

$tangent($angle)

This function returns a number that is the ratio of the opposite side to the adjacent side of a right triangle with the specified angle component.

$toEnd($iterator)

This function moves the specified iterator to the slot that is just past the last item in the sequence being iterated over.

$top($stack)

This function returns the item that is currently on top of the specified stack. The stack is not affected.

$toSlot($iterator, $slot)

This function moves the specified iterator to the specified slot in the sequence being iterated over.

$toStart($iterator)

This function moves the specified iterator to the slot that is just before the first item in the sequence being iterated over.

$value($association)

This function returns the value for the specified association.

$weeks($duration)

This function returns the number of weeks in the specified duration.

$xor($first, $second)

This function returns the logical exclusive disjunction (XOR) of the specified logical components. The logical components must be of the same type.

$year($moment)

This function returns a number representing the year part of the specified moment.

$years($duration)

This function returns the number of years in the specified duration.