-
Notifications
You must be signed in to change notification settings - Fork 0
Concept
In SSS, there are only 3 types of values :
- number (float only)
- real set
- descriptions set
Number is the most basic data, it's just a floating point number.
Real set can contain anything, but they will never repeat. [1, [2], [$==0]] contains a number, another set, and a description set. [1, 1] however would parse as [1].
Declare it by wrapping up something in square brackets [].
Description set is the most outlandish of the three, it simply contains a statement that can evaluate into boolean, this describes what elements are inside, without actually creating any data.
For example, [$>5] is a set that contains everything greater than 5.
If we get an intersection of this and a real set [3, 4, 5, 6, 7, 8], we will get [6, 7, 8].
If it's with another description set though, [$>5] & [$<=10], we get a description set that contains everything that fits both descriptions.
You might've noticed, this is actually a real set [6, 7, 8, 9, 10], but it actually doesn't realize. I can't check if something can realize, without actually trying to realize it.
You can declare it in two ways, wrap up a statement in square brackets, and the first identifier will be the nickname for the items inside [nickname ...].
If the first token of the statement isn't an identifier, use [nickname : ...]. Then you can use the nickname in the statement later.
In SSS, there are two kinds of ways to modify data:
- operator
- function
All of them are static, they never change the input.
Operators are something like & intersection, | union, has right hand value is a element in the left hand value, etc.
Put them between two values like [$>5] & [$<=10] from earlier, except for unary (- and !), they go before the operand.
Functions have names and are called by value -> func, they can be configured by added parenthesis like mySet -> mod(2).
They always execute left to right, so you can chain them like mySet -> offset(1) -> mod(2). (this is add 1 to all elements in mySet and then turn all elements into their mod 2)