W3C home > Mailing lists > Public > whatwg@whatwg.org > May 2006

[whatwg] Side effects free scripts

From: Andrew Fedoniouk <news@terrainformatica.com>
Date: Sun, 28 May 2006 18:31:06 -0700
Message-ID: <008401c682bf$8e4d1aa0$3401a8c0@TERRA>

----- Original Message ----- 
From: "Alexey Feldgendler" <alexey@feldgendler.ru>


> On Sun, 28 May 2006 17:05:45 +0700, Sjoerd Visscher <sjoerd at w3future.com> 
> wrote:
>
>>> When a script thread is in side effect free mode:
>>>  1. It stays in this mode until the thread completes.
>>>  2. It can call any non-native function, but the same restrictions 
>>> apply.
>>>  3. It cannot assign any variables except locals.
>>>  4. It cannot call any native function except those specifically marked 
>>> by the spec as side effects free. For example, sin() is side effects 
>>> free, and window.open() is not.
>>>  5. It can read any property that can be normally read.
>>>  6. It cannot assign any property for which a native setter function is 
>>> used.
>
>> Ok, here you make it clear that with side effects you only mean visible 
>> side effects?
>
> No, all side effects in the mathematical sense. The script is not allowed 
> to alter the state of the world in any way.

Axiom:

  Code which is not altering the state of the world cannot produce anything
  useful (work) for that world.

(C:) Mine.

Andrew Fedoniouk.
http://terrainformatica.com
Received on Sunday, 28 May 2006 18:31:06 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:58:46 UTC