🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.prolog
Article #1121

Meta-programming question

#1121
From: Bradley L. Richards
Date: Wed, 29 Aug 1990 16:30
21 lines
1476 bytes
I'm working on a meta-programming project and have run across something I just
can't figure a way to do.  I want to locate a clause via unification with its
head, and then be able to retrieve the clause *without binding any variables*.
The goal here is to modify the clause and replace it, so it's essential that
I avoid making unintended changes via bindings.

In Arity Prolog I can achieve most of this effect by accessing the clause
using their database predicate "recorded," which returns both the clause
(which I verify via unification) and a reference number I can use for later
access.  The catch is that any comparator predicates (e.g. N \== 2) are
loused up in the returned clause.  Arity tells me that they hadn't intended
for users to access clauses with database predicates, so this isn't a
supported feature.

Can anyone suggest alternate approaches to this problem?


---------------------------------------------------------------------------
 Bradley L. Richards       uucp:  cs.utexas.edu!bradley
 bradley@cs.utexas.edu     CompuServe:  75216,1744
---------------------------------------------------------------------------
Technical Details
Message-ID: <199@qt.cs.utexas.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!bradley

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!bradley
From: bradley@cs.utexas.edu (Bradley L. Richards)
Newsgroups: comp.lang.prolog
Subject: Meta-programming question
Message-ID: <199@qt.cs.utexas.edu>
Date: 29 Aug 90 16:30:17 GMT
Organization: U. Texas CS Dept., Austin, Texas
Lines: 21