[REBOL] Re: Parse refactoring puzzle
From: SunandaDH:aol at: 1-Aug-2003 11:44
Hi Joel:
> I understand that the intended "use-case" would shape the requirements
> of the function
Absolutely, -- and I am also cutting corners by producing a function that
does just what I need rather than a generic industrial-strength one.
For example, an industrial-strength clear-place-holders may need options to:
** only clear officially-sanctioned place-holders
** do "automatic" replacements for place-holders like !!date!! or
!!user-name!!
** report stray place-holders left over (because, for some applications, that
would indicate a serious error)
** behave differently depending on whether it is running test or production
(e.g. test pops up a message, production silently writes to an error log)
> I tend to have a "message (block of tag/value pairs, object, etc.) that
> represents only the (unformatted) content under construction,
That's a useful approach that doesn't really fit my case. For example, one
of my place-holders is:
!!dynamic-field!!
That gets replaced by a HTML table row with an input field _and_ another
!!dynamic-field!! place-holder. So the application uses this place-holder as it
trundles through the database to dynamically create input fields. At the end,
clear-place-holders, removes the !!dynamic-field!! place-holder. That's more of
a dynamic structure than might be easy with a fixed table at the start.
Hi Maxim:
> I have been following this thread silently, but now that steel is
> public I will give you a little primer on the remark.r tool.
I think if I was starting again, I'd definitely look at Steel or REBOL Server
Pages for HTML webpage creation. As it is, I've got a half-built set of tools
and a load of HTML templates using the !!xx!! schema, and I'm stuck with that
until I bite the bullet and refactor.
Thanks both for the ideas and encouragement!
Sunanda.