repeatedly-eval-qt - good old-fashioned AI, in my lispmoo2?


If you dig deeep into d-machine documentation, the "chapter" on repeatedly-eval-qt (meaning, repeatedly-eval-quoted-forms, ie being the interlisp interperter), the page is mostly charming one-bit in-document doodles of the repeatedly-eval-qt working hard.

Fortunately, she has come to visit lispmoo2. Her job here is a little different, and she's pretty nuts actually.

1. Load up lispmoo2

(asdf:load-system :lispmoo2)
(in-package :lispmoo2/user)

( note that org-mode evaluating this source block would mean nothing )

2. Check what games are available

(glist)
<colgroup> <col class="org-left" /> <col class="org-left" /> <col class="org-left" /> <col class="org-left" /> </colgroup>
game0 game1 repeatedly-eval-qt screwville

3. Aha, repeatedly-eval-qt !

(gload "repeatedly-eval-qt")

Oh, I see. Every time I've executed it, since @describe for me now appends its indirect object list (of strings = commands in this case), so she keeps looking-around the number of times I've run that block.

Eh, let's do one better actually.

4. Sending repeatedly-eval-qt to see the princess from before

(setf (get 'note :descriptions) ())
(gload "game0")
{ @describe note :as ("{ @go forest }"
                      "{ talk distressed-princess }") } x
{ really-doit! note } x

REPEATEDLY-EVAL-QT @creates $ROOM :named START-LOCN.
REPEATEDLY-EVAL-QT @creates $ROOM :named FOREST.
REPEATEDLY-EVAL-QT @creates $ROOM :named CLEARING.
REPEATEDLY-EVAL-QT @creates $PLAYER :named YOU.
REPEATEDLY-EVAL-QT @creates $PLAYER :named DISTRESSED-PRINCESS.
REPEATEDLY-EVAL-QT @creates $THING :named GOLD-RING.
REPEATEDLY-EVAL-QT  leaves CLOSET
REPEATEDLY-EVAL-QT  goes to START-LOCN
You are in START-LOCN.
A place of beginnings; try '{ north } x'
Objects here are:

Players here are:
REPEATEDLY-EVAL-QT 
Exits here are: 

REPEATEDLY-EVAL-QT  digs from START-LOCN to FOREST
REPEATEDLY-EVAL-QT @verbs COM-NORTH of START-LOCN.
REPEATEDLY-EVAL-QT goes through NORTH.
REPEATEDLY-EVAL-QT  leaves START-LOCN
REPEATEDLY-EVAL-QT  goes to FOREST
You are in FOREST.
A fantasy forest.
There is a path to the west and a distressed-princess aside from trees
Try '{ talk distressed-princess }'
Or '{ @give gold-ring :to distressed-princess }'
Objects here are:

Players here are:
REPEATEDLY-EVAL-QT 
Exits here are: 

REPEATEDLY-EVAL-QT  digs from FOREST to START-LOCN
REPEATEDLY-EVAL-QT @verbs COM-SOUTH of FOREST.
REPEATEDLY-EVAL-QT  digs from FOREST to CLEARING
REPEATEDLY-EVAL-QT @verbs COM-WEST of FOREST.
REPEATEDLY-EVAL-QT @verbs COM-TALK of DISTRESSED-PRINCESS.
REPEATEDLY-EVAL-QT goes through WEST.
REPEATEDLY-EVAL-QT  leaves FOREST
REPEATEDLY-EVAL-QT  goes to CLEARING
You are in CLEARING.
(The gold-ring is right there)
A trail leads into the trees east
Try { @take gold-ring } x
Objects here are:
GOLD-RING 
Players here are:
REPEATEDLY-EVAL-QT 
Exits here are: 

REPEATEDLY-EVAL-QT  digs from CLEARING to FOREST
REPEATEDLY-EVAL-QT @verbs COM-EAST of CLEARING.
YOU  leaves START-LOCN
YOU  goes to FOREST
You are in FOREST.
A fantasy forest.
There is a path to the west and a distressed-princess aside from trees
Try '{ talk distressed-princess }'
Or '{ @give gold-ring :to distressed-princess }'
Objects here are:

Players here are:
DISTRESSED-PRINCESS YOU 
Exits here are: 
WEST SOUTH 
"Help! I lost my gold-ring in the clearing to the west!" 

Oh well that's interesting too. game0's limo ends by setting the current player to the newly created, 'you'. But that didn't stand in repeatedly-eval-qt's way, she happily drove 'you' around.

I forgot that we changed @go to automatically look-around, hence the double-up/s.

5. So now we have repeatedly-eval-qt

and potentially her children, being entities that can execute whatever sequence of commands one by one, that are @described onto a note.

Since we can just program whatever, she has solved, at least in one way whole rafts of problems. I guess in MOO vernacular she has a puppet class.

  1. Ogres randomly roaming our moors like that lambda RPG? She's on it (remotely, too).
  2. Want to find out about the next room without going there? She's on it.
  3. Syncronise events between two internetworked lambdamoo2/users? If we actually notify everyone HERE through their in-memory stream when stuff happens as intended instead of just standard-output, we could have her forward stuff she sees by arbitrary lisp networking code. She's on it.

6. That's half of my submission to our lispmoo2jam

Otherwise, I'm going to make a mountainside laboratory overlooking the ocean in order to work on Structure and Interpretation of Classical Mechanics in. (using maxima-interface).

</div>

Author: screwlisp

Created: 2024-11-18 Mon 21:58

Validate

Get lispmoo2

Leave a comment

Log in with itch.io to leave a comment.