Ricardo Signes on 16 Apr 2019 06:39:48 -0700


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [Philadelphia-pm] syms in grammars


* Curt Tilmes <curt@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

Attachment: signature.asc
Description: Digital signature

_______________________________________________
Philadelphia-pm mailing list
Philadelphia-pm@pm.org
https://mail.pm.org/mailman/listinfo/philadelphia-pm