Oxygen Basic
Programming => Problems & Solutions => Topic started by: José Roca on October 04, 2018, 03:18:08 PM
-
This "gibberish" needs some explanation, specially the "#" part.
function f(sys a) as sys
print "ok" a
end function
declare function ptr f1(sys a) as sys
! * f2(sys a)
int (* f3)(int a)
@f1=@f#sys
@f2=@f#sys
@f3=@f#sys
'#recordof f3
f1 1
f2 2
f3 3
-
Very briefly:
This gibberish :) demonstrates alternative ways of declaring a function pointer. f#sys is the name of the function as seen by the compiler. The parameter signature is appended to the name. For instance myfun#double#string. The signature is used to distinguish function polymorphs.
An external or callback function, like WndProc does not require a signature, however.
-
You're having fun with these alternate syntaxes, don't you? :)
I'm gonna go crazy.
-
You're having fun with these alternate syntaxes, don't you? :)
I'm gonna go crazy.
BASIC without chains or preconceived notions. I'm happy I'm along for the ride.
-
I'll settle for the shortest syntax :)
-
Me too, but only if it doesn't make the code look encrypted.