1. "structured" goto's

Hi:
Sorry if somebody already mentioned this, but I am days behind reading
the list and I remembered a stack macro assembler (I think Olivetti's) I
used to know that let you pop levels in the return address stack. In
some hipothetical language (not Eu4 :) it would be something like:

while ...  do
    for  ....do
        while ... do
            if .....then
                 exit 2    ------->exit forward 2 levels of code
            elsif ....then
                  exit 3   --------->exit forward 3 levels depth
            end if
        end while
    end for           --->woud exit 2 here
end while      ---> would exit 3  here

More interesting woud be a "structured forward labeled goto" (add
adjectives and adverbs to taste, do not stir) like this:

while ...  do
    for  ....do
        while ... do
            if ....then
                exit labelx
              elsif ...than
                exit labely
        end while
    end for labelx ---->this is a label, go on to next instruction, no
garbage left
end while labely  ----->same

Would this be useful?
Does it would make a better or simpler language?
Is it easier to program, instead of using state variables?
Is our program more readable, maintainable, (codable, if the word exists
in English),etc.?
Is it hard to implement? (someone could code it is a simple forward goto
in the C interpreter! Although it might be a more complex interpreter
code....but a simpler  target language... And probably not slower!).

Sorry for the overhead.....we could lose... :)

Carlos Valdés

new topic     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu