Newsgroups: comp.lang.prolog
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!oitnews.harvard.edu!purdue!lerc.nasa.gov!magnus.acs.ohio-state.edu!math.ohio-state.edu!howland.reston.ans.net!news.sprintlink.net!news.ecrc.de!ecrc!acrab60!thom
From: thom@ecrc.de (Thom Fruehwirth)
Subject: Re: speed of prolog
Message-ID: <DA5vLn.5o0@ecrc.de>
Sender: news@ecrc.de
Reply-To: thom@ecrc.de
Organization: European Computer-Industry Research Centre GmbH.
References: <3rjth8$5k4@percy.cs.bham.ac.uk>
Date: Wed, 14 Jun 1995 11:51:23 GMT
Lines: 14

James Hammerton wrote:
>regular access to any element of the array Prolog will
>be inherently slow because you have to implement arrays using lists

Arrays usually have fixed size and in that case using simply
Prolog terms gives you constant time access as in other languages.

E.g. 
	:- functor(Array,array,100),	% "declare Array" as term with 100 arguments)
	   ...
	   arg(57,Array,Element57),	% access 57th element of the array


thom
