On 2006-05-16, at 13:08 EDT, John Sundman wrote:

> Excellent!
>
> jrs
>
> P.S.  What's a "sentinel" ?

sentinel |ˈsentn-əl| |ˌsɛntn=əl| |ˌsɛntɪn(ə)l|
noun
a soldier or guard whose job is to stand and keep watch.
• figurative something that appears to be standing guard or keeping  
watch.
• Medicine a thing that acts as an indicator of the presence of  
disease : [as adj. ] the first national HIV sentinel surveillance  
program in the developing world.
verb ( -neled, -neling; chiefly Brit. -nelled, -nelling) [ trans. ]
station a soldier or guard by (a place) to keep watch : a wide course  
had been roped off and sentineled with police | figurative trees  
sentineled the trenches.
PHRASES
stand sentinel (of a soldier) keep watch : soldiers stood sentinel  
with their muskets | figurative a tall round tower standing sentinel  
over the river.
ORIGIN late 16th cent.: from French sentinelle, from Italian  
sentinella, of unknown origin.

In programming I use it to mean a 'thing that acts as an indicator'.   
In this case, a value that is of the correct type (an event) but that  
indicates that there isn't an event.  As opposed to using `null`, a  
sentinel is a valid member of the type with correct behavior.

> On May 16, 2006, at 1:03 PM, P T Withington wrote:
>
>> Henry and I are proposing:
>>
>> 1) Use a sentinel rather than null for declared events.  This is  
>> typesafe, will not crash Javascript, and can be optimized as  
>> necessary.
>>
>> 2) setAttribute, which is the primary caller of sendEvent and  
>> likely to be impacted performance-wise, will be re-written to be  
>> careful about undeclared events and to not make function calls to  
>> the sentinel event.  (Safe, will not crash, can be optimized.)
>>
>> 3) The compiler will inline setAttribute and sendEvent.  (It used  
>> to inline setAttribute, that was turned off because it conflicted  
>> with registers, is fairly easy to reintroduce.  It should be easy  
>> to inline enough of sendEvent to avoid unnecessary function calls.)
>>
>> On 2006-05-16, at 12:43 EDT, Jim Grandy wrote:
>>
>>> On May 16, 2006, at 7:42 AM, Amy Muntz wrote:
>>>
>>>> Task 2
>>>> Then, please use the DeclareEvent pattern, and remove the if's  
>>>> as you no longer have to check for null. Please do this in the  
>>>> same set of files you are currently working with, and then send  
>>>> that out for review (Henry has volunteered to review this next  
>>>> changeset - thanks, Henry!)
>>>
>>> Woah. The DeclareEvent isn't where the if's are -- it's in the  
>>> sendEvent idiom we use. We'd need a SendEvent standalone function  
>>> to get rid of the if's.
>>>
>>> SendEvent = function(evt, arg) {
>>>     if (evt != null) evt.sendEvent(arg);
>>> }
>>>
>>> Then we can rewrite the body of SendEvent if the semantics change.
>>>
>>> Or am I confused? Can someone please write up a mini-proposal for  
>>> what we're doing?
>>>
>>> Thanks,
>>>
>>> jim
>>
>


_______________________________________________
Laszlo-dev mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-dev

Reply via email to