Timeline for Was self-modifying code possible using BASIC?
Current License: CC BY-SA 4.0
7 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jul 24, 2021 at 5:24 | comment | added | Peter Green | According to bbcbasic.co.uk/bbcbasic/manual/bbckey2.html (which is for a newer variant of BBC basic but I doubt they would have removed features) It looks like EVAL only works with expressions not statements. | |
| Jun 10, 2019 at 19:39 | comment | added | Max | Can one EVAL a string with a line number to change the currently running program? | |
| Jun 8, 2019 at 19:54 | comment | added | Tommy | @Barmar ugh, clearly my statement is incorrect. My specific failure was switching train of thought mid-sentence, not that it helps to say so: "it's never compiled" is patently false. | |
| Jun 8, 2019 at 19:40 | comment | added | Barmar | @Tommy The original DTSS BASIC was compiled, and many PC implementations compiled to byte code. | |
| Jun 8, 2019 at 17:43 | comment | added | Tommy | @another-dave obviously it's BASIC, so it's never compiled, but pedantry aside: EVAL evaluates a string from directly in memory and does whatever the interpreter would do if a user had typed it interactively. Very much like Javascript's eval(). The disk isn't involved; the *SPOOL/*EXEC suggestion (which, technically, isn't part of the BASIC but rather the OS underneath) was a separate suggestion, flowing from Michael Tracy's observations of HP BASIC. | |
| Jun 8, 2019 at 15:21 | comment | added | dave | I regard "self modifying code" as quite different from "compile and execute new code". Could EVAL be used to change code that was part of the executing program (as opposed to changing the program text on disk, so that the change had to wait for the next reload of the program)? Even CHAINing to the new code doesn't seem like it's really self-modifying. | |
| Jun 8, 2019 at 2:50 | history | answered | Tommy | CC BY-SA 4.0 |