Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: Is Rebol OO?

From: AJMartin:orcon at: 24-Jan-2004 11:47

> JC> Designing Rebol dialects is not easy. > > Agreed 100%. > > Good post. Every time dialects come up this way, it makes me think, and
re-think, how I want to explain them to people, why I think they're important, etc. So, thanks! I totally agree. I keep revising my dialects to better fit the domain and to be easier to use. For example in my earliest version of ML dialect, I started off by using functions and their arguments, like this for generating a list of items: List: func [Type [word!] Items [block!]] [...] I discovered that this had the problem of having to be changed for each variety of HTML, WML and XML, plus it grew way too hard to maintain. It was also harder to learn than standard HTML, WML or XML, which was the reverse of what I wanted! Then I discovered how to use words themselves as the name part of tags, and using block! values to group content, along with using 'parse on block values. I expanded the words to use path! values to generate tags and 'compose/deep to insert outside values. My most version of ML which uses "<" and ">" matches better the domain of XML and allows very complex tags with name spaces like: foo:bar for each tag attribute. Rebol unfortunately can't handle two namespace attributes in a path value like:
>> X: 'x/foo:bar/ding:dong
== x/foo:bar/ding:dong
>> LENGTH? x
== 2
>> x/2
== foo:bar/ding:dong With "<" and ">" to group the tag, ML can be like this:
>> random/seed now >> RandomID: random 1234
== 859
>> From_Address: "Andrew's Example"
== "Andrew's Example"
>> print ML compose/deep [
[ < stream:stream [ xmlns:stream http://etherx.jabber.org/streams [ id (RandomID) [ xmlns jabber:client [ from (From_Address) [ > [ [ "My content goes here! " [ "plus any other content!" [ ] [ ] <stream:stream xmlns:stream="http://etherx.jabber.org/streams" id="859" xmlns="jabber:client" from="Andrew's Example">My content goes here! plus any other content!</stream:stream> -- Andrew J Martin ICQ: 26227169 http://www.rebol.it/Valley/ http://valley.orcon.net.nz/ http://Valley.150m.com/