[ANN] New Snippets: MathLib 1.1 and Map
[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/