Re: Coercing strings to symbols
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