[stringtemplate-interest] sequences and unique numbers
Terence Parr
parrt at cs.usfca.edu
Wed Aug 5 12:43:39 PDT 2009
On Aug 4, 2009, at 4:16 AM, Sam Barnett-Cormack wrote:
> Terence Parr wrote:
>> I'm running this up the flagpole to see what people think. Is this
>> good, bad, or indifferent?
>
> I'm not really a ST afficianado yet, but I like the whole ST concept,
> and I think that this fits okay with it... but it means there should
> be
> a change in the explanation of side-effects and the expectation of
> there
> not being any. Call it perhaps "dynamic models" with "static models"
> (predictable results) being easier, but dynamic models being valid.
Yeah, that's a good point. perhaps dynamic versus static is the way to
say it rather than side effect. but, by no side effects, do I mean
repeatability? Hmm... I wonder what pure functional languages due to
get the current time? does anybody know? Weird, I see some things on
the web about getting the current working directory and changing the
current directory, clear side effects. perhaps you have to do in one
of those weird monad things.
> There are potentially all sorts of issues with concurrency,
> repeatability, etc etc, and you need to be sure that developers know
> that those are *their* problem. Otherwise, I don't see the problem
> with
> dynamic models - it's potentially very useful, if subtle.
Yeah, makes me nervous, but I could put in the advanced features
"beware" type stuff. Also it's not like it's built into the language
so people who make tostring return a different value each time know
they are making a nonrepeatable thing.
In your next e-mail you suggest sugar to make it easier. Part of me
wants to leave it as "do it only few know what you're doing" and
syntax would make people use it. On the other hand, if it has a known
bit of syntactic sugar with known semantics, we discourage people from
doing all sorts of weird things manually in the model and passing them
in. Hmm...
I thought about doing something like
labels ::= {label<it>}
which presumably would give you a new label every time you reference
<labels>.
Ter
More information about the stringtemplate-interest
mailing list