• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: handler failure [oops! correction]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: handler failure [oops! correction]


  • Subject: Re: handler failure [oops! correction]
  • From: has <email@hidden>
  • Date: Thu, 14 Nov 2002 17:03:53 +0000

Michael Terry wrote:

>OK, has, I'll play your little game.

Oh goody, we likeses little gameses. ;)


>It looks to me like property
>identifiers are linked to their values by a number index at compile time. A
>separate index is created for each scope. If a handler moves into a new
>scope and references a property, there's a problem. It tries to look up its
>property's value in the new index using the index number it was given for
>the old index at compile time. Results are even less comprehensible than
>above if the index number refers to a position in the new index which
>doesn't exist.

Darn, I must be making them too easy. ;p


Here's a tougher one: how to remedy the problem?

The only solution I can think of is making the compiler much more sparing
(or far more intelligent) in what and how it binds at compile-time.

I've noticed several other variable binding problems with AS, including this:

======================================================================

on foo()
return _val
end foo

property _val : 1

foo()

======================================================================

which is very bad; and this:

======================================================================

script a
property _val : 1
end script

script b
property parent : a
on foo()
return _val
end foo
end script

b's foo()

======================================================================

which is a perennial annoyance; and this:

======================================================================

script a
property _val : 1
end script

script c
property _val : false
script b
property parent : a
on foo()
return _val
end foo
end script
end script

c's b's foo()

======================================================================

which is downright stupid.

At the end of the day though, maybe static bindings are just a Bad Idea in
a language as dynamic as AS. Wonder what the performance penalty would be
if static bindings were just dropped altogether?

No easy answer, I suspect.

has

p.s. Anyone ever tried Sun's Self language? Very similar to AS in this
department (i.e. prototype-, slot-based), but with a purer implementation
(messages for everything, including getting/setting state). Just curious.

--
http://www.barple.pwp.blueyonder.co.uk -- The Little Page of AppleScripts
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: handler failure [oops! correction]
      • From: Axel Luttgens <email@hidden>
    • Re: handler failure [oops! correction]
      • From: email@hidden (Michael Sullivan)
    • Re: handler failure [oops! correction]
      • From: Michael Terry <email@hidden>
  • Prev by Date: Re: Illustrator 10: Ungrouping Groups of Groups
  • Next by Date: Re: A Tragedy of Errors was Re: handler failure
  • Previous by thread: Re: handler failure [oops! correction]
  • Next by thread: Re: handler failure [oops! correction]
  • Index(es):
    • Date
    • Thread