POV-Ray : Newsgroups : povray.general : A painful lesson regarding function arguments. u=x, v=y. : Re: A painful lesson regarding function arguments. u=3D3Dx, v=3D3Dy. Server Time
16 Apr 2024 16:59:12 EDT (-0400)
  Re: A painful lesson regarding function arguments. u=3D3Dx, v=3D3Dy.  
From: Bald Eagle
Date: 29 Sep 2021 19:35:00
Message: <web.6154f77161e768d11f9dae3025979125@news.povray.org>
William F Pokorny <ano### [at] anonymousorg> wrote:
> On 9/29/21 5:25 PM, Bill Pragnell wrote:
> > This behaviour is kind-of warned about in the docs:
> >
> > http://www.povray.org/documentation/3.7.0/r3_3.html#r3_3_1_8_3
> >
> > ....although I must admit I didn't know this before your post, and I only
> > stumbled on that doc entry because I happened to be doing something with
> > functions recently too. One to remember!
> >
> > Bill (the other P)

(or: The other Bill P.)

I thought it might be amusing and instructive to write a function that really
mixes up the synonymous argument names, and maybe using ones not invoked in the
function call - have you tried that experiment?

> I think it'd be better to flag these argument issues as a problems
> during parsing, but I'm not sure at the moment how to do it.
>
> Bill P.

When an argument gets tokenized, can you flag it as "set", and then issue a
warning when it gets tokenized again that the previous value is being
overwritten?


PS


I would also like to see some warnings on vector expansion, since missing a
comma often inadvertently sends a 2-component vector to the parser rather than
the intended 3-component one.
<2, -3, 0> might be coded as <2 -3, 0>, leading to <-1, 0> which then gets
expanded.


Post a reply to this message

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