[stringtemplate-interest] Thoughts on StringTemplate
Adam Bennett
adamb at videx.com
Mon Jul 23 10:15:38 PDT 2007
I'd just like to cast my vote for the "use"/import feature that John suggests. I ran into this limitation right off the bat. You should be able to call templates defined in another group file.
_____
From: Terence Parr [mailto:parrt at cs.usfca.edu]
To: StringTemplate [mailto:stringtemplate-interest at antlr.org]
Sent: Thu, 28 Jun 2007 15:55:53 -0700
Subject: Re: [stringtemplate-interest] Thoughts on StringTemplate
On Jun 1, 2007, at 8:00 PM, John Snyders wrote:
> On my blog I give some ideas for future work on the StringTemplate
> language.
>
> I would be interested in any feedback either here on the mailing
> list or
> in comments
> to my blog.
>
> See:
> http://hardlikesoftware.com/weblog/2007/06/01/thoughts-on-
> stringtemplate-part-1/
>
> I plan to add one or two more posts on the same topic.
Hi John,
Nice stuff. I really like the way you have laid out the difference
between maps and objects and so on. These discrepancies arose from
the evolutionary nature of string template as I added more and more
features. The language needs to be cleaned up and I think I would
like to add the cardinality information so that we can say whether an
element has there are more or is optional etc. As for the shape of
the object, I like the idea, but then would we not be re-specifying
the class definition inside the template? Is that not like just
pointing at the class definition then? Then we'd be typing the
arguments. I guess not, it would be like specifying an interface to
a subset of the fields. Hmm...perhaps
test(user.{name,phone,salary}+, title) ::= "..."
indicates that there are one or more users that have three field I
use and there is a title attribute which must exist.
As you point out so correctly in the second post
http://hardlikesoftware.com/weblog/2007/06/25/thoughts-on-
stringtemplate-part-2/
the the difference between templates and groups of templates really
needs to be rethought. Tom Burns, a co-author of the ST engine, is
asking me to build a backward-incompatible version that fixes this
problem. 4.0? As I understand his issues, he wants directories of
templates and group files to behave identically. Currently, there is
no template-relative addressing-- all of the templates are absolute
from the group root even if they don't start with /. The ability to
have parameter definitions on individual template files is also
necessary. I can't remember what syntax I was thinking here. I
think this is what you are describing in your post. As you point out,
a way to referred to templates for multiple groups at once is
necessary; sort of like a CLASSPATH.
As for the "use"/import idea: I'm not sure this should be done
statically. I think a dynamic " here is the list of groups you can
draw templates from" might be better. Or, are you saying this is a
more general version of inheritance?
Ter
_______________________________________________
stringtemplate-interest mailing list
stringtemplate-interest at antlr.org
http://www.antlr.org:8080/mailman/listinfo/stringtemplate-interest
Videx Inc. 1105 N. E. Circle Blvd. Corvallis OR 97330 (541) 758-0521
CONFIDENTIAL COMMUNICATION: The email message and any attachments are intended only for the addressee. They may be privileged, confidential, and protected from disclosure. If you are not the intended recipient, any dissemination, distribution, or copying is expressly prohibited. If you received this email message in error, please notify the sender immediately by replying to this e-mail message or by telephone
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org:8080/pipermail/stringtemplate-interest/attachments/20070723/72289da6/attachment.html
More information about the stringtemplate-interest
mailing list