* cwflamont wrote:
>>   timer = setInterval((angle = rotation(angle)), 150);

>>   timer = setInterval(function(){
>>     (angle = rotation(angle))
>>   }, 150);

>Thanks very much Bjoern, that works perfectly (although I do not
>understand why it needs to be done that way):

Then let's assume rotate is defined like so:

  function rotate(angle) { return 777; }

Then we can take

  timer = setInterval((angle = rotation(angle)), 150);

and as first step evaluate the function call and get

  timer = setInterval((angle = 777), 150);

The inner expression is evaluated before calling setInterval, and
assignment expressions evaluate to the assigned value, that's 777:

  timer = setInterval(777, 150);

Parameter expressions are always evaluated before calling functions,
the script interpreter does not automatically create code references,
you have to do that yourself.
-- 
Björn Höhrmann · mailto:[EMAIL PROTECTED] · http://bjoern.hoehrmann.de
Weinh. Str. 22 · Telefon: +49(0)621/4309674 · http://www.bjoernsworld.de
68309 Mannheim · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/ 

------------------------------------

-----
To unsubscribe send a message to: [EMAIL PROTECTED]
-or-
visit http://groups.yahoo.com/group/svg-developers and click "edit my 
membership"
----Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/svg-developers/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/svg-developers/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[EMAIL PROTECTED] 
    mailto:[EMAIL PROTECTED]

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

Reply via email to