POV-Ray : Newsgroups : povray.general : select, is this logical? : Re: select, is this logical? Server Time
29 Apr 2024 03:32:37 EDT (-0400)
  Re: select, is this logical?  
From: John Greenwood
Date: 4 Oct 2016 05:00:01
Message: <web.57f36e83df9cd0bfa7cafab50@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:
> Am 03.10.2016 um 14:06 schrieb John Greenwood:
> > The first parameter of the select function acts as a logic switch
>
> No, it absolutely positively does _not_.
> With the `select()` function implemented as a threshold switch, there
> would be _no way whatsoever_ to have it also behave consistently as a
> boolean switch. Remember that wherever a boolean is expected, _any_
> non-zero value is interpreted as `true`, not just positive values.
>
> So in a way it is rather fortunate that `select()` behaviour does _not_
> happen to match the behaviour expected of a boolean switch for both
> `true` and `false` input values, as that might lead people to
> erroneously expect boolean switch behaviour for other input values as
> well where it absolutely positively cannot be supported.

Ah. I understand. Thanks for the clear explanation.


Post a reply to this message

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