Newsgroups: comp.lang.prolog
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!news.mathworks.com!hookup!swrinde!howland.reston.ans.net!Germany.EU.net!Munich.Germany.EU.net!ecrc!news
From: joachim@ecrc.de (Joachim Schimpf)
Subject: Re: DCGs
Message-ID: <Cz970K.F94@ecrc.de>
Sender: news@ecrc.de
Reply-To: joachim@ecrc.de
Organization: European Computer-industry Research Centre GmbH, Munich, Germany
References: <PEREIRA.94Nov10222635@alta.research.att.com>
Date: Mon, 14 Nov 1994 10:41:08 GMT
Lines: 26

In article 94Nov10222635@alta.research.att.com, pereira@alta.research.att.com (Fernando Pereira) writes:
> ...
>
>`(C, @(P0,Stream), @(P,Stream)) :-
>   stream_position(Stream, _, P0),
>   get0(Stream, C),
>   stream_position(Stream, P).
>
> ...
>
>The relative slowness is due to the constant fiddling with stream
>positions, which involves going through several layers of Prolog, C,
>I/O libraries and system calls. But using assert to implement some
>form of streams would be even worse.

It shouldn't be all that bad when buffered I/O is properly implemented.
In ECLiPSe, repositioning to a point that is still in the file buffer
(which should be the case most of the time) just requires moving a
pointer.

---------------------------------------------------------------------------
 Joachim Schimpf                                 Email   joachim@ecrc.de 
 European Computer-Industry Research Centre      Phone   +49 89 92699 111
 Arabellastrasse 17, D-81925 Munich, Germany     Fax     +49 89 92699 170


