|
|
hi,
the SDL2 design needs to have introspection facilities comparable to Tcl, or
better, ideally, I think. one feature we're all (I think) keen to see would be
a means to find out a variable's type.
so if I wanted to write a macro or procedure which takes one argument that could
be, say for a colour, a 3-vector, 4-vector, or a 5-vector.
ideally we'd have keywords, of course, but even a simple boolean function which
takes two arguments, a reference type and the variable to check, would do.
something like:
if (isType(<0,0,0,0,0>, arg))
// full colour.
elseif (isType(<0,0,0,0>, arg))
// rgbf or rgbt
....
with keywords would be neater, of course:
if (isType(v5type, arg))
// full colour.
elseif (isType(v4type, arg))
// rgbf or rgbt
....
(I'm not a language designer, as you can tell :-))
regards, jr.
Post a reply to this message
|
|