🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.prolog
Article #1671

Re: co-routining

#1671
From: David John Hawley
Date: Tue, 18 Dec 1990 01:36
24 lines
1665 bytes
In article <CHIK.90Dec17194110@icot21.icot.or.jp> chikayama@icot.or.jp writes:
>In article <MARK.90Dec7130758@adler.philosophie.uni-stuttgart.de> mark@adler.philosophie.uni-stuttgart.de (Mark Johnson) writes:
>
> * But what I don't know how to do is the following: define a predicate
> * delay(Term, Goal) which calls Goal when Term is further instantiated,
> * possibly by unifying distinct variables occuring in Term.
> * Any ideas?
>What's wrong with "freeze"ing a goal which, in addition to calling the
>main "Goal", will traverse the data structure the variable is
>instantiated to, hooking up the same goal to all the variables in the
>structure on its way?  For example:

(context: SICStus Prolog) The problem with this is when you "unify
distinct variables occuring in Term" to each other. The only predicate
I know of that can capture such events is dif/2 (a sound implementation
of \==), but I can't see how to use it to do what the first author wants.
On the other hand freeze/2 waits for "instantiations", i.e. it doesn't
trap Var=Var.

David Hawley

<munch>
<munch>
<munch>
Technical Details
Message-ID: <8203@icot32.icot.or.jp>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!ccut!wnoc-tyo-news!ascwide!ascgw!sh8810!okilab!icot32!hawley
References: <TED.90Dec6145517@aiaia.nmsu.edu> <MARK.90Dec7130758@adler.philosophie.uni-stuttgart.de> <CHIK.90Dec17194110@icot21.icot.or.jp>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!ccut!wnoc-tyo-news!ascwide!ascgw!sh8810!okilab!icot32!hawley
From: hawley@icot32.icot.or.jp (David John Hawley)
Newsgroups: comp.lang.prolog
Subject: Re: co-routining
Message-ID: <8203@icot32.icot.or.jp>
Date: 18 Dec 90 01:36:22 GMT
References: <TED.90Dec6145517@aiaia.nmsu.edu> <MARK.90Dec7130758@adler.philosophie.uni-stuttgart.de> <CHIK.90Dec17194110@icot21.icot.or.jp>
Distribution: comp
Organization: Fifth Generation Computing Systems (ICOT), Tokyo, Japan
Lines: 24