For Programmers: Free Programming Magazines  


Home > Archive > Prolog > July 2005 > Re: newbie prolog question, passing functions









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: newbie prolog question, passing functions
torkel@sm.luth.se

2005-07-24, 8:51 pm



mans wrote:
> OK,
> So how do I maintain persistent data to preserve the state of the
> system?


The standard method is to carry data along in a further
argument.

That is,

fnork(Old_state) :- do_stuff(Old_state,New_state),
fnork(New_state).

Is there a reason why this pattern is inapplicable in your
application?

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com