Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site sbcs.UUCP Path: utzoo!linus!philabs!sbcs!debray From: debray@sbcs.UUCP (Saumya Debray) Newsgroups: net.lang Subject: Re: Self-modifying code (Prolog) Message-ID: <566@sbcs.UUCP> Date: Tue, 10-Jan-84 10:46:00 EST Article-I.D.: sbcs.566 Posted: Tue Jan 10 10:46:00 1984 Date-Received: Wed, 11-Jan-84 08:17:51 EST References: <1096@mit-eddie.UUCP> Organization: SUNY at Stony Brook Lines: 26 : Prolog permits users to write self-modifying code pretty easily : in this language, program and data appear identical, so an assertion into the program database, or a retraction from it, effectively results in a change to the program. In fact, this feature is one of the major problems with the semantics of the language ("pure" Prolog has a very elegant semantics in terms of Horn Clause logic). In passing: Prolog has no concept of "global" variables. Therefore, attempts at simulating global variables, e.g. for gensym counters, usually use the self-modifying feature of Prolog (it could be done by passing the value of the gensym counter around explicitly as a parameter to everyone who needed it, but that would be a royal pain in the neck!), though the practice is frowned upon by Prolog purists. -- Saumya Debray SUNY at Stony Brook {floyd, bunker, cbosgd, mcvax, cmcl2}!philabs! \ Usenet: sbcs!debray / {allegra, teklabs, hp-pcd, metheus}!ogcvax! CSNet: debray@suny-sbcs@CSNet-Relay