POV-Ray : Newsgroups : povray.unofficial.patches : Initial povr branch keywords id_type() and id_types_match() : Re: Initial povr branch keywords id_type() and id_types_match() Server Time
28 Apr 2024 06:31:12 EDT (-0400)
  Re: Initial povr branch keywords id_type() and id_types_match()  
From: jr
Date: 28 May 2021 03:50:00
Message: <web.60b0a043827c6b0779819d986cde94f1@news.povray.org>
hi,

William F Pokorny <ano### [at] anonymousorg> wrote:
> On 5/27/21 2:08 AM, jr wrote:
> > ...
> >> As implemented it's a stand alone bit of code.
> >
> > that is good.  (afaict)  so it could be issued as a patch to the 3.8.0-alpha?
>
> Could be. Yes.

nice.


> ...
> > supported by a similar function which returns an 'array mixed' with the various
> > "properties"/categories broken out?
>
> What I've not done for arrays vs mixed arrays as yet is look for a
> method 'like' that employed to break out a few of the object types like
> light sources(1). The object flags popped into my head on Tor Olav's
> question.

I put this badly.  meant that 'is_type()' probably "will do" for most use cases,
and so perhaps a complementary function (eg) 'is_type_details()' which returns
an array mixed, where the various flags are used to distinguish one ("390")
object from another.


> Even without getting different type ids for arrays vs mixed arrays today
> from id_type, you can walk a mixed array asking about the types for each
> element and in that way via SDL looping (or your foreach work) build up
> what types in total are seen for any given the mixed array.

not sure I really understand.  if some macro expects an array mixed parameter,
say {3-vect, string, bool}, I do not know of a "safe" way to check all three.
for instance, whether I use 'strlen(string)' or similar, if it's not a string,
POV-Ray will "intervene".  (did I misread?)

(and the (snipped) macro examples too, while safe to use, would not allow me to
catch (as in handle with own error message) the eventual "odd" value, I think)


regards, jr.


Post a reply to this message

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