Rene Rivera wrote:
> Joel de Guzman wrote:
>> I realize that punctuation templates will be more important.
>> Right now, we are allowing single-char punctuations as template
>> IDs. Maybe we should also allow multiple punctuation marks?
>> Example:
>>
>> [template !![arg] some-[arg]-here]
>
> Is there a reason to limit the identifier in the first place? I can
> think it might be nice to have punctuations combined with alpha numeric
> for specifying variants of a class of templates. For example in the same
> literate style docs, of designating test cases:
>
> [compile c++
> return true; // always passes
> ]
>
> [!compile c++
> return if (false); // always expected syntax error
> ]
>
> [!run c++
> return false; // always expected fail
> ]
Indeed. Good point. I tried to limit the template identifier partly
because it was an offspring of the macros which were *too* powerful
(e.g. :-) is a valid macro). I feared that it (macro) might be causing
some processing problems, so later, I suggested using ugly naming
conventions like __macro__ to avoid over-eager macro substitution.
OTOH, templates are well behaved because unlike macros which are
bare (naked), you need to enclose templates inside the [].
At the very least, I'd disallow:
1) white spaces
2) brackets (of course)
3) the double dot separator (or any single dots for that matter
because I intend to use that for scoping; which leads to an
issue...)
Another reason for over-constraining is that it is always easy to
add than to remove; it is always easier to lessen than to increase
the restriction. If we are restricting IDs to alpha and single char
IDs now, we can easily allow more later. OTOH, if we allow,
say, unconstrained mix of any printable chars, it would need
deprecation to disallow some exceptions in the future (the dot
scoping for example, or other unforeseen uses).
So, while I'm not against expanding the character set of the template
identifier, I'd say that it should be approached with extreme care,
lest, we'll have problems in the future.
Regards,
--
Joel de Guzman
http://www.boost-consulting.com
http://spirit.sf.net
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Boost-docs mailing list
[email protected]
Unsubscribe and other administrative requests:
https://lists.sourceforge.net/lists/listinfo/boost-docs