For people reading this thread who are more softcoders, a situation that came up in the Evennia IRC channel:
In order to embed functions, you currently need to type {function( args )
. Since my text editor wants to close all brackets, braces, parens, and so forth I suggested another character. They were already thinking about |function( args )
, which while I think is better I don't think is very legible. For example:
This is a test|testfunc( me )...
I suggested fully enclosing for functions. The above might be:
This is a test|testfunc( me )|...
Someone mentioned brackets [], and as a Mush coder, this hit a happy spot. The above would end up:
This is test[testfunc( me )]...
However!
Evennia's lead designer wants a single token to mean all inline substitutions, both ANSI and functions. ANSI color codes would use the same inline token. For example: {r
for red, {B
for blue background, and so forth.
Why is this a problem? Because ANSI color codes would become harder to type if brackets [] were used. I mean, imagine typing this:
[r][h][B]This is really ugly text.[n]
Eugh, no. This would be a lot easier for everyone:
|r|h|BThis is really ugly text.|n
What I've pitched is a mix of both. @Griatch already knows this, so I'm pitching this to the rest of you, whether or not you're a real-world-coder or a Mush/Mux coder. What do you think of:
|hThis is hilited text!|n
|[500This is xterm256 red.|n
[rhB]This is really ugly text.|n
But [get_random_word( this|that|it, | )] is easier-to-read code.
While Griatch thinks about this, I'm wondering what future softcoders might think, and how current realcoders might react.
advanced note
In Mushcode, '%' is the prefix to 'substitution code', such as %n
(enactor's name) or %xr
(ansi red) or %va
(the @va attribute). It provides flexibility and shorthanding. IMO, Evennia's {<ansi color code>
is also shorthanding. What I don't know is if my understanding of Mush's % is biasing me toward a better solution.
I know I imagine that Evennia might allow me to code my own substitution code, such as: ||n
or ||va
or ||o
instead of [name( you )]
or [v( a )]
or [obj( you )]
respectively.
(note, obj() is for the objective form pronoun: him, her, it, them)
Thanks!