Timothy Driscoll wrote:
On May 5, 2006, at 2:28 p, Bob Hanson wrote:
Timothy Driscoll wrote:
2) We reserve the right to name ANY NEW TOKEN ANYTHING, so whet if
in 10.4 we find use for "src". It breaks your page, that's what.
that would be *extremely* unfortunate, unless it happens in such
distant future that Chime and Rasmol compatibility is no longer an
issue. I would argue very strenuously against this position.
reserving keywords is one thing; reserving the entire universe of
strings is not necessary IMO.
I think I probably said that wrong.
understood; I am under some significant stress here, so I probably
interpreted it wrong as well. all caps is generally accepted convention
for shouting. :-)
FYI I never shout.... But I'll try to remember that.
Tim, the issue is simply this: It's unlikely that the Jmol team would
know, for example, that a specific user had used "src" (just as an
example). Are we to then consider asking all users "Can we use 'src'
for a command, or are you already using it?" That's what I mean by
being careful with your definitions. Any user defining terms risks
future breaks. That's all I'm saying. I'm personally recommending
tilde (not underscore) because I know for a fact that it is not used
in any Jmol definition, and so that works.
I understand and can appreciate this. and I have little experience
with software development.
but from what I know, predefined terms often can be overridden by the
user without breaking things (perl comes to mind especially, but this
is also true in Rasmol and was in Chime). the term is simply redefined
in local context. then it is the author's responsibility to make sure
their application makes proper use of the term. hopefully this is what
Jmol will do.
Not yet, though.
You could do anything you want. As your scripts are particularly
complex (and hard to debug, as you point out) it might be especially
prudent for you to consider something of this nature, where it is
99.9% guaranteed that your definitions do not clash with Jmol tokens
-- current or future.
Example:
A user using Jmol 10.00 quite uses the word "connected" in a definition:
define connected (hydrogen and within(1.2,oxygen))
We added in 10.2
select connected(hydrogen)
The user installs 10.2 and is surprised to find that her page doesn't
work. "Something is wrong with Jmol!"
Is it? What is broken here? What is the preferred solution to this
problem?
Maybe you thought I was saying you should "have" to use tilde. No, I
was saying it might be wise to do so.
undoubtedly it is my ignorance showing, but I would expect Jmol to know
the difference between a keyword string and a token. for example, from
context? for example, I would never use a defined set called
'connected' in the context 'select connected(x)'; likewise, I could
never use the token 'connected' in 'select connected' (or could I?).
The compiler isn't that smart. It first runs through the list checking
for known "tokens" assigning them their integer-based identifier. When
you define a term, that term is looked up in the "known token"
database. If the token is there, you are out of luck. Full stop:
"invalid expression token..."
So whether the term is followed by parentheses or not, that's not the
issue. "connected" is defined; you cannot reassign it.
Now, SHOULD you be able to reassign it? That's a question Miguel has
to answer. I'm pretty sure he does not agree with me that the user
should be able to override tokens "locally" as you say is possible in
other scripting languages and, apparently in Chime and RasMol. (I'm
not so sure about that -- I see you can't, for example, define
"backbone" in RasMol.) It's just introduces too much unpredictability
into the application to let people do that.
You have some great, very elaborate scripts there, Tim. I know you
have worked very very hard to make them do the most amazing things.
I think there are probably 4 or 5 people in the world with that sort
of extensive scripting base. I don't want to make more work for you,
and it worries me that we might introduce a capability like
select molecule=3
that would break your pages.
Bob
if my existing scripts all define 'src' to be a certain set of atoms,
and then Jmol decides at some future point that 'src' is now a token,
then all of my scripts now break. all I'm saying is that should be
avoided, wherever possible. in future scripts, knowing this
restriction, I could of course use something like a tilde in
conjunction with define.
and then be on the lookout if Bob says, "Hey, here's something new:
select molecule=3
color atoms molecule
and you know you use "molecule" in a definition.
I took your statements to mean that any string is up for tokenization
now or in the future. this is the first that I've heard of it and
needless to say, I am quite surprised. this reflects a fairly
important change in use of the define command IMO.
It was news to me, too, when I spotted that in the compiler. All I
meant was you can't know what future developers will do with Jmol, and
at least you should be on the look-out for this.
An idea that comes to mind here is that really the compiler should
only be reserving EXPRESSION terms from user definitions. There's no
reason why "frame prev" should be in conflict with a definition of
"prev". "Frame" doesn't involve expressions. I have to talk with
Miguel about that....
tim
--
Robert M. Hanson, [EMAIL PROTECTED], 507-646-3107
Professor of Chemistry, St. Olaf College
1520 St. Olaf Ave., Northfield, MN 55057
mailto:[EMAIL PROTECTED]
http://www.stolaf.edu/people/hansonr
"Imagination is more important than knowledge." - Albert Einstein
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Jmol-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-developers