Home  |   Notes  |   Languages  |   Programs  |   Homework

Re: binding variables

New Message Reply About this list Date view Thread view Subject view Author view

§ídësmâçk (csides@VT.EDU)
Mon, 10 Dec 2001 10:28:40 -0500


Message-ID:  <4.3.0.20011210102505.02650a58@mail.vt.edu>
Date:         Mon, 10 Dec 2001 10:28:40 -0500
From: §ídësmâçk <csides@VT.EDU>
Subject:      Re: binding variables

There is no way to re-bind in prolog.
The only way to work around this is to pass its parameter a new value in a
recursive function.

blah(Out)
    Out2 = [different, out, list],
    blah(Out2).

I know this probably isn't what you are looking for, so I'd suggest not
binding your out_vars until you know what its value is supposed to
be. Thereby only binding it once and solving your problem.
Hope this helps man.
-Chris

At 10:18 AM 12/10/2001 -0500, you wrote:
>If a variable is already bound, is there a way to force it to rebind to a
>new value instead of failing as a comparison?
>
>ie:
> blah(Out)
> Out = [different,out,list].
>
>but mine fails because Out is bound when I pass it in... any suggestions?
>
> - Brian


New Message Reply About this list Date view Thread view Subject view Author view

Home  |   Notes  |   Languages  |   Programs  |   Homework
copyright © 2001 Virginia Tech, ALL RIGHTS RESERVED
Class site maintained by Stephen H. Edwards <edwards@cs.vt.edu>