There are some things in the formula editor which would come in handy that I would like to see.

For loops.
From the C++ documentation ( https://cplusplus.com/doc/tutorial/control/ ) :

The for loop is designed to iterate a number of times. Its syntax is:
for (initialization; condition; increase) statement;
Like the while-loop, this loop repeats statement while condition is true. But, in addition, the for loop provides specific locations to contain an
initialization and an increase expression, executed before the loop begins the first time, and after each iteration, respectively. Therefore, it is especially useful to use counter variables as condition.
It works in the following way:

  1. initialization is executed. Generally, this declares a counter variable, and sets it to some initial value. This is executed a single time, at the beginning of the loop.
  2. condition is checked. If it is true, the loop continues; otherwise, the loop ends, and statement is skipped, going directly to step 5.
  3. statement is executed. As usual, it can be either a single statement or a block enclosed in curly braces {}.
  4. increase is executed, and the loop goes back to step 2.
  5. the loop ends: execution continues by the next statement after it.

Boolean operators are already in Ultra Fractal, but I think there is one that is not in Ultra Fractal: the exclusive or operator, the XOR operator. Speaking of the devil, bitwise operators are probably going to help too:
&, AND, bitwise AND
|, OR, bitwise inclusive OR
^, XOR, bitwise exclusive OR
~, NOT, unary complement, or bit inversion
<<, SHL, shift bits left
>>, SHR, shift bits right

Then, what about function templates? Why not have them the same syntax as in C++, or maybe as something different and more simplified? This is because overloaded functions may have the same definition (I am not sure if operator overloading is a thing in Ultra Fractal).

The do-while loop, which would be preferred over a while-loop.

Data structures would also be of use in the formula editor, because we can group data elements together under a single name. These elements are known as members, and they can have different types and different lengths.

What else are we missing? Compound assignments, of course! (+=, -=, *=, /=, %=, >>=, <<= &=, ^=, |=)
They modify the current value of a variable by performing an operation on it. In fact, it is the same as assigning the result of an operation to the first operand:
y += x is equivalent to y = y + x, for example.

Increment and decrement operators (++ and --) would shorten our expressions even more: ++x is equivalent to x+=1 and x = x + 1.
More info here: https://cplusplus.com/doc/tutorial/operators/

Conditional ternary operators ( ? ) would also be considered.

An explicit type casting operator would help in coloring algorithms in the final section of the algorithm, in the #index assignment predefined symbol. But it could do more than that: it would explicitly convert a value of a given type to another type.

This is just what I am suggesting to improve the formula editor.

There are some things in the formula editor which would come in handy that I would like to see. For loops. From the C++ documentation ( https://cplusplus.com/doc/tutorial/control/ ) : &gt; The for loop is designed to iterate a number of times. Its syntax is: `for (initialization; condition; increase) statement;` Like the while-loop, this loop repeats `statement` while `condition` is true. But, in addition, the for loop provides specific locations to contain an `initialization` and an `increase` expression, executed before the loop begins the first time, and after each iteration, respectively. Therefore, it is especially useful to use counter variables as `condition`. It works in the following way: 1. `initialization` is executed. Generally, this declares a counter variable, and sets it to some initial value. This is executed a single time, at the beginning of the loop. 2. `condition` is checked. If it is true, the loop continues; otherwise, the loop ends, and `statement` is skipped, going directly to step 5. 3. `statement` is executed. As usual, it can be either a single statement or a block enclosed in curly braces {}. 4. `increase` is executed, and the loop goes back to step 2. 5. the loop ends: execution continues by the next statement after it. Boolean operators are already in Ultra Fractal, but I think there is one that is not in Ultra Fractal: the exclusive or operator, the XOR operator. Speaking of the devil, bitwise operators are probably going to help too: &amp;, AND, bitwise AND |, OR, bitwise inclusive OR ^, XOR, bitwise exclusive OR ~, NOT, unary complement, or bit inversion `&lt;&lt;`, SHL, shift bits left `&gt;&gt;`, SHR, shift bits right Then, what about function templates? Why not have them the same syntax as in C++, or maybe as something different and more simplified? This is because overloaded functions may have the same definition (I am not sure if operator overloading is a thing in Ultra Fractal). The do-while loop, which would be preferred over a while-loop. Data structures would also be of use in the formula editor, because we can group data elements together under a single name. These elements are known as members, and they can have different types and different lengths. What else are we missing? Compound assignments, of course! (+=, -=, *=, /=, %=, &gt;&gt;=, &lt;&lt;= &amp;=, ^=, |=) They modify the current value of a variable by performing an operation on it. In fact, it is the same as assigning the result of an operation to the first operand: `y += x` is equivalent to `y = y + x`, for example. Increment and decrement operators (++ and --) would shorten our expressions even more: `++x` is equivalent to `x+=1` and `x = x + 1`. More info here: https://cplusplus.com/doc/tutorial/operators/ Conditional ternary operators ( ? ) would also be considered. An explicit type casting operator would help in coloring algorithms in the final section of the algorithm, in the #index assignment predefined symbol. But it could do more than that: it would explicitly convert a value of a given type to another type. This is just what I am suggesting to improve the formula editor.
edited Jul 19 at 9:19 pm
 
0
reply

for loops, if implemented, will probably look more like Pascal/Delphi style, just like many other structures.

The boolean 'exclusive or' is just !=.

Function templates, for those who don't know, are 'wildcards' for function argument/return types, so you can write one function and it will act like many functions with identical content but different parameter types. This is already possible using classes but not with primitives:

template<T> static T func Max(const T px, const T py) ;T can be int, float (maybe bool too?)
  if px >= py, return px, else, return py, endif
endfunc
template<T> static T func Sqr(const T x) ;T can be int, float, complex
  return sqr(x)
endfunc
template<T> static T func Double(const T x) ;T can be int, float, complex, color
  return x*2
endfunc

do-while is implemented using repeat-until.

Data structures are implemented using class (just make one without method members).

Explicit type casting goes like: (int)someFloat. What other casting are you referring to? (examples plz).

I'm in favor of about all the other suggestions, as I also thought about those.

`for` loops, if implemented, will probably look more like Pascal/Delphi style, just like many other structures. The boolean &#039;exclusive or&#039; is just `!=`. Function templates, for those who don&#039;t know, are &#039;wildcards&#039; for function argument/return types, so you can write one function and it will act like many functions with identical content but different parameter types. This is already possible using classes but not with primitives: ```` template&lt;T&gt; static T func Max(const T px, const T py) ;T can be int, float (maybe bool too?) if px &gt;= py, return px, else, return py, endif endfunc template&lt;T&gt; static T func Sqr(const T x) ;T can be int, float, complex return sqr(x) endfunc template&lt;T&gt; static T func Double(const T x) ;T can be int, float, complex, color return x*2 endfunc ```` `do-while` is implemented using `repeat-until`. Data structures are implemented using `class` (just make one without method members). Explicit type casting goes like: `(int)someFloat`. What other casting are you referring to? (examples plz). I&#039;m in favor of about all the other suggestions, as I also thought about those.
edited Jul 22 at 7:12 am
 
0
reply

Say for example you need to convert a complex value to a float when needed. You'd just have to drop the imaginary component of the complex number.

What if there wasn't just int, float, complex and bool? Well, the IEEE 754-2019 standard can help us with that, see here: https://dlmf.nist.gov/3.1#i

Anyone can come up with a floating-point number class of any precision in a plug-in library.

Say for example you need to convert a complex value to a float when needed. You&#039;d just have to drop the imaginary component of the complex number. What if there wasn&#039;t just `int`, `float`, `complex` and `bool`? Well, the IEEE 754-2019 standard can help us with that, see here: https://dlmf.nist.gov/3.1#i Anyone can come up with a floating-point number class of any precision in a plug-in library.
 
0
reply

Furthermore, we can create infinitesimals, hyperreal numbers, split-complex numbers, bicomplex numbers, hypercomplex numbers and quaternions as classes of their own. Simple as that! And automatic differentiation could also help.

Furthermore, we can create infinitesimals, hyperreal numbers, split-complex numbers, bicomplex numbers, hypercomplex numbers and quaternions as classes of their own. Simple as that! And automatic differentiation could also help.
 
0
reply
91
views
3
replies
2
followers
live preview
Enter at least 10 characters.
WARNING: You mentioned %MENTIONS%, but they cannot see this message and will not be notified
Saving...
Saved
All posts under this topic will be deleted ?
Pending draft ... Click to resume editing
Discard draft