From: Larry Evans (cppljevans_at_[hidden])
Date: 2005-03-06 16:26:44


On 03/06/2005 07:59 AM, Pavel Chikulaev wrote:
> I'm currently working on library "Lazy".
[snip]
> Library's sample usage:
>
> //Matrix.h
[snip]
> //lazy constuctors which enables lazy operators
> Matrix(LAZY_OP(Matix_ + Matrix_)); //Matrix operator +(Matrix, Matrix)
> Matrix(LAZY_OP(Matrix_ * Matrix_)); //...
> Matrix(LAZY_OP(-Matrix_);
> Matrix(LAZY_OP(Matrix_ + Matrix_ * Matrix_)); //ternary operator
[snip]
> So what do you think?
> Is there any similar approaches available?
I've also very curious about how this was done. Many years ago,
I read Budd's

    _An Apl Compiler_

( See http://web.engr.oregonstate.edu/~budd/vita/books.html for
details ), and IIRC, some of the techniques he used there might
be useful for something like this. IOW, he evaluated the data flow
for a apl expression and somehow created c code to evaluate the rhs.
IIRC, he also mentioned vector machines. Anyway, it may give you
some more ideas for lazy evaluation.