Page 1 of 1
issue-#56 fixes in HostFiles
Posted: Mon Jun 01, 2015 8:22 am
by Josef Templ
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
Re: issue-#56 fixes in HostFiles
Posted: Mon Jun 08, 2015 9:49 am
by Zinn
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.
Re: issue-#56 fixes in HostFiles
Posted: Mon Jun 08, 2015 11:08 am
by Josef Templ
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
Re: issue-#56 fixes in HostFiles
Posted: Mon Jun 08, 2015 11:29 am
by Ivan Denisov
Better to initialize it explicitly.
Re: issue-#56 fixes in HostFiles
Posted: Mon Jun 08, 2015 2:51 pm
by Josef Templ
I have added explicit initialization.
- Josef
Re: issue-#56 fixes in HostFiles
Posted: Mon Jun 08, 2015 8:02 pm
by Robert
The Language report says (Section 11)
Variables declared in a module are cleared prior to the execution of the module body
so I think there is NO ambiguity about not explicitly setting them in the code.
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.)
Re: issue-#56 fixes in HostFiles
Posted: Mon Jun 15, 2015 10:22 pm
by DGDanforth
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