One of the few things that irritates me about BBC BASIC is that there is no built-in way of assigning a memory address to a structure, something that you commonly want to do if (for example) you are using structures to implement a linked list. It wasn't too bad in the 32-bit-only days because one could write:
but with compatibility with 64-bits now being so important you typically end up using a procedure:
Code: Select all
DEF PROC_setptr(RETURN d{},p%%)
IF INKEY(-256)=&73 IF @platform% AND &40 ](^d{}+8)=p%% ELSE !(^d{}+4)=!^p%%
ENDPROC
Whilst this is effective at hiding the ugliness, it's not fast or elegant. Therefore I'm wondering about implementing this extension to the language:
There are no significant compatibility implications (currently this syntax will result in a 'Missing #' error) and I don't think it would be too difficult to achieve, in BBCSDL at least (it could be considered for BB4W at a future date).
Thoughts?