Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

The BBCode programming language

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)

{define {b} "<b>"}
{define {/b} "</b>"}


What do you think?

Name: Anonymous 2007-07-30 17:11 ID:O/OhtPpR

>>28
Lol. Seriously, how many times do you need "" and how cumbersome are they to escape (not to mention the quote hell that arises from escaping escaped strings and such ("\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"...."), versus how many times do you need unmatched { or }? Besides, I'm still supporting "", I'm just providing {} as an additional means of quoting for sane people.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List