History of DNM Script
From kwiki
Contents |
[edit]
Introduction
List of changes in DNM Script.
[edit]
v. 1.0 December 2006
First version of DNM Script, at this time implemented only in Ac Browser Plus. This first release had a problem with evaluation of operators in a correct order, hence the name - (I) Don't Know Math. Here's an original description (note that this isn't true anymore):
DNM Script is a simple procedural scripting language, in an early development phase, designed as the scripting solution for Ac Browser Plus and Total Organizer applications.
Unique evaluation order of expressions
The problem
DNM is an abbreviation for "(I) Don't Know Math". Well, DNM actually can calculate things, it only evaluates expressions in a quite unique way. It usually calculates from left to right, or vice-versa, depending upon mood. And sometimes from middle, to the left, and then to the right. You never know. This is not a bug, this is a feature! :)
For example, most people (and compilers) know, that 2+2*3 is 8, because first we multiply 2 and 3 and then add 2.
This is not true for DNM Script - in this case, it will be 12. It will first (probably) add 2 and 2 and then finally will multiply the result by 3.
The solution
Use parentheses. In our example that would be 2+(2*3), and now even DNM Script will say it's 8
This problem occurs when using any expression with mixed operators. For example, after executing the following code:
if(4>3+5) MessageBox("yes, 4 is greater that 8");
DNM Script will lie, that "yes, 4 is greater that 8", because it will first evaluate "4>3" which gives TRUE, and then '5' will be added to 'TRUE' which in turn gives TRUE+5 (=6). The solution: again, using parentheses, in this example that would be:
if(4>(3+5)) MessageBox("yes, 4 is greater that 8");
Once again - the above information isn't true anymore
[edit]
v. 1.1 March 28, 2007
The evalution order of operators is now OK.
[edit]
v. 1.2 April 09, 2007
A few minor changes.
[edit]
v. 1.3 December 05, 2007
Lots of new functions: WinIsVisible, WinShow etc, More math functions
