said, is gosub really a must-have (in 2009) ?
Fred, let me say first that after long time I like to see the good developments Purebasic made since i visited it last.
About the GOSUB, there are few cases where its just faster if you can use it, because it does not use the Stack-Frame a Procedure call with Parameters makes.
As its by Design not supported from Purebasic, the discussion on this topic is worthless.
So lets talk about the alternatives. MACROS could be taken as an alternative.
When trying the Macros, i realized that they actually seem not to support "Macro Local Labels" and Macro local Variables.
Code: Select all
MACRO Test()
MyLabel:
IF (a=b)
GOTO MyLabel
endif
ENDMACRO
Using this MACRO, i could only use it ONCE because it contains a Label, that has to be unique.
Labels are in Purebasic not even Procedure-Local but Global, if my Tests were right.
I'd prefer Labels to be generally Procedure-local, as I would never want to Jump from outside into a Procedure.
Therefore I do not need the Label outside. But i could take the same Label in man Procedures.
In big Projects, i find myself making Lables like that: Label_0002 to avoid Duplicates.
So about this my wishlist for Purebasic contains here (not the GSUB as it seem unpossible) but these points:
- procedure-local labels (I don't know if this is possible)
- macro - local labels and variables (this one is easy to realize, just add a number in the preprocessor, each time the macro is called)
could use a #MACROTEMP a,b,d ; Directive
I'll make some more suggestions from my standpoint in another post.