Article View: comp.lang.prolog
Article #3362Re: Atom-based module systems
From: Richard A. O'Keefe
Date: Fri, 13 May 1988 23:35
Date: Fri, 13 May 1988 23:35
24 lines
1615 bytes
1615 bytes
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(<t1>,<t2>,<t3>) then p(X,Y,Z) : void if X:<t1> and Y:<t2> and Z:<t3> p(X,Y) : void(<t3>) if X:<t1> and Y:<t2> p(X) : void(<t2>,<t3>) if X:<t1> p : void(<t1>,<t2>,<t3>) 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.
Technical Details
Message-ID:
<967@cresswell.quintus.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!attcan!uunet!seismo!sundc!pitstop!sun!quintus!okReferences:
<136@vor.esosun.UUCP> <841@cresswell.quintus.UUCP> <365@aiva.ed.ac.uk> <425@aiva.ed.ac.uk>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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