Skip to content
cl4cnam edited this page Dec 7, 2023 · 2 revisions

Which types?

Types of FuncSug are just types of JavaScript.

How to create value of a specific type?

You can create number, boolean and string in FuncSug directly with almost the same syntax as in JavaScript. The other types can be obtained by js constructs.

Multi-values

All values that you can see in FuncSug are in fact "multi-values". For example, if you have 5, it's in reality |5| a multi-value with a single value 5. When a multi-value consists only in a single value, there is no difference with the simple value. You can even evaluate |5| = 5, and you'll get "true".

A multi-value can also consist in several values or even in zero value. | | is a multi-value with no value! It acts as an absorbing element (as in mathematics). Most of the time, you'll use mono-value multi-values! Most functions do Cartesian product of their arguments. For example, |1,2|+|30,40| gives |31,41,32,42|. But some functions don't: for example, par(|1,2,3|, |30,40|) gives |1,2,3,30,40|. This system exists (for example) in another programming language popr (by Dusty DeWeese).

You can test multi-values in FuncSug REPL.