Looking for pointers to avoid wheel-reinvention!

Ali Chamas ali at sparkdigital.com.au
Thu Apr 19 06:52:44 UTC 2001


Hi Chirs,

> From: "Chris Wright" <caw at cs.mu.oz.au>
> Reply-To: squeak at cs.uiuc.edu
> Date: Thu, 19 Apr 2001 16:39:19 +1000
> To: <squeak at cs.uiuc.edu>
> Subject: Looking for pointers to avoid wheel-reinvention!
> Resent-From: squeak at cs.uiuc.edu
> Resent-Date: 19 Apr 2001 06:34:08 -0000
> 
> I've got an application that I'd like to port to Squeak. It implements a
> simple BDI Agent architecture (BDI Agents: From Theory to Practice (1995)
> Anand S. Rao, Michael P. Georgeff Proceedings of the First Intl. Conference
> on Multiagent Systems -- http://citeseer.nj.nec.com/rao95bdi.html). It might
> be nice to give objects in the world Beliefs, Desires and Intensions!
> 
> Part of this application is a plan interpreter. In Scheme et al. the
> implementation of the interpreter looks a little like this:
> 
> (define (execute-one-step form plan intention)
> (cond ((assert-stmt? form) ; do assert stuff)
> ((query-stmt? form) ; do query stuff)
> ...
> ))))
> 
> 
> Where part of a plan might look like
> 
> '(
> (assert (bp bed_1 100))
> (query (max_bd ?max))
> (if (> 100 ?max)
> ...
> ))
> 
> 
> So, I need to ability to have a look at the program-as-data and branch on
> that. Is there an OK way to do this in Squeak (where the plan could be
> represented as strings of Squeak code in a OrderedCollection and executed by
> Compiler>>evaluate? Or should I hunker down and write an interpreter for a
> language and use that...?

How about Smalltalk blocks? You could have an OrderedCollection of blocks,
all sitting there waiting to be fed some value.
Mind you, i'm still not quite sure what it is you are trying to do, but it
sounds cool. ;)

> Cheers
> 
> 
> Chris Wright
> 
> 





More information about the Squeak-dev mailing list