Newsgroups: comp.lang.prolog
Path: cantaloupe.srv.cs.cmu.edu!rochester!udel!news.sprintlink.net!news.ecrc.de!ecrc!news
From: micha@ecrc.de (Micha Meier)
Subject: Re: Prolog syntax
Message-ID: <D80ByM.Cps@ecrc.de>
Sender: news@ecrc.de
Reply-To: micha@ecrc.de
Organization: European Computer-Industry Research Centre
References: <3o54fq$bgf@goanna.cs.rmit.edu.au>
Date: Wed, 3 May 1995 14:51:58 GMT
Lines: 39

In article bgf@goanna.cs.rmit.edu.au, ok@goanna.cs.rmit.edu.au (Richard A. O'Keefe) writes:
> But as Roger Scowen has pointed about, operators are concerned with
> read/1 and write/1, which are *run-time* things which should not have
> anything to do with any module system.  Why should the syntax of
> external data be affected by which module happens to contain the call
> to read()?
> 
> The right answer to variable run-time syntax is to generalise the idea
> of read tables to syntax tables, and to have versions of read/1 and
> write/1 that take syntax tables as arguments.

We have though about this a while ago but then we realized that making the syntax
module-dependent is cleaner (IMHO) and easier to use. This means that
both the tokenizer tables (containing character classes) and operators
are module-dependent.

Making read/1 and write/1 module-dependent is basically the same as providing
an additional syntax table argument - the argument is implicitly provided by the 
current module. The advantage is that operators can be made local and thus
harmless to other modules.

Why run-time things should be concerned with the module system:
If I want to implement a metaprogram in Prolog, which takes
another program and does something with it, I need to be able to process
all directives that occur in that program, including all imports, exports,
operator declarations etc. Especially, I must be able to execute
all operator declarations so that  I can parse the program text.


--Micha


---
Micha Meier			------------------------------------------------
ECRC, Arabellastr. 17		The opinions expressed above are private
D-81925 Munich 81		and may not reflect those of my employer.
micha@ecrc.de, Tel. +49-89-92699-108, Fax  +49-89-92699-170


