Some relevant Bugs

Ahhh, ok, ofc that is not possible and what would you say when you do instead of label, the keyword: “mark”

mark abc;
begin 
  goto abc;
  abc: //bla code...
end;

What i mean is, in old pascal “label” was used to say “there will be a label called abc”. Not to denote the place where the label actually is.

Yes, i got that^^

here how i think it should work with the idea of : “Mark” instead of Label

    method DoWork();
    MARK myMark;   //MARK should be a reserved word
    begin
      if somethingordinaryhappens then
        begin 
          writeln('hello blue world');
        end
     else //usage of myMark now!
     myMark:
     begin
       var i: int32;
       i := 20;//some demo code...
       writeln(i);
       goto myMark; //repeat this code block
     end;
    end;

Unfortunately, that conflicts our methods inside class syntax, where begin has to follow method. Also, I’m just not very fond of it. Also this should actually just compile as is without the mark myMark;

PMFJI: I have to say it always bothered me the way in old Pascal you had to (redundantly) declare that a label was coming rather than just declaring the label where it was actually needed. It always felt a bit like the language was just trying to discourage the use of labels by making you confess your sins as well as committing them. :slight_smile:

The Oxygene way seems more, streamlined, to me. :slight_smile:

The only thing I might have suggested, were it not too late, is that in keeping with contemporary notation, a #hashtag might have been a nifty little adjustment to the syntax, used on both the label and directives to address (jump to) that label.

It would also mark out labels as more visually distinct from variable declarations as well as dodging the : operator problem:

#outerloop
for i: Integer := 0 to 10 do begin
  for j: Integer := 0 to 15 do begin 
    ... break #outerloop;
  end;
end;

As I say, too late now (unless you would consider deprecating the old-style in favour of this trendy new one ?) :slight_smile:

hehe. While i don’t actively dislike it, # is a character in Pascal, not a label.

Hm, I did not even know, Oxygene now supports a goto! It would have helped me a lot in migrating the VMS Pascal code! And when looking at the documentation it says: there is no goto. https://docs.elementscompiler.com/Oxygene/Language/#q=goto

In fact, Niklaus Wirth had his own fight with the goto and changed the syntax several times while developing pascal. It was never clear if the “compiler of the day” will accept the code you wrote the day before. Sometimes goto was totally forbidden, sometimes it used numbers, sometimes labels. … :slight_smile:

It’s a fairly recent addition, it’s not in the docs yet, but yes, it supports it :wink:

1 Like

The thing with the “mark” keyword is, that it actually shall imply a good symantic, like label, when you remove this, its a little bit, like: “Where does the ABC: come from^^”

And you dont need then to define the Mark before the begin, it is ok, to define within the block, but i think it would be better to have something that says: “here is the label/mark” and later on , “here im using it”

I think, the way it works now is perfect. I don’t like the “mark” idea.

[the hash character] is a character in Pascal, not a label

Had me scratching my head for a minute there, but then I got it. Doh! #13#10 :slight_smile:

FYI - I had to write [the hash character] above because an actual # was interpreted as a header mark-down in the block quote, whilst the entity # was rendered literally. Weird.

With apologies to those ready to move on to other things :slight_smile:

# is the prefix for a decimal char, right ? So the # in those cases must be followed by a decimal digit, 1-9. If jump labels (excluding the leading #) are required to conform to normal Pascal identifier rules (as I think would make sense), then # followed by an alpha or _ must be a label.

Beyond identifying whether a # identifies a char* or a label, the two things cannot otherwise be confused (the legal use of a char is not legal for a label or vice versa, can it ?):

 #13                         // ERR: Statement expected
 for i := 1 to 10 do ...

 c := #outerLoop.toUpper;    // ERR: Label is not valid here

 goto #13;                   // ERR: Char is not valid here

Although this introduces a bit of duality w.r.t the use of the # character itself, it would still get my vote over that rather awkward looking ; on label declarations.

But then again, I should also mention that I think the last time I used a goto in Pascal must have been 10 years ago if not more, so it’s not as if this is something that is going to bug me on a daily basis, whichever way it goes. :slight_smile:

And what better way to appeal to younger coders. “Still using those 1970’s curly brackets in your language ? Oxygene has hashtags!

(I’m kidding, obviously)

1 Like

A post was split to a new topic: Island issue

Another Bug, i guess^^:

I have some private records included within this namespace, but in the global namespace im able to see them, it ignores the modifier.

TBla = private record end;

var blub: TBla; //?? actually impossible!

private translates to “assembly” when in the global namespace

bugs://77273 got closed with status fixed.

bugs://77271 got closed with status fixed.

Logged as bugs://i65012.

bugs://i65012 was closed as fixed.

bugs://i65013 was closed as fixed.

bugs://i65014 was closed as fixed.