Re: Timed loop
Re: Timed loop
- Subject: Re: Timed loop
- From: "Mark J. Reed" <email@hidden>
- Date: Thu, 29 Nov 2007 09:30:35 -0500
On Nov 29, 2007 2:41 AM, Malcolm Fitzgerald <email@hidden> wrote:
> On 29/11/2007, at 10:50 AM, Jean-Baptiste LE STANG wrote:
> > On Nov 28, 2007, at 10:01 PM, Christopher Nebel wrote:
> > > There are even some constants to make the math easier.
> > I guess they are not really constants :D
> No, they're properties. Set them to whatever you like :-/
if state is "Arkansas" then
set pi to 3
end if
:)
But to be fair, most languages let you redefine "constants" - at most,
they warn you about it:
$ perl -MMath::Trig -le 'sub pi() { 3; } print pi;'
Constant subroutine pi redefined at -e line 1.
3
$ python -c 'from math import pi; pi=3; print pi' # no warning, even
3
$ ruby -e 'Math::PI = 3; puts Math::PI'
-e:1: warning: already initialized constant PI
3
AFAIK, Tcl doesn't predefine pi for you - you have to do so yourself
(e.g. set PI [expr atan2(0,-1)]) - so you can of course redefine it
yourself later.
Of the langs I use regularly, Javascript is the only one that doesn't
let you redefine pi. Unfortunately, it also doesn't warn you when you
try to do so; it just silently ignores the attempt:
javascript:Math.PI=3;Math.PI
3.141592653589793
--
Mark J. Reed <email@hidden>
_______________________________________________
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