• 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
[ANN] New Snippets: MathLib 1.1 and Map
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ANN] New Snippets: MathLib 1.1 and Map


  • Subject: [ANN] New Snippets: MathLib 1.1 and Map
  • From: Michael Miller <email@hidden>
  • Date: Sun, 10 Jun 2001 00:52:36 -0500

Two new script snippets for your perusal:

ESG MathLib 1.1 is a vanilla AppleScript math library. This version includes basic trig, partial inverse trig (arcsin and arccos), and natural logarithms, as well as full documentation for the various functions.


Map has two script objects that let you map a key onto a value. It's one way to answer the age-old question:

How do I access a record using a variable? IE:

set someRec to {foo:3, bar:4}
set keyName to "bar"
return keyName of someRec
--> Can't get keyName of {foo:3, bar:4}.
-- (but you wanted 4)

This turns into something like this:

copy CMap to myMap
myMap's add("foo", 3)
myMap's add("bar", 4)
set keyName to "bar"
return myMap's lookup(keyName)


These and many others are available at the ESG Labs Snippets page:

http://www.esglabs.com/snippets/


Enjoy,

Mike Miller
ESG Labs
http://www.esglabs.com/


  • Prev by Date: how do I access the Finder on a remote machine?
  • Next by Date: Re: Applescript brings finder to front each time
  • Previous by thread: how do I access the Finder on a remote machine?
  • Next by thread: Re: [ANN] New Snippets: MathLib 1.1 and Map
  • Index(es):
    • Date
    • Thread