Home   Archive   Permalink



Dialect Object Model sequence type.

Hello Rebolers,
    
Maybe this is to Nick or Kaj, but the question is open to anyone willing to reply. All opinions are welcome.
    
At www.rebol.org/view-script.r?script=rebol-dom.r you will notice the idea of using "{}" as a sequence to be used along side the Rebol Series type.
    
It's to represent serialized data that shouldn't necessarily be loaded or allowed to be presented in block form due to illegal delimiters.
    
Although the %Rebol-Dom.r Var is just a Sequence prototype, it does work.
    
So my question is, what exactly do some expect from a map! object! in Rebol/Red? I've read so many complaints of dissatisfaction, and conversations abandoned on suggestions of improvement, I'm just wondering if anyone has nailed down those details in stone yet.
    
My intention is to use Sequence as a goto data structure. That's just simple molded data/code by the way. That is not only parsed and searched by index and key/value, but also as set builder notation and relative expressions in dialect form.
    
That pretty much can be anything, but i need an idea of some of the basic map! object! functions some others would be expecting to be there before they would say this idea is a no starter. Too dumb, confusing, i ain't using it.
    
In the spirit of javascript objects and associative arrays, with a twist of linked lists and auto destructuring we have a usable Sequence data structure in prototype form.
    
How would Rebolers who have warmed up to dialects expect it to function out of the box?
    
I'm thinking more and more like the JS object.
    
Any thoughts?
    


posted by:   Inetw3     30-Nov-2021/14:39:42-8:00



I'm not really sure where you want to go. Do you mean the {} string! type being used for HTML fragments that aren't LOADable into more specific REBOL types?
    
That's always a fallback, of course, and you can certainly use string parsing to detect structure in larger strings. But in general, the REBOL concept is to write a parser that converts outside data to REBOL types. After that, it's much more efficient to process.
    
map! was added in REBOL 3 to be more flexible with keys that aren't words, so you can likely use it for this purpose. In Red, map! has been very buggy over the years. I haven't used it terribly much, but I haven't had problems with it in REBOL.

posted by:   Kaj     1-Dec-2021/7:56:20-8:00



Name:


Message:


Type the reverse of this captcha text: "r i d - p t f s m"



Home