John,

Regarding your question about higher-order functions - besides the usual 
disclaimer that they do not work smoothly...

Currently, we do not support generic functions as higher-order 
functions. See if you can make your example work by making foo() 
non-generic, i.e. providing a specific domain for the 'arr' formal.

Vassily

>.....
>
> Also I ran into some issues with second order functions.
>
> proc foo(arr: [] 3*uint(8)) {
>      writeln("bar");
> }
>
> proc something(arr: [] 3*uint(8), func) {
>      func(arr);
> }
>
> var A: [{1..400,1..225}] 3*uint(8);
> something(A, foo);
>
>
> gives me error
>
> src/test2.chpl:11: In function 'something':
> src/test2.chpl:12: error: illegal access of first class function 
> [functionResolution.cpp:2448]
>

------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Chapel-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/chapel-users

Reply via email to