[REBOL] Re: Replacing placeholders?
From: tim-johnsons:web at: 8-Aug-2007 13:03
On Wednesday 08 August 2007, Tim Johnson wrote:
> 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
:-) Oh, I couldn't help myself:
solution is:
>> foreach name names[bind template 'name print form compose template]
My name is Tim
My name is Carlos
My name is Kai
----
Tim