This is something I've had churning in my mind since I first saw Type: 'index
on a RebSite index: if a Rebol header has a TYPE value, it generally doesn't contain your regular DO code (some do—modules, for instance).
What if when you DO a script that has a TYPE value, it passes it on to a handler for that type? Presumably in the above example, you'd open a Rebsite viewer, or return a block of items in the index.
That's great if your TYPE is already registered, but if you call a script from SHELL:
ren-c script-in-my-own-dialect.reb
Then you'd have no way to register a handler. Unless even custom scripts could use a NEEDS header:
Rebol [
Title: "A Book"
Type: 'epub
Needs: [%epub-dialect-handler.reb]
]
some dialect stuff
manifest [
* %some.html
* %content.html
%files.html
]
Shell -> HTML, could be CGI too:
#!/usr/local/bin/ren-c
Rebol [
Title: "My Web Page"
Type: 'lest
Needs: [%lest.reb]
]
head
title "Hello World!"
body
h1
either (now/time < 12:00) "Good morning" "Good afternoon"
" 🌎🌍🌏."