[Date Index][Thread Index]
[Date Prev][Date Next][Thread Prev][Thread Next]
Idea how not to need future enhancement of WML - Environment
- From: Matthias Bernhardt <nospam@thanx>
- Date: Mon, 3 Jul 2000 22:29:42 +0200 (MEST)
On Sun, 25 Jun 2000, Franz Knipp wrote:
FK> Imagine the following tags, defined by <define-tag>:
FK>
FK> <red:text>
FK> <red:box>
FK> <red:picture>
FK>
FK> <blue:text>
FK> <blue:box>
FK> <blue:picture>
FK>
FK> Further we think of the following complex tags:
FK>
FK> <red>
FK> <blue>
FK>
FK> The following is an example of a wml page:
FK>
FK> <red>
FK> <red:box>
FK> <red:text>This is a little text</red:text>
FK> </red:box>
FK> <red:picture src="foobar.png">
FK> </red>
FK>
FK> <blue>
FK> <blue:box>
FK> <blue:text>This is another text</blue:text>
FK> </blue:box>
FK> <blue:picture src="foobar.png">
FK> </blue>
FK>
FK> **** And now the proposed changes:
FK>
FK> <red> and <blue> are defined as so-called environments. That means (in a
FK> LaTeX-thinking way), that inside of an environment the meaning could be
FK> different. The previous example could be written with <red> and <blue>
FK> defined as environments:
FK>
FK> <red>
FK> <box>
FK> <text>This is a little text</text>
FK> </box>
FK> <picture src="foobar.png">
FK> </red>
FK>
FK> <blue>
FK> <box>
FK> <text>This is another text</text>
FK> </box>
FK> <picture src="foobar.png">
FK> </blue>
FK>
FK> This way we can offer a syntax more like OOP - the name of the `methods´
FK> (<box>, <text>, <picture>) remains to be the same in different `objects´
FK> (<red>, <blue>).
FK>
FK> Do you get the idea? I see a lot of benefits (smarter writing, changed
FK> behaviour depending on the context, ...) and no disadvantages (because it
FK> is fully backward compatible).
Don't make WML too complicated. You can already get what you
want, if you just define the tags like this:
<define-container red>
<preserve color>
<set-var color=red>
%body
<restore color>
</define-container>
<define-container text>
<font color="<get-var color>">%body</font>
</define-container>
The other entities would be quite like that. Please don't blame
me for using the <font>-tag, it's just an example ...
Surely it's a bit more complicated but after those last weeks of
detail discussions how to implement that new mp4h stuff, I'm
afraid this list would turn into a OOP-principles-lounge if
that's gonna be implemented, too. So please consider using that
"workaround" instead of making wml objective.
Greets, Matthias
----------------------------------------------------------------
http://www.guxhagen.net/matthb/ mailto:matthb@guxhagen.net
______________________________________________________________________
Website META Language (WML) www.engelschall.com/sw/wml/
Official Support Mailing List sw-wml@engelschall.com
Automated List Manager majordomo@engelschall.com