On Sat, 22 Dec 2007 16:26:18 +0200, Miguel Mitrofanov <[EMAIL PROTECTED]> wrote:

Lazy constant in C:

int C1 (){
        return 7;
}
C1 is computed only when you apply the operator () to it.

But that's not the point of lazyness. Lazy value is computed only ONCE.

Ok. I guess I cannot be sure I'll call C1 only once.


How about this

int C1(){
static c1=-9999;
        if(c1==-9999){
                c1=7
        }
        return c1
}
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to