[Philadelphia-pm] syms in grammars
Ricardo Signes
perl.phl at rjbs.manxome.org
Tue Apr 16 06:39:36 PDT 2019
* Curt Tilmes <curt at tilmes.org> [2019-04-16T07:54:16]
> We should try to get it to the point it will read the old files here:
>
> https://github.com/historicalsource
I cloned all of those just this morning.
Those are mostly written in ZIL, a language I definitely do not want to
implement. It's somewhat Lisp-like, being based on MDL. Here's some ZIL:
From https://github.com/historicalsource/suspended/blob/master/robots.zil
<ROUTINE DEAD-FCN ("OPTIONAL" (ROB 0) "AUX" (COUNT 0) TEMP L)
<COND (<NOT <EQUAL? .ROB 0>>
<TELL "FC: " D .ROB " is no longer functional." CR>)>
<COND (,OLD-WINNER
<SET TEMP <GET ,DEADBOTS <GETP ,OLD-WINNER ,P?ROBOT>>>
<COND (<L? .TEMP 30>
<SETG WINNER ,OLD-WINNER>
<SETG OLD-WINNER <>>
<SETG WINNER-HERE
<COND (<IN? <SET L <LOC ,WINNER>> ,ROOMS> .L)
(T <LOC .L>)>>
<SETG ROFF <GETP ,WINNER ,P?ROBOT>>
<SETG HERE ,WINNER>
<TELL "FC: Cryolink reestablished to ">
<TELL SD ,WINNER "." CR>
<SETG QUOTE-FLAG <>>
<SETG P-CONT <>>
<RFATAL>)>)>
Yow. What I was working on was more like zasm, which was prefigured by XZAP,
the original Z-machine assembler, seen here:
.FUNCT THIS-IT?,OBJ,TBL,SYNS,?TMP1
FSET? OBJ,INVISIBLE /FALSE
ZERO? P-NAM /?THN3
GETPT OBJ,P?SYNONYM >SYNS
PTSIZE SYNS
DIV STACK,2
SUB STACK,1
CALL ZMEMQ,P-NAM,SYNS,STACK
ZERO? STACK /FALSE
?THN3: ZERO? P-ADJ /?ELS8
GETPT OBJ,P?ADJECTIVE >SYNS
ZERO? SYNS /FALSE
PTSIZE SYNS
SUB STACK,1
CALL ZMEMQB,P-ADJ,SYNS,STACK
ZERO? STACK /FALSE
?ELS8: ZERO? P-GWIMBIT /TRUE
FSET? OBJ,P-GWIMBIT /TRUE
RFALSE
.ENDI
Obviously better, right?
--
rjbs
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: Digital signature
URL: <https://mail.pm.org/pipermail/philadelphia-pm/attachments/20190416/e7d3c343/attachment.bin>
More information about the Philadelphia-pm
mailing list