🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.prolog
Article #3346

Re: modules

#3346
From: Peter Schachte
Date: Wed, 11 May 1988 20:39
33 lines
1294 bytes
There are some problems with atom-based module systems.  I think that
whatever module system you choose, this test should succeed for any
atom anytime:

test(Atom) :-
	name(Atom, String),
	name(Atom, String).

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) :-
	Term =.. [Pred|Args],
	name(Pred, Chars),
	append("prefix_",Chars,Chars2),
	name(Pred2,Chars2),
	Term2 =.. [Pred2|Args].

suffix_term(Term, Term2) :-
	Term =.. [Pred|Args],
	name(Pred, Chars),
	append(Chars,"_suffix",Chars2),
	name(Pred2,Chars2),
	Term2 =.. [Pred2|Args].

This is important for term_expansion/2.  An atom-based module system makes
it difficult to do both of these things.
-- 
-Peter Schachte
pds@quintus.uucp
...!sun!quintus!pds
Technical Details
Message-ID: <958@sandino.quintus.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!seismo!sundc!pitstop!sun!quintus!pds
References: <2747@mulga.oz>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!seismo!sundc!pitstop!sun!quintus!pds
From: pds@quintus.UUCP (Peter Schachte)
Newsgroups: comp.lang.prolog
Subject: Re: modules
Summary: problems with atom-based module systems
Keywords: another module scheme
Message-ID: <958@sandino.quintus.UUCP>
Date: 11 May 88 20:39:11 GMT
References: <2747@mulga.oz>
Organization: Quintus Computer Systems, Mountain View, CA
Lines: 33