Search the web
Sign In
New User? Sign Up
openLingo · openLingo Code Library
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Hear how Yahoo! Groups has changed the lives of others. Take me there.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
update to openLingo and singleton scripts   Message List  
Reply | Forward Message #629 of 643 |
Re: [openLingo] update to openLingo and singleton scripts

On 17/6/04 6:11 am, "Christoffer Enedahl" <christoffer@...> wrote:
> I had some time to tweak the approved openLingo scripts tonight between the
> children screams.

Hi everyone,

I notice that the approved scripts contain structures like:

on getCount me
_errorSymbol = void --Reset any previous error

if ListP( me._instancePropList ) then return me._instancePropList.count
else return 0
end


I would suggest restructuring the handler above as:

on getCount me
_errorSymbol = void --Reset any previous error

-- Place "if ... then" and action on separate lines
if ListP(_instancePropList) then -- no "me."
tResult = _instancePropList.count
else
tResult = 0
end if

return tResult -- calculate result and return it on different lines
end getCount


I'm new to this list, so perhaps there are reasons for working in the
approved way that I am not aware of. My reasons for the changes are
connected with debugging:

* If the "if ... then" statement is on the same line as the action it
generates, step by step debugging will not show whether the line is
executed or not
* If the result is calculated on the same line as it is returned,
you may not be able to see what value *is* returned, either in the
current handler or in the calling handler.
* The "me." prefix is unnecessary for properties declared in the
current script. It is only required if the property is declared
in an ancestor. I omit the "me." where possible, so that it is
clear when a property is "personal" or "inherited".

(The "t" prefix for temporary variables follows the practice used in the
more recent Director behaviors, which also use a "p" prefix for properties).


Does this make sense, or am I being pedantic?

James





Thu Jun 17, 2004 8:07 am

openspark
Offline Offline
Send Email Send Email

Forward
Message #629 of 643 |
Expand Messages Author Sort by Date

Hi! I had some time to tweak the approved openLingo scripts tonight between the children screams. First I changed the default prefix in openLingo from "ol" to...
Christoffer Enedahl
Enedahl
Offline Send Email
Jun 17, 2004
5:12 am

... Hi everyone, I notice that the approved scripts contain structures like: on getCount me _errorSymbol = void --Reset any previous error if ListP(...
James Newton
openspark
Offline Send Email
Jun 17, 2004
12:56 pm

... <unlurk> makes sense to me, that's my style, too. </unlurk>...
Stefan Ladstaetter
stefan_matic
Offline Send Email
Jun 17, 2004
1:44 pm

Consider the notion seconded. On another note, is there a good place on openLingo where people can put examples or proof-of-concept pieces created using the...
Mathew Ray
mrayinteractive
Offline Send Email
Jun 17, 2004
2:24 pm

... From: "James Newton" <james.newton@...> ... Not really, these points were never brought up before, so it was never a criteria for whether...
Robert Tweed
microaeon
Offline Send Email
Jun 17, 2004
2:12 pm

... Hi Robert, That makes sense. ... There are times when I would want to comment the *what* of an individual line of code. For example, an Undo script may...
James Newton
openspark
Offline Send Email
Jun 18, 2004
1:28 pm

... From: "Mathew Ray" <mathew@...> ... At the moment, you can upload whatever you like into the files area. To keep things organised, what we do is: -...
Robert Tweed
microaeon
Offline Send Email
Jun 17, 2004
2:46 pm

... From: "James Newton" <james.newton@...> ... is, ... is ... only ... Bear in mind that these are only *guidelines* not hard-and-fast rules (which ...
Robert Tweed
microaeon
Offline Send Email
Jun 18, 2004
1:50 pm

Hi everyone, I've just uploaded three scripts to: <http://groups.yahoo.com/group/openLingo/files/openSpark/> Two of these (GroupBroker and SpriteGroup) allow...
James Newton
openspark
Offline Send Email
Jun 24, 2004
11:51 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help