|
|
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
|
|