FOR lists

Here you can suggest additions and modifications to BB4W or BBCSDL
User avatar
hellomike
Posts: 55
Joined: Sat 09 Jun 2018, 09:47

Re: FOR lists

Post by hellomike » Sun 10 Nov 2019, 12:31

If Python is as easy to setup as BB4W and as dynamic with trail and error approach as the BB4W IDE, I would like to give it a go.

RichardRussell
Posts: 94
Joined: Tue 15 Oct 2019, 09:10

Re: FOR lists

Post by RichardRussell » Sun 10 Nov 2019, 16:04

KenDown wrote:
Sun 10 Nov 2019, 12:19
Dear me no! "As I am sure you realise" implies an acknowledgement that it is common knowledge between us.
You were wrong and I was right. I don't call that "common knowledge"! :lol:
Probably too late to implement it, but one solution to the problem of programs failing would be to have a BB4W version number in the program. If it was compiled with 6.12 then LOOP or NEXT could be interpreted in one way, if with v. 7.20 then those words could be interpreted in another way.
So you're suggesting that each new version of the interpreter could have a number of 'compatibility modes' in which it can emulate every previous version of the interpreter, according to something found in the BASIC program. Do you realise how impractical that is, the amount of extra code in the interpreter it would imply, and the likely overhead in execution time? :shock:

I think this thread has gone completely off the rails. Every time I post something (and because I am moderated it typically takes a few hours before my post appears) a moderator posts a response which contradicts what I wrote, allowing him always to have the last word. If that's what being moderated has to mean, I am not prepared to remain a member of this forum. :cry:
My posts are moderated; if you are seeing this it has already been approved. If you have a comment about the style or tone of the message please report it to the moderators by clicking the exclamation mark icon rather than complaining on the public forum.

KenDown
Posts: 91
Joined: Wed 04 Apr 2018, 06:36

Re: FOR lists

Post by KenDown » Sun 10 Nov 2019, 16:26

Oh, I think that "you (Richard) are right and I (Ken Down) am wrong" is probably very common knowledge! :-)

I'm just putting forward ideas. You are undoubtedly correct in stating that the idea of compatibility modes is totally impractical. Mind you, I didn't have in mind emulating every previous version; merely a quick scan of the version number of the program being compiled and a warning along the lines of "v.7.20 uses the keyword LOOP. This program was written with v.6.xx and therefore may not be compatible. See Help file for details." (Or that could be, "see website for details".)

Anyway, feel free to ignore the suggestion. I shan't be at all offended!

Incidentally, I post my replies as me, not as moderator (or assistant mod, to be pedantic), and it is with no thought of "having the last word", merely of doing you the courtesy of replying rather than thinking that your valuable observations are being ignored.

RichardRussell
Posts: 94
Joined: Tue 15 Oct 2019, 09:10

Re: FOR lists

Post by RichardRussell » Sun 10 Nov 2019, 17:58

KenDown wrote:
Sun 10 Nov 2019, 16:26
merely a quick scan of the version number of the program being compiled and a warning along the lines of "v.7.20 uses the keyword LOOP. This program was written with v.6.xx and therefore may not be compatible.
OK, but that doesn't solve the compatibility issue. The program still doesn't run, and the person running it is faced with a choice of either modifying the program or somehow getting hold of a copy of an old interpreter which will run it. Neither may be practical, especially if he is not the program's author. All your proposal would achieve is to make it easier to discover why the program doesn't run, but although that is of some value it doesn't of itself solve the problem.
Incidentally, I post my replies as me, not as moderator (or assistant mod, to be pedantic), and it is with no thought of "having the last word"
Being a moderator gives you a unique opportunity of replying immediately after every post of mine is published, so whether or not it is with the "thought" of having the last word that is the practical consequence. It seems to me, as (I believe) the sole moderated member of this forum, that I am being doubly disadvantaged: my posts get delayed (I realise that is unavoidable) but also it appears to the casual reader that the validity of everything I assert is in doubt.

I would refer back to the "rationale" for moderating me, as explained by the forum's admin. The two principal justifications were (1) to block "abrasive" messages from me (which is fair enough I suppose) and (2) to allow others to respond before I do. I just feel that this second one has now gone to the opposite extreme.
My posts are moderated; if you are seeing this it has already been approved. If you have a comment about the style or tone of the message please report it to the moderators by clicking the exclamation mark icon rather than complaining on the public forum.

KenDown
Posts: 91
Joined: Wed 04 Apr 2018, 06:36

Re: FOR lists

Post by KenDown » Sun 10 Nov 2019, 21:19

And, I regret to say, I will be away all day tomorrow. I hope David can step in and take up the slack, so to speak.

Soruk
Posts: 5
Joined: Mon 30 Jul 2018, 20:24

Re: FOR lists

Post by Soruk » Mon 11 Nov 2019, 15:25

RichardRussell wrote:
Fri 08 Nov 2019, 16:54
Noted. As you may have seen, I raised the issue at StarDot (where there is probably a deeper BBC BASIC knowledge base than here) and the reactions so far have been universally positive. The author of Matrix Brandy has already expressed an interest in implementing it in that dialect of BBC BASIC, and history suggests that he may not take very long!

So the cat is well and truly out of the bag. Whether I commit to implementing it in BBCSDL or not, there may well be a version of BBC BASIC with that functionality quite soon, and that may force my hand.
Right now there's a lot going on in the real world that precludes me spending a lot of time on something that might be used a little, if at all, to implement it it Matrix Brandy. On the flip-side, there is only one implementation to worry about (C) so don't have to worry about a second, parallel implementation in assembler or something else!

(And since LIST is a keyword, I'd have thought FOR x% LIST 4, 65, -2 might make more readable sense, unless it's impossible to use the LIST token in a program line; as a command it's limited to immediate mode only and thus likely removed from BBCSDL).

Edit: Cross-posted my reply to *.

RichardRussell
Posts: 94
Joined: Tue 15 Oct 2019, 09:10

Re: FOR lists

Post by RichardRussell » Mon 11 Nov 2019, 15:45

Soruk wrote:
Mon 11 Nov 2019, 15:25
(And since LIST is a keyword, I'd have thought FOR x% LIST 4, 65, -2 might make more readable sense, unless it's impossible to use the LIST token in a program line; as a command it's limited to immediate mode only and thus likely removed from BBCSDL).
At StarDot it has been pointed out that there's no need for a keyword here at all. The syntax could simply be:

Code: Select all

      FOR I% = 3, 22, -9
      NEXT
      
      FOR Day$ = "Mon", "Fri", "Sun"
      NEXT
      
and perhaps:
      FOR I% = list%()
      NEXT
I am quite attracted to this syntax, not least because of its similarity to the existing syntax for initialising an array:

Code: Select all

      I%() = 3, 22, 9
      Day$() = "Mon", "Fri", "Sun"
      I%() = list%()
It would mean that the two (or more) types of FOR statement cannot be distinguished as early on, which might be an issue for an interpreter. But it's not clear to me whether it makes implementation harder or easier (or slower or faster)!
My posts are moderated; if you are seeing this it has already been approved. If you have a comment about the style or tone of the message please report it to the moderators by clicking the exclamation mark icon rather than complaining on the public forum.

Post Reply