[its-hackers] Building a PACKAGE system for Muddle 54
taa at alum.mit.edu
Thu Feb 11 03:47:22 CET 2021
Fun. For the record, here's the definition of PACKAGE from MIM source. I'd say your version is pretty authentic.
<DEFINE PACKAGE (NAME:STRING
"OPT" (INAME:STRING .NAME) "VALUE" ATOM
"AUX" (TNAME:<OR FALSE STRING> <TRANSLATE? .NAME>) ATM:ATOM
IATM:ATOM OBL:OBLIST IOBL:OBLIST TMP:LIST
<COND (<==? .INAME .NAME> <SET INAME <STRING !\I .TNAME>>)>
<SET ATM <OR <LOOKUP .TNAME ,PKG-OB> <INSERT .TNAME ,PKG-OB>>>
<SET OBL <MOBLIST .ATM>>
<SET IATM <OR <LOOKUP .INAME .OBL> <INSERT .INAME .OBL>>>
<SET IOBL <MOBLIST .IATM>>
<BLOCK <SETG .ATM <SET TMP (.IOBL .OBL <ROOT>)>>>
<COND (<AND <ASSIGNED? NO-LOAD> .NO-LOAD>
<PUTPROP .TMP NOT-LOADED NOT-LOADED>)>)
(<BLOCK <SET TMP (<1 .OBLIS> !.OBLIS)>> <SET ATM T>)>
<COND (.TNAME <PUTPROP .ATM IOBLIST .IOBL>)>
<PUTPROP .TMP IN-COLLECTION .ATM>
PKG-OB is the PACKAGE!- oblist. The TRANSLATE stuff I think was added to support MIM-there was a global (by default empty) list of translations (string->string) that was referenced by TRANSLATE?. The code is a little obscure in PACKAGE itself: TNAME is never FALSE, though the DECL says it can be: TRANSLATE? always returns a STRING, either the translation or the original name if there wasn't one. This allowed a package to be loaded more than once, which can be handy when you're compiling things.
Ceterum autem censeo Microsoftem esse delendam.
From: rrs0 at earthlink.net <rrs0 at earthlink.net>
Sent: Wednesday, February 10, 2021 4:34 PM
To: ChrisXReeve at gmail.com; Timothy Anderson <taa at alum.mit.edu>; Its Hackers <its-hackers at its.victor.se>
Cc: Rick Shiffman <rrs0 at earthlink.net>; Lars Brinkhoff <lars at nocrew.org>
Subject: Re: Building a PACKAGE system for Muddle 54
I found the bug!!! I didn't splice all the needed oblists in the correct order!
Here's the working code:
And a simple test package:
I FLOADed XPACKG and XPGTST into a fresh muddle and
It worked! Now I need to add file I/O to to XPACKG an d we will
Have a working basic Muddle Package system
> On Feb 9, 2021, at 1:57 PM, rrs0 at earthlink.net<mailto:rrs0 at earthlink.net> wrote:
> Hi Chris and Tim,
> I am in the middle of building a PACKAGE system for Muddle 54 that comes with the KA10 emulator running ITS.
> We found an old (1972) version of PPRINT and FRAMES. I had to debug it. PPRINT is now is at GitHub lars/ .
> It and frames make debugging possible!
> Back to PACKAGEs, I have an in-core version, "XPACKG >" where PACKAGE creates the correct oblist structure.
> And leaves the IPCK oblist as <1 .oplist>, ENDPACKAGE does a EN BLOCK my USE seem to be working. ENTRY is
> giving my some trouble though. Its supposed to move the atoms that are its arguments from IPCK oblist to PCK oblist.
> I am having trouble getting the atoms on the right oblist, the problem was the atom on IPCK had its GVAL set to the
> function but the Atom of the same PNAME on the PCK oblist didn't have a GVAL. When I do this by hand I get the ATOMs
> and there GVALs are put on the correct oblist.
> Any hints or suggestions???
> P.S. here's my code so far
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the its-hackers