Order of operation or scope precedence

It would be great if there were a way to do define the scope of functions and operators given that Bubble requires a left to right function order. Here is just one example.

Example 1

If I have String1 that I want to truncate from the value in String2 and I want to truncate it based on the numeric value in Interger1 I can do the following

String1’s value:truncated to Integer1’s value

:truncated to is expecting a numeric parameter to get passed, so all is well. What I can’t do is this:

String1’s value:truncated to Integer1’s value - Integer2’s value

because as best I can tell, Bubble breaks down this like so as the expression is getting built

String1’s value - returns a STRING in either direction so anything to the immediate left or right needs to expect a STRING. Visualize it like this:

STRING<-- String1’s value --> STRING

:truncated to - expects a STRING from one side and a NUMBER from the other but returns a STRING so visualize it like this

STRING --> :truncated to <–NUMBER -->STRING

Integer1’s value looks like this NUMBER<-- Integer1’s value --> NUMBER

So all together is goes like this

(String1’s value)STRING --> :truncated to <–NUMBER(Integer1’s value) -->STRING

So when I try to do numeric operators to the right of this expression, I can’t because Bubble now looks at the entire expression and say’s “this is a string, you have to do string things to the right”. My example ends up looking like this

(String1’s value)STRING --> :truncated to <–NUMBER(Integer1’s value) -->STRING - <–NUMBER(Integer2’s value) which of course does not work.

It would be great if I could do this instead:

String1’s value:truncated to (Integer1’s value - Integer2’s value)

where the parentheses indicate an order of operation, so that (Integer1 - Integer2) would happen before the value would get passed to :truncated to

This would have value in a lot of situations. For instance, I just realized that this is the answer to a bug ticket I submitted the other day. My bug, isn’t a bug so much as an order of operations issue. My example from my bug ticket is this:

Input A’s value:truncated to Input A’s value:number of characters - 1

which doesn’t work and now I know why. It is because although :number of characters returns a number and you would think I could do a numeric operator to the right of it, Bubble is interpreting the entire expression as a text, which is needs to, but it would be great if I could say

Input A’s value:truncated to (Input A’s value:number of characters - 1)


So it turns out that this is on the road-map and I didn’t see it down in the ongoing portion. Great news!

Hi all - We recently released an experimental features UI that has a development version of parentheses. Learn more here! Hope you all have the opportunity to start playing around with it and help us iterate to make it better!