Predefined functions are functions, which are encoded into the source code of the Interpreter. Such functions can be used in any program since they do not need to get implemented by the developer.
sin
Returns the sine value of a specified position.
cos
Returns the cosine value of a specified position.
tan
Returns the tangency value of a specified position.
sqrt
Returns the square root of the specified number.
length
Returns the length of the specified string.
substr
Returns a substring.
charAt
Returns the character at the specified position of the string.
isNumber
Returns, wether the specified input represents a number.
This function returns the sine value of the specified position x. If an incorret argument is passed (e.g. a String), the value 0.00 is returned.
x
Represents the x-position of which the sine value should be dertermined.
Sine value of the specified position.
(defun main () (
(princ sin(1.2))
))
This function returns the cosine value of the specified position x. If an incorrect argument is passed (e.g. a String), the value 0.00 is returned.
x
Represents the x-position of which the cosine value should be determined.
Cosine value of the specified position.
(defun main () (
(princ cos(0.5))
))
This function returns the tangency value of the specified position x. If an incorrect argument os passed (e.g. a String), the value 0.00 is returned.
x
Represents the x-position of which the tangency value should be determined.
Tangency value of the specified position.
(defun main () (
(princ tan(1))
))
This function returns the square root of the passed value. If an incorrect argument is passed (e.g. a String), the value 0.00 is returned.
radical
Represents the value, whoose square root should be determined.
The square root of the passed radical.
(defun main () (
(princ sqrt(25))
))
This function returns the length (in characters) of the passed String. This works as well with numbers or Booleans.
string
Represents the string which length should be determined.
The length of the passed String.
(defun main () (
(princ length("Hello World"))
))
Returns the substring between two indices of a passed String. If incorrect indices (e.g. to small or large) are passed, the entire String is returned.
string
String, from which the substring should be created.
begin
Index of the first character to be part of the substring.
end
Index of the last character to be part of the substring.
The String's substring of between the two indices.
(defun main () (
(princ substr("Hello World" 2 7))
; ^^^^^^^ <- These are part of the substring.
))
This function returns the character at the specified position of the specified String.
string
String, in which the character should be determined.
pos
Position, at which the the character should be determined.
Character at the specified position in the specified String.
(defun main () (
(princ charAt("Hello World" 3))
; ^ <- This is the returned character.
))
This function returns, wether the passed argument resembles a number.
input
Argument, that should be checked.
Wether the passed argument resembles a String or not.
(defun main () (
(if (= isNumber("4.56") T) (
(princ "4.56 is a number.")
))
))