Thanks very much Brad Chamberlin. That pretty much solved my problem.
Agobin.
On Fri, Mar 18, 2016 at 5:15 PM, Brad Chamberlain <[email protected]> wrote:
>
> Hi Agobin --
>
> I dug into this a bit deeper after my original mail, and the issue
> has nothing to do with your use of first-class functions -- it's
> the use of a no-op function of the form:
>
> proc testArg(a);
>
> Apparently, we've never supported this form correctly (and arguably
> shouldn't support it at all for risk of confusion with C programmers). If
> you change it to the equivalent:
>
> proc testArg(a) { }
>
> I believe you should get past this internal error. I'm working for a fix
> for the internal error as we speak so that others don't run into it. Thanks
> for reporting it to us (which I should've done in the original mail)!
>
> -Brad
>
>
>
> On Fri, 18 Mar 2016, Brad Chamberlain wrote:
>
> Hi Agobin --
>>
>> Chapel's support for first-class functions (passing functions to other
>> functions)
>> is not so good right now and I suspect that you may be running into the
>> limits
>> of its capabilities. Compiling the code in --devel mode (which de-sugars
>> the
>> internal error message a bit), it seems to be specific to the fact that
>> testArg()
>> is a function with a no-op body. If I make it into:
>>
>> proc testArg(a) {
>> writeln("hi");
>> }
>>
>> I get a bit further (basically, I run into problems with not having
>> replicated
>> your setup in my environment and not having all the routines available to
>> me.
>>
>> Since you're using first-class-functions, though, I did want to note
>> that, within
>> Chapel, some users have gotten around some of their limitations by using
>> objects with well-defined interfaces and passing those around instead.
>> And
>> I'll note that passing a Chapel function pointer out to an extern C
>> routine is
>> a frequently requested feature that is not yet supported (in case that's
>> something
>> you're going to want to do). :( If you are going to need to do that,
>> it may be
>> worth asking on chapel-users whether anyone has found a workaround for
>> doing
>> so -- I'm not aware of one offhand...
>>
>> -Brad
>>
>>
>>
>> ________________________________
>> From: Agobin Fobella [[email protected]]
>> Sent: Friday, March 18, 2016 7:48 AM
>> To: [email protected]
>> Subject: [Chapel-bugs] Compiler found a bug
>>
>> Hello Chapel developers,
>>
>> I was compiling this project<https://github.com/Agobin/Chapel_GUI_testing>
>> of mine with chpl after modification of this file.<
>> https://github.com/Agobin/Chapel_GUI_testing/blob/master/Test.chpl>
>> Chapel's compiler reported this error message<
>> https://github.com/Agobin/Chapel_GUI_testing/blob/master/compilerMessage.txt>
>> to me, indicating it had
>> found a bug.
>> The error originated from this file this file<
>> https://github.com/Agobin/Chapel_GUI_testing/blob/master/Test.chpl> on
>> line 15.
>>
>> The idea I was trying to implement is exploiting generic functions to pass
>> a function as an argument to another function.
>>
>> Please for your feedback as it would enhance this project's development
>> or give me an alternative approach of working around the error message.
>>
>> Additional information
>> chpl version: 1.12.0
>> gcc version: 5.3.1
>> Output of $CHPL_HOME/util/printchplenv script<
>> https://github.com/Agobin/Chapel_GUI_testing/blob/master/ScriptOutput>
>>
>> Thanks,
>> Agobin.
>>
>>
>>
>>
------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140
_______________________________________________
Chapel-bugs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/chapel-bugs