[stringtemplate-interest] Formal parameters in web templates

Ran Tavory rantav at gmail.com
Tue Oct 27 12:39:38 PDT 2009


I suppose I'll wait for v4 then, thanks for the replies.

On Tue, Oct 27, 2009 at 6:01 PM, Terence Parr <parrt at cs.usfca.edu> wrote:

> Hi Ran,
>
> You've asked 2 questions actually :)
>
> 1. Define formal args for nongroup file templates: Coming in STv4. All
> templates will require formal args even in separate files.
>
> 2. Specifying cardinality of parameters (required, optional, multi-valued).
>  It's somethng I've considered for years and have commented out in the code.
> ;)  I'm still deciding about it's use for STv4.
>
> As for types, I think types would tie templtes too closely to the model.
>  But, i understand the desire for them.
>
> Ter
> On Oct 26, 2009, at 10:46 PM, Ran Tavory wrote:
>
> A newbe question: Is it possible to define the list of formal parameters in
> a template where my use case would be for a web page?
>
> For example, in this template:
>
> layout.st
>
> <html>
> <head>
> <title>$title$</title>
> <body>
> $banner()$
> <hr>
> $body()$
> </body>
> </html>
>
>
> I'd like to say that *$title$* is a required parameter. Would even be
> better if types can be enforced, such as String, Number, Date, List of x
> etc, but even without static typing, simply listing the formal arguments the
> template expects would be great.
> Thanks!
> _______________________________________________
> stringtemplate-interest mailing list
> stringtemplate-interest at antlr.org
> http://www.antlr.org/mailman/listinfo/stringtemplate-interest
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/stringtemplate-interest/attachments/20091027/f43aaab1/attachment.html 


More information about the stringtemplate-interest mailing list