POV-Ray : Newsgroups : povray.pov4.discussion.general : Suggest v4.0 read only identifiers. (yuqk R15 v0.6.9.0) : Re: Suggest v4.0 read only identifiers. (yuqk R15 v0.6.9.0) Server Time
12 Oct 2024 18:06:55 EDT (-0400)
  Re: Suggest v4.0 read only identifiers. (yuqk R15 v0.6.9.0)  
From: jr
Date: 28 Jun 2024 04:45:00
Message: <web.667e777b4bc5dc75c7a7971d6cde94f1@news.povray.org>
hi,

"Bald Eagle" <cre### [at] netscapenet> wrote:
> Cousin Ricky <ric### [at] yahoocom> wrote:
> > On 2024-06-27 11:44 (-4), William F Pokorny wrote:
> > > Release R15 of the yuqk fork has an implementation supporting constant
> > > identifiers / macro parameters. They are indicated by using a leading
> > > '_' character in the name.
> >
> > I also agree with Ingo: a keyword or directive would be better, such as:
> >
> >   #const MagicNumber = 12345;
> >
> > I'm thinking a keyword modifier would be more flexible than a directive,
> > for example:
> >
> >   #declare const GlobalVal = 12345;
> >   #local const LocalVal = 54321;

"modifier", yes.  +1.


> Hmmm.   Yes, but maybe no?
> Why not just have another separate type of declaration?

the keyword modifier, more often than not I think, would be in close proximity
to the variable where/when it's used.  an advantage.


> ...
> So maybe #constant can ONLY be changed by specifically using another #constant
> directive.

if a variable's value can/will change "at runtime", #constant would simply be
misleading.


> I dunno - I'm not really a computer language person, but the pro's and cons of
> each approach ought to be hashed out with an eye towards Pov-Ray 4.0

maybe "4.x" could have a revamped "SDL 2.0", with more "introspection" tools, so
we can write better, "type safe" code.


regards, jr.


Post a reply to this message

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