This is an old revision of the document!
The following table summarizes the intrinsic data types in 4rpl and how they are coerced. To read the table, look at a datatype in the left column. To see how a variable of that data type is coerced, look across it's row to the column it is being coerced to. For instance, if you treat a string as an int, the “Parse to int” operation will be performed on the int. If you treat a list as a string (say, you trace a list), the list will be turned into comma separate strings (suitable for human eyeball consumption).
int | float | string | list | table | |
---|---|---|---|---|---|
int | int | float | ToString | Empty List | Empty Table |
float | int | float | ToString | Empty List | Empty Table |
string | Parse To int | Parse To Float | string | Empty List | Empty Table |
list | List Length | List Length | Comma Separated | list | Table from list* |
table | Table Length | Table Length | Comma Separated | Table Keys as List | table |
vector | Vector Length | Vector Length | Comma Separated | List of x,y,z,w | Table of x,y,z,w* |
*A 'Table from list' is constructed by taking each item in a list and adding it to a table where the item's string representation becomes the key and the item becomes the value.
*A 'Table of x,y,z,w' is constructed by taking each value in a vector and adding it to a table where the keys are “0”,“1”,“2”,“3”.
Values can be compared using the eq,neq,lt,lte,gt,gte operators. All of these commands take two values and compare them. The following table summarizes the type of comparison that is done based on the types of the two values being compared. A 'float comparison', means that both types are coerced as floats, etc.