POV-Ray : Newsgroups : povray.bugreports : Why does sphere { Object } work? : Re: Why does sphere { Object } work? Server Time
8 Oct 2024 07:32:44 EDT (-0400)
  Re: Why does sphere { Object } work?  
From: clipka
Date: 11 Nov 2018 14:37:28
Message: <5be884f8@news.povray.org>
Am 11.11.2018 um 15:20 schrieb Cousin Ricky:

> Yes, that was a poor choice of identifier name.  'MyObject' would have 
> been a better choice for this illustration.  It is not at all clear that 
> this was by design; the first line could have been:
> 
>    Object = box { -1, 1 translate -4 * z }
> 
> and it would still parse; but sphere { box } makes no sense, so why 
> should sphere { ArbitraryObject } be a deliberate design?

It is deliberate that `sphere { SphereObject }` works as observed. The 
fact that `sphere { ArbitraryObject }` also works is simply a side 
effect of how the former is implemented.

It is actually easier to implement this way, because to the parser all 
object variables look alike at first glance. Checking whether it is 
actually a sphere would be extra work, and besides it is guaranteed to 
have no ill side effects.

If it makes you more comfortable, simply consider `sphere` an alias for 
òbject` in this context.


Post a reply to this message

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