why ; ?
Nick Sabalausky
a at a.a
Thu May 8 10:58:02 PDT 2008
"Janice Caron" <caron800 at googlemail.com> wrote in message
news:mailman.556.1210267230.2351.digitalmars-d at puremagic.com...
> I wonder if it's possible to write a standalone tool that doesn't know
> or care about language grammar (except maybe some general rules about
> what constitutes a quote or a comment), that can freely convert
> between
>
> Lorem ipsum (dolor sit amet)
> {
> consectetur!(adipisicing)(elit, sed);
(snipped)
> magna(aliqua);
> }
>
> and
>
> Lorem ipsum (dolor sit amet):
> consectetur!(adipisicing)(elit, sed)
(snipped)
> magna aliqua
>
I actually like that idea a lot. Although I'd do it like this:
The first line of the source file is something that specifies the style that
the file "officially" uses (or, there's just one style that's always the
"official" one for the given language). Then, in the development
environment, you have a user setting for your style preference. Whenever the
"official" style and "user" style don't match, a conversion is performed
(via the compiler, or another universally standard command-line tool) on
every save and load. Or, better yet, a normal save just saves the "user"
version in a separate file, and the "official" version is only generated
when you want to compile.
The only potential drawbacks I see is that the converter MUST be very, very
reliable. Any bugs in the converter would destroy the whole point of using
whichever style you felt aided productivity. It would also have to be fast,
much faster than an actual compile.
More information about the Digitalmars-d
mailing list