POV-Ray : Newsgroups : povray.programming : Checking if identifier is undefined? Server Time
28 Jul 2024 14:32:56 EDT (-0400)
  Checking if identifier is undefined? (Message 1 to 3 of 3)  
From: Warp
Subject: Checking if identifier is undefined?
Date: 13 Dec 2000 10:11:22
Message: <3a379199@news.povray.org>
I want to make a function that takes an undefined identifier name.
  How do I check that the identifier name is valid and it's undefined, and
how do I create an array using that identifier name?

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):_;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: Warp
Subject: Re: Checking if identifier is undefined?
Date: 13 Dec 2000 10:19:33
Message: <3a379385@news.povray.org>
Thinking about it, I got a better idea.

  Instead of giving the function several undeclared identifiers, I'll just
make several functions, each one returning an array. This way the user
can #declare or #local his own identifier and give it the return value
of the function.
  Now I only have to figure out how to return an array...

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):_;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: Ron Parker
Subject: Re: Checking if identifier is undefined?
Date: 13 Dec 2000 10:22:58
Message: <slrn93f52k.1jj.ron.parker@fwi.com>
On 13 Dec 2000 10:11:22 -0500, Warp wrote:
>  I want to make a function that takes an undefined identifier name.
>  How do I check that the identifier name is valid and it's undefined,

Look at Parse_Ifdef_Param in tokenize.c.

>and
>how do I create an array using that identifier name?

Look at Parse_Array_Declare in tokenize.c to find out how to allocate the 
space and Parse_Declare and Parse_RValue in parse.c to see how to tie it 
to the identifier.

-- 
Ron Parker   http://www2.fwi.com/~parkerr/traces.html
My opinions.  Mine.  Not anyone else's.


Post a reply to this message

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