On Thursday 30 Sep 2010 11:38:02 am Stephen Thomas (JIRA) wrote:
scriptnames that begin with "get" followed by an uppercase letter do not display properly in the viewer
Key: SQ-840 URL: http://tracker.squeakland.org/browse/SQ-840
The pattern get<Var> and set<Var> used internally by Etoys to operate on variables like x, y, heading etc.
Should this restriction be explicitly mentioned for user-written scripts or should such scripts be handled specially in Etoys? What do others feel?
Subbu
On 05.10.2010, at 05:25, K. K. Subramaniam wrote:
On Thursday 30 Sep 2010 11:38:02 am Stephen Thomas (JIRA) wrote:
scriptnames that begin with "get" followed by an uppercase letter do not display properly in the viewer
Key: SQ-840 URL: http://tracker.squeakland.org/browse/SQ-840
The pattern get<Var> and set<Var> used internally by Etoys to operate on variables like x, y, heading etc.
Should this restriction be explicitly mentioned for user-written scripts or should such scripts be handled specially in Etoys? What do others feel?
Subbu
Well, I think user script names should appear exactly as typed. Just like object names (which sometimes erroneously get translated).
Either we allow scripts to be named like this or not. But since currently we do, they should work as expected.
- Bert -
On Tuesday 05 Oct 2010 11:44:08 am Bert Freudenberg wrote:
Well, I think user script names should appear exactly as typed. Just like object names (which sometimes erroneously get translated).
script names belong to the same space as getter, setter methods in the standard vocabularies.
You can't have two morphs named the same. The new morph will have a number appended to it to resolve the conflict. The same resolution is also employed for scripts. If you try to name a script as getX, it will get changed to getX1.
Either we allow scripts to be named like this or not. But since currently we do, they should work as expected.
I went back as far as 3.8 and found that we never allow scripts to be named this way. If we try naming a script as getHeading, it will get renamed to getHeading1 to avoid conflicts with the built-in method. There are also a list of proscribed names like self, costume, super etc. See
Player>>acceptableScript....
In any case, we can't fix this in 4.1.1 timeframe. It will require a redesign.
Subbu
Am 06.10.2010 um 03:53 schrieb "K. K. Subramaniam" kksubbu.ml@gmail.com:
On Tuesday 05 Oct 2010 11:44:08 am Bert Freudenberg wrote:
Well, I think user script names should appear exactly as typed. Just like object names (which sometimes erroneously get translated).
script names belong to the same space as getter, setter methods in the standard vocabularies.
You can't have two morphs named the same. The new morph will have a number appended to it to resolve the conflict. The same resolution is also employed for scripts. If you try to name a script as getX, it will get changed to getX1.
But you can have very well have a script named getFoo since no such selector exists.
Either we allow scripts to be named like this or not. But since currently we do, they should work as expected.
I went back as far as 3.8 and found that we never allow scripts to be named this way. If we try naming a script as getHeading, it will get renamed to getHeading1 to avoid conflicts with the built-in method. There are also a list of proscribed names like self, costume, super etc. See
Player>>acceptableScript....
In any case, we can't fix this in 4.1.1 timeframe. It will require a redesign.
I think we are not talking about the same problem. The problem described in the ticket is that if I name a script "getFoo" it is displayed as "get foo", which is incorrect. It should be displayed as "getFoo", exactly as typed by the user.
This is completely independent of not being able to name a script "getX". Yes that will be renamed to "getX1", which is fine. But it then should be displayed as "getX1" and not "get x1".
- Bert -
On Wednesday 06 Oct 2010 6:05:16 pm Bert Freudenberg wrote:
Am 06.10.2010 um 03:53 schrieb "K. K. Subramaniam" kksubbu.ml@gmail.com:
You can't have two morphs named the same. The new morph will have a number appended to it to resolve the conflict. The same resolution is also employed for scripts. If you try to name a script as getX, it will get changed to getX1.
But you can have very well have a script named getFoo since no such selector exists.
But it will become hidden when a Foo slot gets added by a vocabulary. So get* or *: patterns are verboten in script names along with a bunch of reserved names. These restrictions should be documented (or the entire protocol logic redesigned).
We can hack this by prepending an underscore or space character to all user script names before storing them in the methodInterface and then stripping them before display then in scriptor or tiles. I don't know what gremlins lie in hiding down this path. Scott, help!
This is completely independent of not being able to name a script "getX". Yes that will be renamed to "getX1", which is fine. But it then should be displayed as "getX1" and not "get x1".
I didn't see this behavior. getFooVar will show up as fooVar in Etoys viewer but as getFooVar in the scriptor.
Subbu
On 06.10.2010, at 08:12, K. K. Subramaniam wrote:
On Wednesday 06 Oct 2010 6:05:16 pm Bert Freudenberg wrote:
Am 06.10.2010 um 03:53 schrieb "K. K. Subramaniam" kksubbu.ml@gmail.com:
You can't have two morphs named the same. The new morph will have a number appended to it to resolve the conflict. The same resolution is also employed for scripts. If you try to name a script as getX, it will get changed to getX1.
But you can have very well have a script named getFoo since no such selector exists.
But it will become hidden when a Foo slot gets added by a vocabulary.
No. It will still work - the Foo slot will be in class Player, the user's script in a subclass, so the user's script will get run.
So get* or *: patterns are verboten in script names along with a bunch of reserved names. These restrictions should be documented (or the entire protocol logic redesigned).
It should be documented, agreed. But I see no reason to actually disallow using get* as a script name.
We can hack this by prepending an underscore or space character to all user script names before storing them in the methodInterface and then stripping them before display then in scriptor or tiles. I don't know what gremlins lie in hiding down this path. Scott, help!
This is completely independent of not being able to name a script "getX". Yes that will be renamed to "getX1", which is fine. But it then should be displayed as "getX1" and not "get x1".
I didn't see this behavior. getFooVar will show up as fooVar in Etoys viewer but as getFooVar in the scriptor.
Ah, you are right, I misremembered. I still think it should be fixed. This is similar (though likely unrelated) to player names getting translated in command tiles (SQ-640).
- Bert -
etoys-dev@lists.squeakfoundation.org