Previous Next

Sorting out the order of statements in the source file

Everything in GRAIL must be defined before it is used. This is one of its strengths and one of its weaknesses, but it often makes modifying files a bit painful.

Find the first point in the file where you have first used RoadVehicle or RailVehicle (after their introduction). It should be the statement

RoadVehicle sensibly hasOwner Person.

The new definitions must go before this point.

Since the new definitions are replacing some of the things which were in the original asserted hierarchy, it is good practice to place them immediately after the asserted hierarchy. This is what we have done in the example.

However, this still leaves a problem, because the definition of DomainAttribute is further down the file. Move the statement defining DomainAttribute up until it comes after the asserted hierarchy and before the new section you have just added.

(Good style organises source files in a sensible order so this happens as rarely as possible. More about this in later volumes. But for the tutorial, this is sufficient.)

Previous Next
Making the impossible very difficult, ©OpenGALEN.org, All rights reserved