[cgi-wiki-dev] Formatter API change proposal
Kake L Pugh
Tue, 25 Jan 2005 14:12:10 +0000
On tirsdag 25 januar 2005, 10:35, Kake L Pugh wrote:
>> And it feels wrong to me that information about the last input is
>> stored in the formatter. ?If you want to format something else before
>> you're done with the last thing, either the work is lost or you need
>> to create a new formatter, and that feels very wrong.
On Tue 25 Jan 2005, Kjetil Kjernsmo <firstname.lastname@example.org> wrote:
> If you format $foo->format("the *foo* of bar") you can always call
> $foo->title anywhere, so there is nothing lost there. If OTOH you want
> to $baz->format("barring _foo_"), yes you should create a new object, I
> see that as a good thing.
Your Formatter object isn't really a formatter then, though, it's more
of what I was getting at with the Parsed object idea. I think it is
confusing to have a Formatter be something other than a thing that
formats, and it's counter-intuitive to have Formatters not be re-usable.