The fixes of HostFiles are in topic branch issue-#56.
For the issue and for the associated changes for every single commit see http://redmine.blackboxframework.org/issues/56.
For the list of all changes see http://redmine.blackboxframework.org/pr ... 7b8db5a5b5.
With the additional flag 'ignoreAsk' it was possible to remove one file (Script/Mod/HostFiles) in
the build engine's Script subsystem. Now there are only two adapted modules
required instead of three. The ultimate goal must of course be to get rid
of all the replicated and slightly adapted code but that's a different story.
- Josef
issue-#56 fixes in HostFiles
Re: issue-#56 fixes in HostFiles
Josef, you add the global variable ignoreAsk.
This variable is set to FALSE by default.
Shouldn't we insert a explicit set of this variable?
BEGIN
Init; UseAsk
END HostFiles.
This variable is set to FALSE by default.
Shouldn't we insert a explicit set of this variable?
BEGIN
Init; UseAsk
END HostFiles.
- Josef Templ
- Posts: 2047
- Joined: Tue Sep 17, 2013 6:50 am
Re: issue-#56 fixes in HostFiles
As far as I know global boolean variables are always initialized with FALSE.
I am not sure if there is a coding style rule regarding the initialization of global variables but I doubt that there is one.
I am pretty sure that the implicit initialization is used in many modules.
My approach was to keep it minimalistic and therefore I added the default value in the
comment where the variable is defined. If there is a general consensus that it would be better to
initialize it explicitly, I would certainly not have any problem with that.
- Josef
I am not sure if there is a coding style rule regarding the initialization of global variables but I doubt that there is one.
I am pretty sure that the implicit initialization is used in many modules.
My approach was to keep it minimalistic and therefore I added the default value in the
comment where the variable is defined. If there is a general consensus that it would be better to
initialize it explicitly, I would certainly not have any problem with that.
- Josef
-
- Posts: 1700
- Joined: Tue Sep 17, 2013 12:21 am
- Location: Russia
Re: issue-#56 fixes in HostFiles
Better to initialize it explicitly.
- Josef Templ
- Posts: 2047
- Joined: Tue Sep 17, 2013 6:50 am
Re: issue-#56 fixes in HostFiles
I have added explicit initialization.
- Josef
- Josef
Re: issue-#56 fixes in HostFiles
The Language report says (Section 11)
Personally I don't like these unnecessary initialisations. They take extra code and run-time. While I realise that this is not usually an actual problem, it offends my aesthetic sense of efficiency.
I had a dispute with the Gardens Point people (person!) because their compiler used to insist on some unnecessary initialisations. This was a real problem for me as it meant that I could not simply copy some perfectly legal & safe Modules to dot net, and had to maintain two versions. (They changed their compiler.)
so I think there is NO ambiguity about not explicitly setting them in the code.Variables declared in a module are cleared prior to the execution of the module body
Personally I don't like these unnecessary initialisations. They take extra code and run-time. While I realise that this is not usually an actual problem, it offends my aesthetic sense of efficiency.
I had a dispute with the Gardens Point people (person!) because their compiler used to insist on some unnecessary initialisations. This was a real problem for me as it meant that I could not simply copy some perfectly legal & safe Modules to dot net, and had to maintain two versions. (They changed their compiler.)
- DGDanforth
- Posts: 1061
- Joined: Tue Sep 17, 2013 1:16 am
- Location: Palo Alto, California, USA
- Contact:
Re: issue-#56 fixes in HostFiles
Perhaps a language change similar to C initialization should be considered.
If one writes
then no initialization is performed. But if one writes (new)
then the variable is implicitly declared as REAL and initialized to the value 1.0.
Just a thought,
-Doug
If one writes
Code: Select all
VAR x: REAL;
Code: Select all
VAR x:= 1.0;
Just a thought,
-Doug