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

[whatwg] Side effects free scripts

From: liorean <liorean@gmail.com>
Date: Wed, 31 May 2006 00:15:35 +0200
Message-ID: <cee13aa30605301515s686d7863mb1bc28f601ab4197@mail.gmail.com>
On 29/05/06, Andrew Fedoniouk <news at terrainformatica.com> wrote:
> Axiom:
>
>   Code which is not altering the state of the world cannot produce anything
>   useful (work) for that world.
>
> (C:) Mine.


How about something like this?

    <img src="javascript:generateImage(1e6*Math.random()>>0);" alt=""/>

    function generateImage(seed){
        /* use the seed to write generate an XBM image here */
        return image;
    }

That code could be made entirely side effect free, but still useful.
-- 
David "liorean" Andersson
<uri:http://liorean.web-graphics.com/>
Received on Tuesday, 30 May 2006 15:15:35 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:08:27 UTC