Module Headers and Quoting: The Final Verdict

So there's been a long historical fight on whether you need quotes on module header fields...:

Rebol [
    Title: {Your title here}
    Type: 'Module
    Name: 'Your-Module-Name-Here

...or if you don't, and you can just say:

Rebol [
    Title: {Your title here}
    Type: Module
    Name: Your-Module-Name-Here

This wasn't a tremendously huge problem in historical Rebol, because the standard fields did not take WORD! types. The issue was on the rise with the Type: and Name: fields in modules.

While I have flipped back and forth on which I support, I have never flipped on the idea that this has to be a standardardized.

But today, I think my verdict on which way to go is pretty clear.

Just Say No! (To Ticks In Unevaluated Contexts)

It's visual pollution that serves no purpose.

Really, this is a dialect in a BLOCK!. It uses SET-WORD!s. It is not an OBJECT!.

You can make an object out of it, but you need to be careful about it. Not only do you not have to evaluate module headers, you should not evaluate module headers.

It seems to me that the TO OBJECT! conversions can handle this; it fits the bill of my rule of TO not doing evaluation. So the old "CONSTRUCT" operation can go.

Exception: When Quotes are Part of the Dialect

If you come up with your own header field, used for your own script type's purposes, use quotes if you want...if the quoting has meaning.

Maybe you have some kind of generic thing like initial-value: up top in the header. And that can be ANY-VALUE!, so anything you want to run a test on--for instance. If you have:

Initial-Value: '''''<foo>

Then that's fine. But for fields like the module's type, there is no such distinction in meaning intended by 'Module vs. Module. So that's different.


I will also add that I think Type: module looks better than Type: Module.

Discussion of the capitalization of the keys is something that needs study as well. But it seems to be following email header conventions... e.g. From: bob@wherever

The script library doesn't really enforce any consistency on these points, but right side words are pretty much always lowercase.

1 Like

Well no capitalization is fine. Next thing would be CamelCase.
type: module
looks even better.

This is worth talking about, especially in light of the question of if binding is going to wind up being case-sensitive.

I have a hard time telling if I actually prefer the capitalization or am just used to it. :-/

For the moment there are bigger things to focus on, but this will have to be reasoned about someday.