|
|
ingo <ing### [at] tagpovrayorg> wrote:
> in news:web.6067a28edb16780d6f19eb189db30a9@news.povray.org Tor Olav
> Kristensen wrote:
>
> > I'm sorry, but I have no recollection of such a feature.
>
> Maybe it was this "abuse" I was thinking of:
>
>
> #declare Ramp = function(Freq, Tick, SRate){
> mod(Tick, SRate/Freq) * (Freq/SRate)
> }
>
> #declare TriOsc = function(Freq, Amp, Tick, SRate) {
> #local TriSelect = function(R) {
> select(
> R - 0.25,
> R,
> select(
> R - 0.75,
> 0.5 - R,
> R - 1
> )
> )
> };
> 4*Amp*TriSelect(Ramp(Freq,Tick,SRate))
> };
>
> It adds nothing but keeping the functions together in one block,
Well, that code added more than nothing for me:
It added a moment of confusion.
I would not recommend writing it like that. The most important reason is that it
could lead new POV-Ray users to believe that the variable that holds the
TriSelect function is local to the TriOsc function.
My understanding is that it is only local to the file that holds this code.
--
Tor Olav
http://subcube.com
https://github.com/t-o-k
Post a reply to this message
|
|