4.11.12 Name Clashes

A name clash can arise if:

  1. a module tries to import a predicate from some other module m1 and it has already imported a predicate with the same name and arity from a module m2;
  2. a module tries to import a predicate from some other module m1 and it already contains a definition of a predicate with the same name and arity; or
  3. a module tries to define a predicate with the same name and arity as one that it has imported.

Whenever a name clash arises, a message is displayed beginning with the words ‘NAME CLASH’. The user is asked to choose from one of several options; for example,

     NAME CLASH: f/3 is already imported into module user
                 from module m1;
                 do you want to override this definition with
                 the one in m2? (y,n,p,s,a or ?)

The meanings of the four recognized replies are as follows:


Send feedback on this subject.