next up previous contents
Next: Space and Comments Up: Prolog Preliminaries Previous: Prolog Preliminaries   Contents

Terms

A Prolog constant is composed of either a sequence of characters and/or under-scores, beginning with a lower case letter, a number, or any sequence of symbols surrounded by apostrophes. So, abc, johnDoe, b_17, 123, 'JohnDoe', '65$', and '_65a.' are constants, but A19, JohnDoe, B_112, _au8, and [dd,e] are not (although see the warning at the end of this section). A variable, on the other hand, is any string of letters, underscores or numbers beginning with a capital letter. Thus C, C_foo, and TR5ab are variables, but 1Xa, aXX, and _Xy3.1are not.

In general, it is a bad idea to have constants or variables which are only distinguished by the capitalization of some of their letters. For instance, while aBa and aba are different constants, they should not both be used in one program. One reason for this in the context of ALE is that the output routines adopt standard capitalization conventions which hide the differences between such constants.

Warning: As pointed out to us by Ingo Schroeder, constants or atoms beginning with a capital letter are not treated properly by the compiler. Thus constants such as 'Foo' should not be used.


next up previous contents
Next: Space and Comments Up: Prolog Preliminaries Previous: Prolog Preliminaries   Contents
TRALE User's Manual