issue-#56 fixes in HostFiles

Post Reply
User avatar
Josef Templ
Posts: 2047
Joined: Tue Sep 17, 2013 6:50 am

issue-#56 fixes in HostFiles

Post 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
Zinn
Posts: 476
Joined: Tue Mar 25, 2014 5:56 pm
Location: Frankfurt am Main
Contact:

Re: issue-#56 fixes in HostFiles

Post 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.
User avatar
Josef Templ
Posts: 2047
Joined: Tue Sep 17, 2013 6:50 am

Re: issue-#56 fixes in HostFiles

Post 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
Ivan Denisov
Posts: 1700
Joined: Tue Sep 17, 2013 12:21 am
Location: Russia

Re: issue-#56 fixes in HostFiles

Post by Ivan Denisov »

Better to initialize it explicitly.
User avatar
Josef Templ
Posts: 2047
Joined: Tue Sep 17, 2013 6:50 am

Re: issue-#56 fixes in HostFiles

Post by Josef Templ »

I have added explicit initialization.

- Josef
User avatar
Robert
Posts: 1024
Joined: Sat Sep 28, 2013 11:04 am
Location: Edinburgh, Scotland

Re: issue-#56 fixes in HostFiles

Post 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.)
User avatar
DGDanforth
Posts: 1061
Joined: Tue Sep 17, 2013 1:16 am
Location: Palo Alto, California, USA
Contact:

Re: issue-#56 fixes in HostFiles

Post by DGDanforth »

Perhaps a language change similar to C initialization should be considered.
If one writes

Code: Select all

VAR x: REAL;
then no initialization is performed. But if one writes (new)

Code: Select all

VAR x:= 1.0;
then the variable is implicitly declared as REAL and initialized to the value 1.0.

Just a thought,
-Doug
Post Reply