I am a novice. I have two ideas. Please don't laught at me if you think it's stupid.
1) Function that return multiple values. This may be convenient in some cases. It seems only Python allow returning values like this :
(varC, varD) = function()
2) Allow compiling with different mode, eg. fast/normal/debug. Where fast mode have least checking, debug mode have more checking. In other words, allow user to exclude some code fragments from compiling. And without hurting readability too much.
What do you think ?
Two ideas
1. Two values can be returned from procedures by using pointers.
2. You can specify certain sections of code to compile using the compiler directive '#CompilerIF'.
http://www.purearea.net/pb/english/manu ... tives.html
See the book in my signature for complete code examples and tutorials of such things.
Code: Select all
Procedure.l MakePoints(Value.l)
Static Coords.POINT
Coords\x = Value & $FFFF
Coords\y = (Value >> 16) & $FFFF
ProcedureReturn @Coords
EndProcedure
*Screen.POINT = MakePoints(67109632)
Debug *Screen\x
Debug *Screen\y
http://www.purearea.net/pb/english/manu ... tives.html
See the book in my signature for complete code examples and tutorials of such things.

- Kaeru Gaman
- Addict
- Posts: 4826
- Joined: Sun Mar 19, 2006 1:57 pm
- Location: Germany
note: PB is a Compiler, Phyton is an Interpreter.
some fast/slow options are Interpreter-specifications, it has nothing to do with compiling.
there are much more differences between Phyton and PB.
1) really complicated, since the return-value of a function is stored in a register.
return a pointer to a structure if you want more than one value to be returned.
2) > allow user to exclude some code fragments from compiling
see the Compiler Directives
some fast/slow options are Interpreter-specifications, it has nothing to do with compiling.
there are much more differences between Phyton and PB.
1) really complicated, since the return-value of a function is stored in a register.
return a pointer to a structure if you want more than one value to be returned.
2) > allow user to exclude some code fragments from compiling
see the Compiler Directives
oh... and have a nice day.