🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.prolog
Article #3367

Re: modules

#3367
From: Jeff Dalton
Date: Sat, 14 May 1988 16:59
50 lines
2480 bytes
In article <958@sandino.quintus.UUCP> pds@quintus.UUCP (Peter Schachte) writes:
>
>There are some problems with atom-based module systems.

There are also problems with predicate-based systems.  I see nothing
wrong with a predicate-based scheme if those problems could be solved
in a reasonable way.  Indeed, I think enough of the Prolog community
dislikes atom-based schemes and sees no use for them that a predicate-
based system would be the less controversial choice.  As it is,
however, the choice seems to be between different imperfections, and I
don't see that making problems for things like name/2 is worse than
making problems for things like call/1.

>I think that whatever module system you choose, this test should
>succeed for any atom anytime:
>
>test(Atom) :-
>	name(Atom, String),
>	name(Atom, String).
>

I am having difficulty imagining a situation in which this test could
fail.  I suspect this is my failing rather than yours, and so I would
find an explanation useful.


>Also, it should be possible to take a term representing a goal and do
>both of the following to it, and get a term representing a different
>goal in the same module:
>
>prefix_term(Term, Term2) :-   [...]
>
>suffix_term(Term, Term2) :-   [...]

>This is important for term_expansion/2.  An atom-based module system makes
>it difficult to do both of these things.

I am not sure whether "both" is supposed to refer to prefix and suffix
or to (prefix / suffix) and test.  This may seem an minor point, but 
there are systems where suffix would work but prefix would not.  Does
term_expansion/2 require both prefix and suffix?

Anyway, it is possible to write prefix_term and suffix_term in some
atom-based schemes (ones where the module name is not part of the
atom name), just not exactly as you've given them.  Since they may
have problems in Prolog as it is now -- the prefixed or suffixed
term might already exist and be used for a different purpose --
such things might be better off with an atom-based module system.

-- Jeff
Technical Details
Message-ID: <439@aiva.ed.ac.uk>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!mcvax!ukc!its63b!aiva!jeff
References: <2747@mulga.oz> <958@sandino.quintus.UUCP>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!mcvax!ukc!its63b!aiva!jeff
From: jeff@aiva.ed.ac.uk (Jeff Dalton)
Newsgroups: comp.lang.prolog
Subject: Re: modules
Keywords: another module scheme
Message-ID: <439@aiva.ed.ac.uk>
Date: 14 May 88 16:59:41 GMT
References: <2747@mulga.oz> <958@sandino.quintus.UUCP>
Reply-To: jeff@uk.ac.ed.aiva (Jeff Dalton)
Organization: Dept. of AI, Univ. of Edinburgh, UK
Lines: 50