User talk:Kylu/qif
From Wikipedia, the free encyclopedia
[edit] Expanded
Here's my stab at expanding it out and explaining what it does. Thing to keep in mind: this (ab)uses parameter default extensively.
{{{else{{{test|}}} # see note #1 |{{{test{{{test|}}} # see note #2 |{{{then|}}} # see note #3 }}} }}}
- If {{{test|}}} is non-blank, it'll change the {{{else|...}}} into a call to {{{else<{{{test}}}>}}} (so if {{{test}}} is set to "Foo", it'll turn into {{{elseFoo}}}). As there'd obviously be no parameter passed named {{{elseFoo}}}, the default parameter text (the text to the right of the | (pipe)) is equated next. On the other hand, if {{{test}}} were blank or undefined, the {{{else}}} text would be displayed and processing would stop here. If {{{else}}} were also blank, we'd keep going and process the text to the right of the pipe.
- This is a check to see if {{{test}}} is blank or non-blank. It's the exact same logic as the item above, except it's checking itself and not {{{else}}}. This works with the previous check in the event {{{else}}} was blank/empty; if {{{test}}} and {{{else}}} are both blank, then the default parameter for {{{else}}} is blank.
- If the {{{test}}} check in the previous step determines it's non-empty, then the {{{then}}} text is displayed (if any).
(I wasn't sure if what you had on the main page made sense to you or not, heh). —Locke Cole • t • c 02:55, 1 May 2006 (UTC)
- I'm not too sure now either. Maybe I should stick to BASIC... :D
- I thought I had it figured out (I broke it down to one-function-per-line-max like I do in C) and I think we're describing the same steps, but there's something different that doesn't quite match... I can't put my finger on it yet. I probably should've tried learning some easier wikitemplatemagic first...
- Oh, hey, does the userpage show me having learned anything yet? I'm hoping for it to not look too terribly cluttered, but I could use some imput maybe.
- ~Kylu (u|t) 05:17, 1 May 2006 (UTC)
-
- Actually, I noticed I missed some stuff. Lemme try and fix it up. Though it's only getting more complicated from here on out (this way lies madness). =) Re: breaking it down to one-function-per-line; the multiple curly braces are so misleading. It might be easier if you swap them for something else entirely (like "{{{" -> "[" and "}}}" -> "]") since they're all grouped in threes (because everything in the "code" is a reference to a parameter).
-
- Re: the userpage, looks like the right combination of funny/serious/informative. Though, and this is probably just years of paranoia finally catching up with me, you probably shouldn't have so much linkage to "more about me"-type stuff. If you're ever involved in any kind of conflict, people tend to get mean from time to time. :P Wikipedia may make the internet not suck (to quote Herr Wales), but it doesn't stop the people who suck from being on the internet. ;) —Locke Cole • t • c 05:54, 1 May 2006 (UTC)