[WikiEN-l] MediaWiki is getting a new programming language

Steve Bennett stevagewp at gmail.com
Thu Jul 16 07:15:42 UTC 2009


On Wed, Jul 8, 2009 at 8:23 PM, Neil Harris<usenet at tonal.clara.co.uk> wrote:
> I find it rather difficult to understand exactly what you want here.
> Could you please give an example, even a rough one, of the sort of
> syntax you are proposing?
>
> For example, how would you write something like, say, this artificial
> example:
>
> {{#switch:
> {{#iferror: {{#expr: {{{1}}} + {{{2}}} }} | error | correct }}
> | error = that's an error
> | correct = {{{1}}} + {{{2}}} = {{#expr: {{{1}}} + {{{2}}} }}}}
>
> in your new notation?

Oh, this is so easy in MOO code[1], it's not funny:

{{`tostr(args[1], " + ", args[2], " = ", args[1] + args[2]) ! ANY =>
"that's an error"'}}

(yes that's a backquote at the start and a normal one at the end.
Semantics of "+" may differ from what you intended.)

In VB.NET:

{{Try
    Return Arg1 & " + " & Arg2 & " = " & Arg1 + Arg2
  Catch e as Exception
    Return "that's an error"
  End Try}}

(Ok the typing is probably wrong.)

Steve

Steve
[1] http://www.armory.com/~gergen/ProgrammersManual.html



More information about the WikiEN-l mailing list