private handlers in a public library

Dick Kriesel dick.kriesel at mail.com
Fri Dec 8 03:12:30 EST 2006


On 12/6/06 10:59 PM, "Dar Scott" <dsc at swcp.com> wrote:

> I think your checking method is pretty clever and can be handy.
> Though the cost of a couple lines and a few microseconds might be
> much for small handlers, this might work OK for larger handlers.

When microseconds don't matter, it can be done in one line.

-- <code>

on publicHandler
  privateHandler
end publicHandler

on privateHandler
  if trespass() then pass privateHandler
  -- private stuff
end privateHandler

-- same one liner for privateFunction and uPrivateProperty

function trespass
  return item 1 of line -2 of the executionContexts is not \
         item 1 of line -3 of the executionContexts
end trespass

-- <code/>

Function "trespass" can instead reside in some other library.

-- Dick





More information about the use-livecode mailing list