[REBOL] Re: Replacing placeholders?
From: tim-johnsons::web::com at: 8-Aug-2007 12:15
On Wednesday 08 August 2007, Carlos Lorenz wrote:
> I am afraid a cannot go further on advising you since I am not a heavy user
> of pdf-maker.
> Anyway are you using COMPOSE to evaluate data and surrounding them with
> parens as Tim said?
<blush> I've been extremely busy here and I've got a little time for this -
first - a disclaimer - I whipped up that code in preperation for
implementing it for a client. But my partner ended doing the functionality
with perl. Furthermore, I've deleted much of *this* thread from my mailer.
Let me suggest that you just play with compose for a bit, without your
target in mind. Just a have a bit of fun with it. What compose allows you to
do is to create a data structure, evaluate it as much as you like and
change values within that data structure targeted by parenthesis.
Since I am not myself an expert with compose, and if I don't write rebol for
a week, I get behind the curve even more, let me propose a problem and
perhaps the solution will edify me and help you:
Here's the problem, define a block with a parenthesized word and evaluate it
as a place holder
names: ["Tim" "Carlos" "Kai"]
== ["Tim" "Carlos" "Kai"]
>> template: [My name is (name)]
== [My name is (name)]
>> foreach name names[print compose template]
** Script Error: name has no value
** Near: name
;; I *don't* know the solution myself, but finding it will be most helpful for
;; both of us