Path: utzoo!attcan!uunet!seismo!sundc!pitstop!sun!quintus!ok From: ok@quintus.UUCP (Richard A. O'Keefe) Newsgroups: comp.lang.prolog Subject: Re: Atom-based module systems Message-ID: <967@cresswell.quintus.UUCP> Date: 13 May 88 23:35:31 GMT References: <136@vor.esosun.UUCP> <841@cresswell.quintus.UUCP> <365@aiva.ed.ac.uk> <425@aiva.ed.ac.uk> Organization: Quintus Computer Systems, Mountain View, CA Lines: 24 In article <425@aiva.ed.ac.uk>, jeff@aiva.ed.ac.uk (Jeff Dalton) writes: > The reason I asked is that your recent remarks on the impossibility of > sharply distinguishing code from data would tend to support "atom- > based" designs. It is possible to distinguish code from data *PROVIDED* you add declarations to the language. The Mycroft & O'Keefe type checking paper suggests on the last page having a family of types void, void(T1), ..., void(T1,...,T93), ... where if :- pred p(,,) then p(X,Y,Z) : void if X: and Y: and Z: p(X,Y) : void() if X: and Y: p(X) : void(,) if X: p : void(,,) and so on. As I recall it, this was Alan Mycroft's idea. The :- meta_predicate declarations in Quintus Prolog are just such type declarations, where void(_1,...,_n) is abbreviated to n, and the other types are abbreviated to +,-,or ?. Thus the type of maplist/2 is :- pred maplist(void(T), list(T)). but this is abbreviated to :- meta_predicate(1, +). The BSI substandard, however, attempts to draw a distinction between code and data *solely* by means of syntax, without the aid of any such declarations.