Can ABSOLUTE be used to alias a variable as an array element?
Can ABSOLUTE be used with string variables? Maybe even alias LOCAL string variables to elements of string arrays passed by VAR? And assign or SWAP through the aliases?
Could one array be an ABSOLUTE alias for a sub-range in another array, such that LOCAL B$() 0 through r%-l% would be a bounds checked alias for VAR A$() l% through r%, so that attempts to access elements of B$() before 0 or past r%-l% would be an error and changes to elements of B$() such as SWAP B$(0), B$(1) would be reflected in A$(l%) and A$(l% + 1) and vice-versa?
I'm asking for my friends, Hoare, Sedgewick, and Bentley.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Could ABSOLUTE aliasing LOCAL variables to substrings or lvalue MID$ of a VAR string be a back door to UDTs? X% becomes MID$(S$, 1, 4), Y MID$(S$, 5, 8), Z&() would be MID$(S$, 13, ???) What happens when I then go and DIM Z&(UBOUND(Z&()) * 2 + 1024) ?
Why are you backing away slowly like that?
Last edit: Yet Another Troll 2019-06-11
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I would not do that. I might work, but you would discover several bugs or at least strange behaviours of X11-Basic. Remember it is about pointers only. No real aliases of variables.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Could ABSOLUTE be extended in such a manner though? It would be great if I could get array bounds checking to work for me instead of being overhead to try to bypass in recursive calls to Quicksort. The UDT thing is more speculative. What about function or procedure pointers? Whatever might be eventually done to implement UDTs might need to be able to hold a vtable and variant records.
Yeah, OPTION BASE 1 or any eventual arbitrary lower/upper bounds support would b0rk that hard. No thanks. I at least try to stick to documented behavior.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Can ABSOLUTE be used to alias a variable as an array element?
Can ABSOLUTE be used with string variables? Maybe even alias LOCAL string variables to elements of string arrays passed by VAR? And assign or SWAP through the aliases?
Could one array be an ABSOLUTE alias for a sub-range in another array, such that LOCAL B$() 0 through r%-l% would be a bounds checked alias for VAR A$() l% through r%, so that attempts to access elements of B$() before 0 or past r%-l% would be an error and changes to elements of B$() such as SWAP B$(0), B$(1) would be reflected in A$(l%) and A$(l% + 1) and vice-versa?
I'm asking for my friends, Hoare, Sedgewick, and Bentley.
Could ABSOLUTE aliasing LOCAL variables to substrings or lvalue MID$ of a VAR string be a back door to UDTs? X% becomes MID$(S$, 1, 4), Y MID$(S$, 5, 8), Z&() would be MID$(S$, 13, ???) What happens when I then go and DIM Z&(UBOUND(Z&()) * 2 + 1024) ?
Why are you backing away slowly like that?
Last edit: Yet Another Troll 2019-06-11
I would not do that. I might work, but you would discover several bugs or at least strange behaviours of X11-Basic. Remember it is about pointers only. No real aliases of variables.
Could ABSOLUTE be extended in such a manner though? It would be great if I could get array bounds checking to work for me instead of being overhead to try to bypass in recursive calls to Quicksort. The UDT thing is more speculative. What about function or procedure pointers? Whatever might be eventually done to implement UDTs might need to be able to hold a vtable and variant records.
http://users.cms.caltech.edu/~cs140/140a/Oberon/language_faq.html
http://www.drdobbs.com/architecture-and-design/the-oberon-programming-language/184409405
For array bounds checking you should use ARRPTR() on that array, e.g.
But this is undocumented internals and may change in future....
Yeah, OPTION BASE 1 or any eventual arbitrary lower/upper bounds support would b0rk that hard. No thanks. I at least try to stick to documented behavior.