POV-Ray : Newsgroups : povray.general : Problem with Parse_String and #ifndef : Re: Problem with Parse_String and #ifndef Server Time
4 Nov 2024 21:24:17 EST (-0500)
  Re: Problem with Parse_String and #ifndef  
From: Warp
Date: 10 Sep 2003 13:45:26
Message: <3f5f6336@news.povray.org>
It would be nice if the string parsing was an internal command which
could be used anywhere.
  I suppose #parse would be a good name. This way you could do things like:

#declare #parse(concat(name1, name2)) = 5;

  That is, the parser would take the string given as parameter to #parse
and parse its contents as if it was just plain text appearing at that place
in the file. This would certainly be handy for many things.

  (OTOH it accentuates the importance of I/O restrictions because it would
allow making extremely obfuscated SDL code.)

  I think one important feature of this #parse command that differentiates
it from other commands is that it should be possible to appear *anywhere*
in the code. Even though this is not strictly indispensable, it would
certainly make it more useful.
  That is for example this:

#de#parse("cl")are ab#parse("cde")fg = 5;

would be effectively the same thing as:

#declare abcdefg = 5;

  I don't know if this behaviour would be easy to implement in the current
parser, but just an idea...

-- 
#macro M(A,N,D,L)plane{-z,-9pigment{mandel L*9translate N color_map{[0rgb x]
[1rgb 9]}scale<D,D*3D>*1e3}rotate y*A*8}#end M(-3<1.206434.28623>70,7)M(
-1<.7438.1795>1,20)M(1<.77595.13699>30,20)M(3<.75923.07145>80,99)// - Warp -


Post a reply to this message

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