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

Labelled PROGs (and DOs)



The suggestion has come to me recently to use as an identifying
label for a PROG merely the first prog label in that prog.  This is
completely retrofittable without any worry for existing code, and 
since it is attacking a lexical problem, there is no need to worry 
about "what if some one wants to name one PROG 'foo' and has another
PROG with a tag 'foo' . . .".  For example, the prog
(PROG (X Y)
  FOO (SETQ X (MUMBLE))
      . . .
      (RETURN Y))
CAN EASILY BE TRANSFORMED, AT ANY TIME, TO 
(PROG (X Y)
  UNIQUE-LABEL-1
  FOO (SETQ X (MUMBLE))
      ...  (DO < ... >  (GO <tag> UNIQUE-LABLE-1))
      (RETURN Y))
Thus I propose to extend the syntax of GO as follows
  1) flush computed GOs, possibly introducing a new primitive for this
    [foolish] purpose, and advertising CASEQ
  2) permitting an identifying tag as second arg, which would uniquely
   identify the prog level at which to GO
Also the same point as (2) would be done for RETURN, thereby
causing the multiple-return mechanism to have another name
and format.  This is acceptable, since it doesn't involve any
large body of existing code (such as for the PDP10), and on the
LISPM, if such a decision were made, then probably a TECO macro
could find all instances of (RETURN <value1> . . . <valuen>)
for n > 1, and convert them to (MRETURN 'prog_id <value1> . . .)