Name: Anonymous 2007-07-18 6:39 ID:PTojbCHk
This is for real. I'm considering writing a BBCode programming language, intended for use in message boards. It'd be backwards-compatible with the current BBCode, but it'd allow you to write ad-hoc programs that generate your post.
Basically, it'd be a LISP, with these four properties beyond the usual:
- Only you configure the opening and closing parens, which you can set to [].
- In the top level, any sequence of characters that is outside of any application (outside []) is evaluated as string (preserving whitespace and everything), and returned as is, except <, > and & are converted to HTML entities.
- The resulting post is the concatenation of everything that's evaluated at top level, which means you get everything in the top level outside [] and every string any functions you called returned. (Other types functions may return are converted to their canonical representation.) Function results may safely return HTML; their <, > and & are not automatically converted to HTML entities.
- When you apply a non-applicable or non-existent symbol, you get a string which consists of [, the symbol, and ], so that unrecognized tags are printed as is (which is the current behaviour in BBCode).
For example, this would define the [ b ] and [ /b ] for bold, assuming we're using { and } for open/close parens (used {} so that BBCode doesn't fuck it up)
What do you think?
Basically, it'd be a LISP, with these four properties beyond the usual:
- Only you configure the opening and closing parens, which you can set to [].
- In the top level, any sequence of characters that is outside of any application (outside []) is evaluated as string (preserving whitespace and everything), and returned as is, except <, > and & are converted to HTML entities.
- The resulting post is the concatenation of everything that's evaluated at top level, which means you get everything in the top level outside [] and every string any functions you called returned. (Other types functions may return are converted to their canonical representation.) Function results may safely return HTML; their <, > and & are not automatically converted to HTML entities.
- When you apply a non-applicable or non-existent symbol, you get a string which consists of [, the symbol, and ], so that unrecognized tags are printed as is (which is the current behaviour in BBCode).
For example, this would define the [ b ] and [ /b ] for bold, assuming we're using { and } for open/close parens (used {} so that BBCode doesn't fuck it up)
{define {b} "<b>"}
{define {/b} "</b>"}What do you think?