User:Wnt/Templates

From Wikipedia

Links:Lua/Scribunto resources useful for making templates[edit]

List of bullshit expressions in the Lua reference manual[edit]

Any of this might be wrong; I'm just testing by trial and error since I don't understand the language. (I mean, the language the manual is written in)

  • "Syntactic sugar" apparently means synonym. i.e. providing a.name as syntactic sugar for a["name"] this indeed delivers "testing 1 2 3".
  • var ::= prefixexp `[´ exp `]´ and such pseudo language ... still trying to figure that out, though I assume it's just saying an array looks like a[b]?
  • Any example involving "print()" will fail.

Hello World[edit]

Testing instructions at [1] "Getting started". Appears to work:

Sandbox[edit]

Parameter passing[edit]

Mandelbrot[edit]

For some reason this doesn't look like much of a Mandelbrot - more iterations don't help much (if at all); my guess for now is that the precision of the floating point numbers just isn't good enough. I was daydreaming of having it in a table form where you could click on one pane of the Mandelbrot to expand it - but if there's a way to make the output contain on-the-fly generated text that then gets sent back INTO #invoke as parameters, I haven't thought of it.

Plotter[edit]

Lesson learned - parameters start off as strings but can be "coerced" (translated) to numbers by adding them "+ 0".

Svgedit[edit]

Note: A way to access the actual "file" of the SVG and pass it to a template would be very useful - there's no way that I know of to make the content of [2] a template parameter. Wnt (talk) 06:09, 4 September 2012 (UTC)