View Single Post
Old 28 August 2015, 05:22   #358
Registered User
Join Date: Sep 2007
Location: Stockholm
Posts: 1,341
Originally Posted by Mrs Beanbag View Post
I like how you use the same keyword for all the end statements. But i would swap round the syntax of the short and long versions, so that "do" is a universal block beginning. Then you can always see that there is a block even when confronted with an unfamiliar statement, which maybe also eases expansion of the language.
That's exactly what ARexx does. It only has one kind of block (unless you count procedures): DO … END
You can have
IF a=10 THEN b=2
…or you can have

And DO has parameters such as DO FOR, DO WHILE and DO UNTIL.

Originally Posted by Mrs Beanbag
Quite... but the width of a tab could be set to anything in the editor so it gets a bit awkward! I've pondered using some other character, maybe |, like so:
One advantage to all-alphabetic languages is that they can be written on any keymap with equal effort. "|" is easy enough to write on an Amiga keyboard, less so on many PC keymaps.

Mind you, anything is preferable to HTML/XML inspired markup, which uses both full names and two special characters for each keyword.

Originally Posted by Mrs Beanbag
so you can trace down the lines and see where it lines up, which can actually be quite difficult with only whitespace indentation, if you have a very long function (more than a screen).
It's a good idea, but coming from AMOS, I tend to favour editors with full lexical parsing. That gives you those lines (and proper indentation) for free.

Originally Posted by Mrs Beanbag View Post
yeah yeah fair enough i do know how function calls work at the low level, but pushing a couple of 32 bit integers on the stack really doesn't account for how slow AMOS's procedure calls are, there must be something else going on there.
I have no idea how the AMOS source code works, but I think they key lies in the SHARED command. Whenever a procedure is called, it sets up its own work environment and stacks away the variable space of the calling routine.

For the same reason, I use mostly gosubs in my current Blitz project, instead of the tidier functions and statements. When I was programming in AMOS, I only used procedures, but Blitz's (otherwise horrible) manual was friendly enough to suggest the use of gosubs in the chapter on optimisations.

Last edited by TCD; 28 August 2015 at 08:08. Reason: Back-to-back posts merged.
idrougge is offline  
Page generated in 0.05430 seconds with 9 queries