|
|
In article <39cf0b83@news.povray.org>, Warp <war### [at] tagpovrayorg>
wrote:
> I don't even think that making a set of functions returing a bool value
> for this would be hard. For example:
...snip...
> For exampe isvector() would return true if the parameter is a vector,
> else false.
I have no idea how to code that, but it should be quite possible.
However, I think the first thing that would happen is that someone would
write a macro to put all those functions into one which returns a
different number or character for each type. Just one function should
work fine...
type_of(IDENTIFIER)
returns:
1-float
2-2D vector
3-3D vector
4-color
etc...
Then variables for each type could be put in a standard include...
// types.inc
#declare FLOAT = 1;
#declare VECTOR_2D = 2;
#declare VECTOR_3D = 3;
#declare COLOR = 4;
so you could just use this:
#if(type_of(MyIdentifier) = COLOR)
instead of:
#if(is_color(MyIdentifier))
Not only would it take less keywords, but it would be more flexible and
nearly as easy to use.(easier in some situations)
--
Christopher James Huff
Personal: chr### [at] maccom, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tagpovrayorg, http://tag.povray.org/
<><
Post a reply to this message
|
|