• 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: Timed loop
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Timed loop
      • From: Philip Aker <email@hidden>
    • Re: Timed loop
      • From: Michelle Steiner <email@hidden>
    • Re: Timed loop
      • From: "Mark J. Reed" <email@hidden>
References: 
 >Timed loop (From: Peter Baxter <email@hidden>)
 >Re: Timed loop (From: Christopher Nebel <email@hidden>)
 >Re: Timed loop (From: Jean-Baptiste LE STANG <email@hidden>)
 >Re: Timed loop (From: Malcolm Fitzgerald <email@hidden>)

  • Prev by Date: Re: Creating a script that can set its own modification date
  • Next by Date: Re: Timed loop
  • Previous by thread: Re: Timed loop
  • Next by thread: Re: Timed loop
  • Index(es):
    • Date
    • Thread