Integrated Application Platform › Forums › Announcements › New 110705 Version
- This topic has 6 replies, 2 voices, and was last updated 11 years, 11 months ago by
amckinlay.
-
AuthorPosts
-
July 5, 2011 at 10:06 pm #706
amckinlay
Keymasterexe changes:
* ability to use negative subscripts (end relative) on strings e.g. str[-1] is the last character
* range subscripts on strings and objects – see the help under Language > Expressions > Subscript
* added the ability to call methods in query expressions e.g. tables where tablename.Lower() is ‘mytable’
* fixed associativity bug in query expressions (thanks to gmauro for reporting this)
stdlib changes:
* new Mockito style Mock object (see the help under Language > Reference > Mock and Assert)
* tweak to reduce flickering when adding/removing controls dynamically (thanks to emilevanpassel for this one)
* number.Kb() and number.Mb(), object.Count(value) and object.CountIf(block)
plus the usual small fixes and additions
Enjoy!
July 7, 2011 at 2:45 pm #872gmauro
ParticipantHi Andrew, thank you very much for the snapshot, but unfortunately your new exe breaks too many things in my application code.
For example:
with the old suneido.exe (build Oct 21 2007) I could do:
if a is true { return }
but with the new exe it generates an error unless I do:
if (a is true) { return }
and this is very strange, because in the Suneido syntax, the parenthesis should not be mandatory in the expression of the ‘if’ statement.
Another annoyance is the new switch/case behaviour. Let’s suppose that ‘x = 4’. Before, I could do:
switch(x)
{
case 1:
case 2:
case 3:
}but now it generates an exception unless I add a default:
switch(x)
{
case 1:
case 2:
case 3:
default:
}Maybe this is the correct behaviour for a switch/case statement, but it’s very sad when a new language version breaks old code… For now I stick to the 2007 exe.
July 7, 2011 at 3:26 pm #873amckinlay
KeymasterThe switch change was deliberate. It is to help with forgetting to handle some cases. It does require going through your code and determining if you want to ignore unhandled values. I think this is good because it is better to be explicit. In many situations it should be an error. But if this is a problem for people then we could add a command line option to disable this new behavior.
I’m not sure what changed with the parenthesis. A lot has changed since 2007. I will look into this. It may be related to allowing things like 10.Times { … } without the parenthesis. (probably not very important)
If you really want to stick to the 2007 version I don’t think it would be hard to apply the query fix to the old source code. But there have been many other bug fixes as well.
I agree that changes that break old code are sad. But sometimes they are necessary to move forward.
July 7, 2011 at 5:28 pm #874gmauro
ParticipantYes I agree that changes sometimes are necessary and I appreciate all the efforts you make in Suneido development. But for now I have to make sure that my application is stable enough.
I think You are right: a command line option to disable the things that could break old code would be very useful to help the migration.
The new switch/behaviour breaks too many things in my application…
P.S.: the parenthesis thing breaks many things too, being that I rarely use them in the expressions of the “if” statement…July 11, 2011 at 3:47 pm #875amckinlay
KeymasterOur style is to always put the statement part of an “if” on a separate line, so we did not notice this one – sorry. I’ll try to find what changed this and see what I can do.
And I’ll look at adding some kind of option for the switch change.
July 11, 2011 at 5:19 pm #876amckinlay
KeymasterI posted a question in the Internals section about the best way to specify compiler options.
I notice that msaurer modified the Suneido C++ code to disable the switch change.
July 11, 2011 at 6:31 pm #877amckinlay
KeymasterI think I have a fix for the if statement issue.
I will post a new version after I do something with switch
-
AuthorPosts
- The forum ‘Announcements’ is closed to new topics and replies.