points by gaff33 1 year ago

Everyone knows 'goto' is bad, so a language like this needs 'comefrom'

jezzamon 1 year ago

INTERCAL already has this in its language

SirusCodes 1 year ago

Interesting thought... But how will that work? The statement would be executed only it comes from that line?

  • immibis 1 year ago

    It is reverse GOTO. After (or before - your choice) that line is executed, execution jumps to the comefrom.

  • movpasd 1 year ago

    The compiler inserts a goto to the statement following the comefrom statement into the line specified. :^)

    If multiple comefroms to the same line are specified, the comefrom to jump to is selected randomly.

  • GuB-42 1 year ago

    It is like a regular goto, but with the label and statement reversed.

    So instead of

      label: 
      do_something
      goto label
    

    You have

      comefrom label
      do_something
      label:
    

    Really, that's just syntax. Declare your labels with "comefrom", and ":" means "jump". But it looks a lot more confusing this way.

    • TeMPOraL 1 year ago

      It's just syntax until you decide to support both.

      • kbelder 1 year ago

        Ok, so:

          comefrom label
          goto label
          label:
        

        A brand new way to lock up your machine.