From Esolang
Jump to navigation Jump to search

There is an inconsistency in the article: It states that behavior is undefined if a command is renumbered while running, but the example seems to depend on it. I think the example should be right because otherwise making loops becomes much more awkward. --Ørjan 19:03, 27 Feb 2007 (UTC)

The bug was in the example, not the spec. Making loops doesn't become substantially more awkward; I've corrected the example as a result of your comment above. ais523 10:32, 28 Feb 2007 (UTC)


The quine is neat, but seems to depend on command lines not being ended by newlines in strings, which the spec doesn't say anything about, but which I suspect wasn't consciously intended to be allowed, given FORTE's old-style BASIC roots. --Ørjan (talk) 06:59, 27 January 2017 (UTC)

If anyone's interested, here's a quine I made in 2014: --Keymaker (talk) 12:36, 28 January 2017 (UTC)
The quine almost certainly comes from PPCG (one of the few places which makes heavy use of esolangs, other than us), and they define languages to be defined by their interpreter, without caring about specifications. For example programs here, we should probably stick to ones that actually comply with all readings of the specification, in case of future interpreter updates. --ais523 12:42, 28 January 2017 (UTC)

The first error

I don't see why it would be an error. It should go like this:

   > 10 LET 10 = 11
   15 PRINT 10
   20 END

10 is set to 11. We will show this by replacing all tens with elevens.

   > 11 LET 11 = 11
   15 PRINT 11
   20 END

11 is set to itself. I'll cover this later. For now, this'll be a nop.

   11 LET 11 = 11
   > 15 PRINT 11
   20 END

11 is printed. 11 is still 11, so it just prints 11.

  11 LET 11 = 11
  15 PRINT 11
  > 20 END

The program ends.

Now, what about 11 = 11? What if you think about it as a goto on the number line?

Well, why not put that as the error instead? LET 200 = 201 is only just a cause.

From the spec: "If a command's line number is redefined while the command is executing, even indirectly, this leads to undefined behaviour". So it's an error because it's defined to be an error.
The reason I defined it to be an error is because I found it inelegant for lines to move themselves around, rather than to be moved by other lines; in particular, there's more than one sensible interpretation of what should happen to the instruction pointer, and I wanted it to be more or less obvious just by looking at it how a Forte program would work. --ais523 21:33, 10 April 2020 (UTC)