[its-hackers] MUDDLE Question about about MIMPKG >

Eric Swenson eric at swenson.org
Wed Apr 28 03:25:49 CEST 2021


I'm hoping someone more knowledgeable  than I in things MUDDLE can help you here.  I just did a grep through a lot of source MUDDLE source code (interpreter, compiler, runtime), and don't see many SETGs on ATOM-TABLE.  I see a function that appears to implement REHASH doing it:

 

<DEFINE REH (SIZ "AUX" (LL ()))

        #DECL ((SIZ) FIX (LL) <LIST [REST ATOM]>)

                <MAPF <>

              <FUNCTION (L) #DECL ((L) <LIST [REST <PRIMTYPE ATOM>]>)

                   <MAPF <>

                         <FUNCTION (A)

                              <SET LL ((<OBLIST? <CHTYPE .A ATOM>>

                                        <REMOVE .A>)

                                       !.LL)>>

                         .L>>

              ,ATOM-TABLE>

        <SETG ATOM-TABLE

              <SETG M$$OBLIST!-INTERNAL

                    <IUVECTOR <SETG M$$OBLSIZ!-INTERNAL .SIZ> ()>>>

        <MAPF <>

              <FUNCTION (L) #DECL ((L) <LIST OBLIST ATOM>)

                   <INSERT <2 .L> <1 .L>>>

              .LL>

        .SIZ>

 

<DEFINE NPRIME? (N) #DECL ((N) FIX)

        <REPEAT ((D 2) (SQ <FIX <+ <SQRT <FLOAT .N>> 1.0>>))

                <COND (<G? .D .SQ> <RETURN <>>)>

                <COND (<==? <MOD .N .D> 0> <RETURN .D>)>

                        <SET D <+ .D 1>>>>

 

<DEFINE NEXT-PRIME (X) #DECL ((X) FIX)

        <REPEAT () <COND (<NOT <NPRIME? <SET X <+ .X 1>>>> <RETURN .X>)>>>

 

And I see some code that does a GBIND ATOM-TABLE.  But not much else that does a SETG.  

 

And I see some email from TAA to mim-users at mit-xx.arpa that says:

 

4) There's a new package in the library that will grow your ATOM-TABLE.

   This can be useful if you're in a muddle that has lots and lots of

   atoms.  Use the "REHASH" package, then call

   <REHASH number-of-buckets>.  The initial number is 237.  The

   number-of-buckets should always be a prime; to get a prime greater

   than some number n, call <NEXT-PRIME n>.

 

That appears to be a reference to the code, above.  So this may the one place where this is done. Does this help?  Do you need more info?

 

-- Eric

 

On 4/27/21, 5:43 PM, "its-hackers on behalf of rrs0 at earthlink.net" <its-hackers-bounces at its.victor.se on behalf of rrs0 at earthlink.net> wrote:

 

    Hi Lars, Chris, Tim and and other Muddle hackers,

 

    While working on  the package system for ITS Muddle, I been using the MIM code in

    a version of MIMPKG that I found as an example of handling the state information that

    Is needed buy a Muddle package  system. The version I'm working on is "TT:RRS;ITSPKG >"

    On Lars's pdp10 emulator. I need to finish L-UNUSE and add file system support to

    FIND/LOAD.

 

    There 3 places in the MIMPKG code that use the GVAL of ATOM-TABLE. The first

    Is in L-UNUSE and the other two are in TRY- OOPS.  Who or where does Muddle 

    SETG ATOM-TABLE ?? From L-UUSE and what it must do, ,ATOM-TABLE should be a list

    Of the  ATOMs the package's public and internal oblists that must unSET / unSETG'ed  and

    removed  from the DROPped package's obilists before the association between the atom

    who's pname Is the package is removed to  make the GC happy.

 

                Rick

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://its.victor.se/pipermail/its-hackers_its.victor.se/attachments/20210427/55c6ad42/attachment.html>


More information about the its-hackers mailing list