Pseudotypes for compiler validation
Posted: Sat Jan 03, 2015 5:45 pm
I want to code a generic method like : MergeList(a(),b())
But there's no keywords (like Pseudotypes) to tweak the compiler argument validation
Pseudotypes-like syntax :other possible syntax :
Usage:
But there's no keywords (like Pseudotypes) to tweak the compiler argument validation
Pseudotypes-like syntax :
Code: Select all
Procedure.i Test(*a.p-Array, *b.p-Map, *c.p-List) : EndProcedure
Code: Select all
Procedure.i Test(*a-Array, *b-Map, *c-List) : EndProcedure
Code: Select all
Procedure.i Test(AsArray *a, AsMap *b, AsList *c) : EndProcedure
Code: Select all
Procedure.i ConcatArray(*Array1.p-Array, *Array2.p-Array, *ResultArray.p-Array)
EndProcedure
Dim a(1)
Dim b(1)
Dim c(0)
ConcatArray(a(),b(),c())
ConcatArray(a(),b(),foo) ;--> this will raise the exception "Bad parameter type : array is expected"