POV-Ray : Newsgroups : povray.pov4.discussion.general : SDL2 : SDL2 Server Time
22 Jan 2025 06:04:36 EST (-0500)
  SDL2  
From: jr
Date: 13 Jan 2025 11:30:00
Message: <web.67853e8e1b740bc5f3dafc4d6cde94f1@news.povray.org>
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

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.