• 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: "a reference to"
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: "a reference to"


  • Subject: Re: "a reference to"
  • From: has <email@hidden>
  • Date: Fri, 11 Jan 2008 15:34:12 +0000

On 10 Jan 2008, at 23:14, Mark Alldritt wrote:

You could then close the rest of the
loop by making AppleScript actually validate an object reference against the
dictionary - at least generating an error/warning when things are not
explicit.


Errors would be a bad idea. Warnings might be okay as long as they were optional.

Early versions of appscript tried to enforce references as you describe. The problem is that application dictionaries are neither sufficiently detailed nor accurate for this sort of client-side enforcement to be done without false positives occurring. After a year I ended up pulling all the validation stuff out again; it just caused more hassles than it was worth.

The other thing is that client-side validation isn't really all that useful in a dynamic language such as AppleScript: any validation it might do at runtime would be done shortly after by the application anyway, so is just a duplication of effort.

Compile-time validation may be of some use in [optionally] statically typed languages such as ObjC; e.g. Scripting Bridge generates glue headers based on the class structures and hierarchy defined by the application dictionary. Although again, unless this enforcement is optional it's going to be counterproductive any time users encounter an imperfect or insufficiently detailed dictionary. (e.g. SB doesn't provide a 'compatibility' option; users have to resort to raw AE codes any time the terminology-based API barfs, which somewhat defeats the purpose of having a high-level API in the first place.) And even then it isn't all that big a win, given all the other things that can still go wrong at runtime.

...

Finally, what novice scripters really need isn't yet more runtime validation that occurs well down the line when they come to run their code; it's immediate, interactive assistance and feedback in constructing well-formed code in the first place. This is why I keep pointing to newer environments such as Alice and Scratch, because once you replace 'dumb' character-based source code with an 'intelligent' structure editor these sorts of facilities are straightforward to provide.

has
--
http://appscript.sourceforge.net
http://rb-appscript.rubyforge.org

_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden
References: 
 >Re: "a reference to" (From: Mark Alldritt <email@hidden>)

  • Prev by Date: Name of file
  • Next by Date: Re: How do you add a track not currently in iTunes to iTunes playlist using applescript
  • Previous by thread: Re: "a reference to"
  • Next by thread: Re: "a reference to"
  • Index(es):
    • Date
    • Thread