Newsgroups: comp.lang.prolog
Path: cantaloupe.srv.cs.cmu.edu!bb3.andrew.cmu.edu!newsfeed.pitt.edu!gatech!newsxfer2.itd.umich.edu!newsfeed.internetmci.com!news.mathworks.com!fu-berlin.de!news.belwue.de!news.dfn.de!news.uni-bielefeld.de!news
From: clmeier@lili6.lili.uni-bielefeld.de (Clemens Meier)
Subject: Re: Argument passing via assert
Message-ID: <q9ag2el3kn.fsf@lili6.lili.uni-bielefeld.de>
Sender: clmeier@lili6.lili.uni-bielefeld.de
In-Reply-To: dominic@oldboy.aethos.demon.co.uk's message of 15 Feb 1996
	15:21:10 GMT
Date: Tue, 20 Feb 1996 10:00:08 GMT
References: <14600@gos.ukc.ac.uk>
	<DOMINIC.96Feb15152110@oldboy.aethos.demon.co.uk>
Nntp-Posting-Host: lili6.lili.uni-bielefeld.de
Organization: Universitaet Bielefeld, Linguistik und Literaturwissenschaft, Germany
X-Newsreader: Gnus v5.1
Lines: 33

In article <DOMINIC.96Feb15152110@oldboy.aethos.demon.co.uk> dominic@oldboy.aethos.demon.co.uk (Dominic Binks) writes:

> In article <14600@gos.ukc.ac.uk> st14@ukc.ac.uk (S.Tobies) writes:
> 
>    I have a questtion concerning argument passing:
> 
>    I have to handle with a predicate which - in exceptional cases - needs some
>    additional arguments. These arguments tend to be quite big terms but ground. 
>    Would it under theses circumstances make any sense to pass these arguments
>    using assert/retract or would you consider this to be plain bad style?
> 
> It's not just plain bad style it's also likely to be fairly
> inefficient because most Prolog's are not good at asserting large terms.

Correct me if I'm wrong, but if an argument is passed (as one
variable) to a predicate, doesn't the Prolog interpreter just
about copy one pointer to the structure passes in the variable,
kind--of ``call by reference''?

And, if you assert a term to the database, Prolog would have
to copy the whole term (such that non--instantiated variables
embedded in that term wil remain so when they become instantiated
after the term has been asserted), won't it?

Thanks

Clemens

-- 
----------------------------------------------------------------------------
> Wo ist denn der Objoke ???                                   Clemens Meier
Bei Clemens? Nie!! Ok, ok, aber fast nie.      clmeier@lili.uni-bielefeld.de
    GO C+ UL P- L+>++>+++ 3$ E++>+++ N++ R+>+++ G'''' !tv b++ D f? TWERPS+++
