POV-Ray : Newsgroups : povray.pov4.discussion.general : Parse Strings : Re: Parse Strings Server Time
20 May 2024 00:05:58 EDT (-0400)
  Re: Parse Strings  
From: Le Forgeron
Date: 30 Nov 2007 12:20:18
Message: <47504652$1@news.povray.org>
Le 26.10.2007 17:32, Chambers nous fit lire :
> Nicolas Alvarez <nic### [at] gmailisthebestcom> wrote:
>> Name some. Maybe we don't need an eval()-like function, what we need is
>> other features so that we never ever need to use eval.
> 
> I want to tie various strings together using concat() and then evaluate it.
> 
> This is certainly possible by writing to temporary include files, but it
> would be simpler (and easier) for the artist to simply call parse (eval is
> already a keyword).
> 
> 
What about, then, having 'parse(str)' as a macro (or something else
?) which:
 1/ create a temp file named automatically
 2/ write str in the file
 3/ close the temp file
 4/ include the temp file

Please note, that with current implementation of #macro (and because
str might contains such), you cannot remove the temp file before the
end of the parsing.

It's a kludge, you will need a file-garbage-collector by the end of
parsing time, but it should be rather easy with the current parser.
-- 
The superior man understands what is right;
the inferior man understands what will sell.
-- Confucius


Post a reply to this message

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