Kaleidoscope in BASIC
Pages: 1 2
Steve Fryatt (216) 2105 posts |
I thought that was the default, but now that I check, it seems not to be set. The advocates for not crunching distributed code usually state that it isn’t necessary because it happens as standard on recent versions of the OS…? |
Steve Drain (222) 1620 posts |
Except that in my User Guide of 1991 and the current PDF manual it says: “An ENDPROC which is nested within some other structure will be compiled as a branch to the ‘real’ end of the procedure.” And interestingly, it is possible to compile a Gosh, it is so very long ago I explored all the quirks of ABC, before giving it up as a lost cause once I had some assembly under my belt. |
Rick Murray (539) 13840 posts |
Wow, that’s delightfully ambiguous. Yes, only one ENDPROC ends a procedure, but there might be several of them in the procedure with the first one encountered in the code path being the end of the procedure.
Yeah, we know. ;-)
So I suppose this means code has to be rewritten to use X-form SWIs and check return codes. In other words, nobbling some of BASIC’s nice localised error handling and turning it into C (do something, did it fail? do something else, did it fail?).
ABC just built this:
I think it’s supposed to be done by BASIC VI (but not BASIC V), however a quick look in the FP and VFP module shows the string Basic$Crunch, so maybe they all behave the same?
:-) |
Steve Drain (222) 1620 posts |
Of course, because: “An ENDPROC which is nested within some other structure will be compiled as a branch to the ‘real’ end of the procedure.” ;-)
Automatic crunching only ever happens in those two circumstances (see the manual) for the very rationale you suggest. However, it still requires the system variable to be set for BASIC V, but not for VI.
I imagine the string remains in all modules simply because it is easier not to specially omit it when not required. |
Pages: 1 2