POV-Ray : Newsgroups : povray.bugreports : 3.8 macro parsing errors : Re: 3.8 macro parsing errors Server Time
27 Jul 2024 07:52:29 EDT (-0400)
  Re: 3.8 macro parsing errors  
From: Bald Eagle
Date: 26 Jun 2024 10:55:00
Message: <web.667c2aed18d864b572a1419a25979125@news.povray.org>
I got sidetracked onto something else so I didn't try any of this out (yet).

What I did do is snare myself into the whole pass-by-reference trap when trying
to run a macro in a loop.

https://news.povray.org/povray.advanced-users/message/%3C63dd9c26%241%40news.povray.org%3E/#%3C63dd9c26%241%40news.povr
ay.org%3E

This is very sneaky, and even though I'm aware of this problem, it still didn't
register when I was trying to debug my code, and it only dawned on me this
morning that this is what was happening.
I went through all of my code and was trying to find why my loop counter wasn't
incrementing, and I was stuck in an infinite loop.  My debug statement
overloaded the text stream, and I had to manually terminate the POV-Ray process
and restart nearly a dozen times before I fixed the problem.

Perhaps consider issuing a warning that an identifier is being passed by
reference, or some other mechanism to help fix, or better - avoid this problem
in the first place.

(Does anyone have any protective "wrapper" code to somehow alert that an
identifier is being passed into a macro that can be modified by the macro rather
than dummy/placeholder identifier?)

I also unconsciously engage in the bad habit of running loops from 0 to 1,
creating fractional loop counter values.  "Fractional loop counter value"
warning would be useful just to stay out of the weeds in some of the hairier
code.

- BW


Post a reply to this message

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