• 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: Coercing strings to symbols
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Coercing strings to symbols


  • Subject: Re: Coercing strings to symbols
  • From: has <email@hidden>
  • Date: Sat, 16 Feb 2008 01:21:49 +0000

On 15 Feb 2008, at 22:59, Mark J. Reed wrote:

Longer answer: this sort of thing is trivial in other, more
capable languages such as Python, Ruby and ObjC, e.g.:

       #!/usr/bin/env ruby

       string = "center"
       symbol = string.intern

       p symbol
       # :center

Bogus example.

Nope. Apple event enumerators are objects - AEDescs of typeEnumerated - which the various Apple event bridges map to native language objects [1]. For example, AppleScript maps them to objects of type 'constant' which are displayed as a human-readable keyword if one is available (e.g. 'yes') or in raw chevron notation if there isn't (e.g. «constant ****yes »); Python appscript maps them to instances of appscript's Keyword class; Ruby appscript maps them to instances of Ruby's Symbol class; a Lisp-AE bridge (if one existed) would likely map them to Lisp symbols; and so on.


has

[1] With the exception of Scripting Bridge, which is badly designed and best overlooked on such matters.
--
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: 
 >Coercing strings to symbols (From: "Houston, Brad" <email@hidden>)
 >Re: Coercing strings to symbols (From: has <email@hidden>)
 >Re: Coercing strings to symbols (From: "Mark J. Reed" <email@hidden>)

  • Prev by Date: make new custom tag in Aperture 2.0
  • Next by Date: Re: Sound Effects
  • Previous by thread: Re: Coercing strings to symbols
  • Next by thread: Broken date math on AppleScript 2.0
  • Index(es):
    • Date
    • Thread