With FENCE! existing, I think it's a given that anything that reuses {}
needs to have the delimiter on both ends. Not only is it an important visual cue after a long read to know you're not dealing with a fence, but it gives you the benefit of not having to escape lone }
.
Rebol [
Title: "Your module title here"
Type: module
Name: your-module
Rights: #{
Copyright 2012 REBOL Technologies
Copyright 2017-2021 Ren-C Open Source Contributors
}#
License: #{
Licensed under the Apache License, Version 2.0
See: http://www.apache.org/licenses/LICENSE-2.0
}#
Description: #{
Note this reclaims the benefit of braces not escaping:
printf("The char is } and it need not be escaped\n");
So that's good.
}#
]
To my eyes, that's rather abrasive to be using for a very common string type. Definitely more abrasive than <{...}>
. And it leaves us without a representation for BINARY!, e.g. #{DECAFBAD}
Rebol [
Title: "Your module title here"
Type: module
Name: your-module
Rights: <{
Copyright 2012 REBOL Technologies
Copyright 2017-2021 Ren-C Open Source Contributors
}>
License: <{
Licensed under the Apache License, Version 2.0
See: http://www.apache.org/licenses/LICENSE-2.0
}>
Description: <{
Note this reclaims the benefit of braces not escaping:
printf("The char is } and it need not be escaped\n");
So that's good.
}>
]
But if the goal is "distinguishibility but slightness", you can't get too much more slight than -
.
Rebol [
Title: "Your module title here"
Type: module
Name: your-module
Rights: -{
Copyright 2012 REBOL Technologies
Copyright 2017-2021 Ren-C Open Source Contributors
}-
License: -{
Licensed under the Apache License, Version 2.0
See: http://www.apache.org/licenses/LICENSE-2.0
}-
Description: -{
Note this reclaims the benefit of braces not escaping:
printf("The char is } and it need not be escaped\n");
So that's good.
}-
]
If that's too slight to the point of being "too fency", then = is another option whose sleek horizontalness doesn't break the visual flow as much...though it does certainly break the flow.
Rebol [
Title: "Your module title here"
Type: module
Name: your-module
Rights: ={
Copyright 2012 REBOL Technologies
Copyright 2017-2021 Ren-C Open Source Contributors
}=
License: ={
Licensed under the Apache License, Version 2.0
See: http://www.apache.org/licenses/LICENSE-2.0
}=
Description: ={
Note this reclaims the benefit of braces not escaping:
printf("The char is } and it need not be escaped\n");
So that's good.
}=
]
My use of === as a section divider leads me to not wanting to see something this heavy in such positions.
Red has adopted %{...}%
for "raw strings", e.g. those that you don't need to use escaping inside. Which compromises the FILE! string type %file.txt, which would want to use %{...}% for spanning spaced filenames I'd imagine.
I believe I agree with @giuliolunati that not using escaping makes the best default. if you wanted escaping, then maybe backslash is the way to go. Ugly, but it would call attention to the fact that you're using escaping...and you'd be able to notice if you took the escaping out and could drop the backslashes at that point.
Rebol [
Title: "Your module title here"
Type: module
Name: your-module
Rights: -{
Copyright 2012 REBOL Technologies
Copyright 2017-2021 Ren-C Open Source Contributors
}-
License: -{
Licensed under the Apache License, Version 2.0
See: http://www.apache.org/licenses/LICENSE-2.0
}-
Description: -\{
Note this reclaims the benefit of braces not escaping:
printf("The char is } and it need not be escaped\n");
So that's good. And here we can do \n\n\n for escaped lines.
}\-
]
I'm not using just \{...}\
because I imagine this as a family of escaped strings %\{...}\%
, so you'd need to know which it is. It also counterintuitively looks better with the -.
Rebol [
Title: "Your module title here"
Type: module
Name: your-module
Rights: -{
Copyright 2012 REBOL Technologies
Copyright 2017-2021 Ren-C Open Source Contributors
}-
License: -{
Licensed under the Apache License, Version 2.0
See: http://www.apache.org/licenses/LICENSE-2.0
}-
Description: \{
Weirdly this does not look as good, despite dropping a character.
printf("The char is } and it need not be escaped\n");
So that's good. And here we can do \n\n\n for escaped lines.
}\
]
The slightness argument makes the -{...}-
and -\{...}\-
idea actually kind of compelling to me. It wouldn't cause confusion with TAG! (and would leave <{...}>
and <\{...}\>
as an option for a tag that wouldn't need to escape > inside of it.)
It's a pattern which could be used with quoted strings too.
>> print "I'm a \n not escaped string"
I'm a \n not escaped string
>> print \"I'm an \nescaped string"\
I'm an
escaped string
>> print -"I'm a quote " safe string"-
I'm a quote " safe string
>> print -\"I'm a quote " safe\nescaped string"\-
I'm a quote " safe
escaped string
Gives you options. -{"}-
isn't a fantastic way to say "single quote" but it's better than -"""-
and definitely better than \"\""\
The BINARY! representation contention with TOKENISSUECHAR! (whatever that thing is) bothers me. I'd imagine like #{"}#
as a single character for quote, and #"{"#
as a single character for brace, with things like #a and #b just standing on their own since there are no spaces or irregular letters.
But we've kind of run out of symbols at this point... what does #{DECAFBAD} become to be a binary? There'd still be &"..." and $"..." I guess (not fence forms like &{..} and ${ }). It's up to you whether to put a closing "& or "$ on that, since $ and & and other escapable things aren't legal inside binaries.
Or angle brackets with a decorator. $<DECAFBAD>
is actually a pretty respectable looking BINARY!. And it leaves #< and #> for the characters of less than and greater than (assuming we don't get so saturated that #<>
needs to be something, but maybe that's looking like a bad assumption).