Steve Wampler wrote:
> A variant of this would be:
> 
>     procedure lamda(A)
>         return (@A[1], A[1])
>     end
> 
> which can be used as a PDCO to automatically create the coexpression, as in:
> 
>     procedure genAcc(n)
>         return lamda { while i := (n...@source)[1] do n +:= i }
>     end
> 
> a sample use is:
> 
>     procedure main()
>         a := genAcc(3)
>         b := genAcc(5)
> 
>         write("         ","a",  " ","b")
>         write("genAcc: ", a(4), " ",b(4))
>         write("genAcc: ", a(2), " ",b(3))
>     end

I should point out that this program is a Unicon solution to the
"Accumulator Generator" problem found at:

    http://www.paulgraham.com/accgen.html


-- 
Steve Wampler -- [email protected]
The gods that smiled on your birth are now laughing out loud.

------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Unicon-group mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/unicon-group

Reply via email to