If you put in a bag a number seven
7, a number two
2, a plus sign
+, and a number three
3, a human mind would instantly know what can be done with these. We have an operator, three operands... we can sum the numbers, and get
Computers don't like bags. A typical programming language needs a particular syntax. For example
(+ 7 2 3), or
+(7, 2, 3), or
7 + 2 + 3. If you don't follow the syntax, you get a syntax error.
Let's do bags. Let's get rid of syntax.
It's quite easy to do if you're sure you have only one operator, and the right operands. But if we put a string in our first bag, how do we add numbers and strings? And if we put a second operator, for example
*, should we sum numbers or multiply them? Our bag seems unusable in these situations.
To solve the several operators issue, we need ordering.
Imagine we have 50 possible functions. If we order them, we can choose what to do when there are several functions in a bag. Our 50 functions list looks like:
If there are several functions in a bag, the highest rank function is selected. Problem solved.
Now what if we put strings in a bag that's about to multiply things. Well we can just ignore them. Problem solved.
What good are bags anyway?
They're good at connecting things without relying on a pre-existing infrastructure.