Hello Vitali,

Support for first class functions in Chapel is limited.  See
README.firstClassFns in the technotes directory of the release docs.
I'm not familiar with the details of the implementation, and those
that were involved are no longer working on Chapel.  Though it our
intention to flesh out the details and truly support first class
function, it not on our current TODO for the upcoming release.

Hope that helps.

-- Sung

On Wed, Aug 20, 2014 at 11:32:41AM +0200, Vitali Baumtrok wrote:
> Hello,
>  
> I wanted to ask what kind of indirection for functions do you provide or plan
> to provide in chapel?
>  
> Does chapel have function/procedure pointers? I couldn't find nothing about
> this
> in the documentation 0.95. Or do you rely solely on classes for this? Will be
> the
> select statement optimized or will it be just a sequence of if-statements?
>  
> My question goes in a similar direction as this question about Go:
> http://stackoverflow.com/questions/9928221/
> table-of-functions-vs-switch-in-golang
> Here is what Ken Thompson has to say about optimizing switches:
> https://groups.google.com/forum/#!msg/golang-nuts/IURR4Z2SY7M/R7ORD_yDix4J
>  
> My question is not only about execution speed but also about memory
> consumption.
> I remember that in Java the following code consumed MORE memory:
> class Main {
>   private class Tuple { int x, y; }
>   private Tuple[] data = new Tuple[100];
>   public Main() {
>     for (int i=0; i<data.length; i++)
>       data[i] = new Tuple();
>   }
> }
> then this code:
> class Main {
>   private int[] x = new int[100];
>   private int[] y = new int[100];
> }
>  
> Wouldn't an array of function pointers consume less memory then the array
> of references to classes, which have the only purpose of indirection?
>  
> Thank you.

> ------------------------------------------------------------------------------
> Slashdot TV.  
> Video for Nerds.  Stuff that matters.
> http://tv.slashdot.org/
> _______________________________________________
> Chapel-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/chapel-users


------------------------------------------------------------------------------
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
Chapel-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/chapel-users

Reply via email to