> 1) allow c_ptrTo to be passed a 1-D rectangular array or a tuple, and have it
>    return a pointer to the first element == a pointer to the whole array.
>    I've committed test cases in 
> test/extern/ferguson/{tuple_to_pointer,array_to_pointer}.chpl
>    Then the recommended way to pass an array to a C function would be 
> something like
>       call_C(c_ptrTo(myArray))
>    instead of the pass-a-reference-to-the-first-element business.

I think this is a fine step in a better direction for the short-term, but 
ultimately, I think we should still work towards a world in which one can 
write:

        extern proc call_C(X: [] real);

and have the [] in the 'extern' context imply a C array.  Then support:

        var A: [1..10] real;

        call_C(A);

where the domain map will have an interface that says (a) can the array's 
elements be represented using a pointer to a single contiguous chunk? and 
(b) if so, what is that pointer.  This would, for example, allow the 
default rectangular array above to be passed to call_C() whereas a Block 
distributed array would result in an error (compile time or runtime).


> 2) allow a Chapel programmer to cast between different C types using the 
> usual syntax.
>    This came up when trying to work around the lack of (1).

This seems like a no-brainer to me -- where does it break down currently?

-Brad


------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
Chapel-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/chapel-developers

Reply via email to