[stringtemplate-interest] On Pragmatism Violating Purity
Zenaan Harkness
zen at freedbms.net
Tue Oct 20 07:55:32 PDT 2009
On Mon, Oct 19, 2009 at 04:11:21PM -0700, Graham Wideman wrote:
...
> So, maybe there's an argument to provide, within ST, access to particular native language features, but I am skeptical about it's importance in the area of "if". If it's reasonable for ST to be able to interrogate values at all (and thus have an "if" capability), then it's reasonable for ST to test all variants of absence/missing/null/empty that ST can "see". If ST can "see" into native data structures by virtue of its reflection-following capability, then it can also encounter absence/missing/null/empty in various ways and should allow the ST programmer a way to tell what to do about each case.
...
> My current conclusion is that the current state of compromise is best complemented by rounding out ST's handing of the out-of-band values it can encounter, by completing the set of ifxxx functions, and the set of defaults one can specify for rendering (and make them parallel).
Clear writeup of concepts and analysis, thanks (quote shortened only for brevity).
> native.somefunction
> -------------------------
> Second, if there is a move toward a native.somefunction idea, then how about avoid using the keyword "native", and instead use the keyword for the language: java.somefunction or csharp.somefunction etc. Then it would be immediately clear what's going on, and the ST interpreter compiler could readily reject attempts by a template that expects C somefunction behavior to be used where it's getting java somefunction behavior. (And one would be prevented from accidentally reusing a template written for one native language in an incompatible scenario.)
>
> Finally, would this really be heading in the direction of native-language specific functions, or is it really about adding user-defined functions to ST: ie: user.somefunction. Let me be the first to suggest....
>
> com.yourdomain.somefunction
>
> :-).
:) indeed.
Iff there is some concensus on a need for java-etc.somefunction, this
proposed naming convention is good.
cheers
zen
--
Homepage: www.SoulSound.net -- Free Australia: www.UPMART.org
Please respect the confidentiality of this email as sensibly warranted.
More information about the stringtemplate-interest
mailing list