"Scope" "Basic definitions" ;"Status codes to explain why MAP-SCOPE exited" > ;"Defining and checking scope stages" >>> "-SCOPE-STAGE">>> .NAMES>>
!.SSS>> '>> "Scope stages" > ) ()> > ) ()> ;"TODO: Just step through the GLOBAL property instead of checking everything in LOCAL-GLOBALS." > ) (> ) ( )>>)> > ) ()> > ) ()> "Scope machinery" ;"Define scope stage routines" > "-SCOPE-STAGE">>> > > >>>> ,SCOPE-STAGES> ;"Define enough state for the most demanding stage" > > > > > > )> ;"To specify stages explicitly: [STAGES (INVENTORY LOCATION)] Or set them from search bits: [BITS .B] Or default to all stages in definition order (or use [BITS -1]). To turn off the light requirement: [NO-LIGHT]" > > > > > )> )) > ) ( 2> <==? <1 .SV> BITS>> > >>>) ( 2> <==? <1 .SV> STAGES>> > >) ( 1> <==? <1 .SV> NO-LIGHT>> >>) (ELSE )>> >> ;"Generate code to initialize SCOPE-CURRENT-STAGES" ,SCOPE-CURRENT-STAGES-SIZE>> )> > "-SCOPE-STAGE">>>> .STAGES>>> > .INIT-STAGES>>)> > )> > > '>> !.BODY>>> > %)) > "-SCOPE-STAGE">>>> ,SCOPE-STAGES>> )> ;"We don't distinguish between HELD and CARRIED, or ON-GROUND and IN-ROOM." > > ,INVENTORY-SCOPE-STAGE>)> > > ,LOCATION-SCOPE-STAGE> > ,GLOBALS-SCOPE-STAGE> > ,LOCAL-GLOBALS-SCOPE-STAGE>)> > ) (NEED-LIGHT <>)) > )> ) (ELSE )> > .LEN> ; ) (>> ) ( T>> ;"If stage returns -1, abort. It already set MAP-SCOPE-STATUS." )> )>>> ) (INIT <>) (NEED-LIGHT <>)) > )> ; ) ( > > > >> ;"If stage returns -1, abort. It already set MAP-SCOPE-STATUS." )> ) (ELSE > )>>> > > > > > ;"Next is O's child") (> ;"Next is O's sibling") (ELSE > > ;"Reached the scope ceiling" > ) (> ;"Next is L's sibling" ) (ELSE >)>>)> .O>