Good to know that there's an easy way to resolve the template-vs-inline
parameter collision issue without resorting to mandatory prepended hash
marks.  Still, it would be nice to have a way to minimize the chances of
such parameter collisions.  More on this below.

Van de Bugger <van.de.bug...@gmail.com> wrote:

> Regarding the other stuff... I think a "personal" template for each
> printout statement my be overkill... However, I do not like numbered
> placeholders as well. We already have /names/ of properties, why don't
> use them? For example:
>
> {{  #ask: [[Category:City]] [[Area::+]] [[Population::+]]
>    |   ?Population=Inhabitants
>    |   ?Area#km²=Size in km²
>    |   format=inline
>     |   inline={{{Population}}} people squeeze into the {{{Area}}} of
> {{{City}}}.
>    |   limit=3
> }}
>
> Van.
>

I tend to prefer named parameters to positional ones, myself.
Unfortunately, the template result format has set the precedent of using
positional parameters; and changing it over to named parameters just isn't
feasible.  For reasons of consistency, I'd rather have an inline result
format that apes the template result format as much as possible; it makes
it easier to convert between an inline result format and a template result
format: so if I find that I've been using the same inline result format in
a bunch of different #asks, I can create a template out of one of the
inlines with little effort.

That said, is there a reason why the template result format can't be
changed to allow for both?  That is: where ?Population is currently passed
in to a template result format as {{{1}}}, could it instead be passed in as
*both* {{{1}}} *and* {{{Population}}}?  Where named placeholders have the
virtue of being clear, numbered placeholders have the virtue of being
brief; and this would let the writer of the template choose which one he
values most.  Or would this be needless overhead?

I mentioned before the idea of an inline result format aping the template
result format.  I also mentioned that I'd like to minimize the chances of
collisions between inline parameters and template parameters.  Using named
parameters is useful in this regard, because the set of inline parameter
names stands a good chance of being different from the set of template
parameter names - whereas numbered placeholders are virtually guaranteed to
collide.  But maybe there's another option: for inline parameters, prepend
the placeholder with, say, a question mark, and do this whether the
placeholder is named or numerical.  In this case, the situations flip:
numbered placeholders become virtually guaranteed *not* to collide, making
named placeholders the more likely source of collisions.

This is similar to my original proposal in that it seeks to avoid
collisions by tweaking the inline names in a way that the template names
are unlikely to duplicate; it differs in that the nature of this tweak is
something that could be incorporated directly into the inline parameter's
identifier, eliminating the need for a MW hack to cope with inline
parameters:

{{  #ask: [[Category:City]] [[Area::+]] [[Population::+]]
   |   ?Population=Inhabitants
   |   ?Area#km²=Size in km²
   |   format=inline
    |   inline={{{?2}}} people squeeze into the {{{?3}}} of {{{?1}}}.
   |   limit=3
}}

or:

{{  #ask: [[Category:City]] [[Area::+]] [[Population::+]]
   |   ?Population=Inhabitants
   |   ?Area#km²=Size in km²
   |   format=inline
    |   inline={{{?Population}}} people squeeze into the {{{?Area}}} of
{{{?City}}}.
   |   limit=3
}}

...depending on whether you're looking for brevity or clarity.

--

Going back to Dan Bolzer's original proposal: I'm wondering if inline
result formats might be a decent *replacement* for said proposal, in the
interest of keeping things as lightweight as possible.  That said, they do
serve slightly different purposes: Dan's proposal allows for formatting on
a field-by-field basis, within the context of whatever result format is
chosen for the overall #ask, whereas my proposal simply provides another
possible context for the result format.  That is, Dan's proposal lets you
format ?Population without regard to whether the results will be presented
as a table, a bullet list, a set of comma-delimited values, or something
else; whereas my inline result format would not format ?Population at all.

So: assuming that both get implemented, I'd like Dan's proposal to use
inline templates instead of a template name, with the sole parameter being
passed in as something like {{{?0}}} or {{{?this}}}:

{{#ask: [[Category:City]] [[Area::+]] [[Population::+]]
  | ?Population=Inhabitants # {{{?this}}} people
  | ?Area#km²=Size in km²
  | format=inline
  | inline={{{?Population}}} squeeze into the {{{?Area}}} of {{{?City}}}.
  | limit=3
}}

or:

{{#ask: [[Category:City]] [[Area::+]] [[Population::+]]
  | ?Population=Inhabitants # {{{?0}}} people
  | ?Area#km²=Size in km²
  | format=inline
  | inline={{{?2}}} squeeze into the {{{?3}}} of {{{?1}}}.
  | limit=3
}}

-- 
Jonathan "Dataweaver" Lang
------------------------------------------------------------------------------
Get your Android app more play: Bring it to the BlackBerry PlayBook 
in minutes. BlackBerry App World&#153; now supports Android&#153; Apps 
for the BlackBerry&reg; PlayBook&#153;. Discover just how easy and simple 
it is! http://p.sf.net/sfu/android-dev2dev
_______________________________________________
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel

Reply via email to