Dear Nikhil,

I see, this is a keyword for "label"ing for-loops etc... XD

I will try to search the Language Spec PDF from the next time :-)

Thanks very much,
-- Takeshi

2017-05-27 8:00 GMT+09:00 Nikhil Padmanabhan <[email protected]>:
> Dear Takeshi,
>
> "label" is a Chapel keyword (for loops)....
>
> See the Chapel language spec here :
>   http://chapel.cray.com/docs/latest/_downloads/chapelLanguageSpec.pdf
>
> Sec 6.4.2 and Sec 11.10 in particular.....
>
> Cheers,
> -- Nikhil
>
>
> ---------------------------------
> Nikhil Padmanabhan
> [email protected]
>
> On Fri, May 26, 2017 at 6:46 PM, Takeshi Yamamoto <[email protected]>
> wrote:
>>
>> Hello,
>>
>> In the following code, I am trying to print a simple string
>> and the value of x:
>>
>> ---- test.chpl ---
>>
>> // proc foo( label, x ) {
>> //    writeln( label, " : ", x );
>> // }
>>
>> proc Foo( Label, x ) {
>>     writeln( Label, " : ", x );
>> }
>>
>> proc bar( msg, x ) {
>>     writeln( msg, " : ", x );
>> }
>>
>> var x = 1.23;
>>
>> // foo( "foo", x );
>> Foo( "Foo", x );
>> bar( "bar", x );
>>
>> --------------------------
>>
>> The only difference among foo(), Foo(), and bar() is
>> the name of the first formal argument (i.e., "label" vs "Label"
>> vs "msg").
>>
>> The functions Foo() and bar() work as expected,
>> while if I uncomment the definition of foo(),
>> the following error occurs:
>>
>>     test.chpl:2: syntax error: near 'label'
>>
>> where line 2 refers to
>>
>>     proc foo( label, x ) {
>>
>> So it seems that the variable name "label" has some problem,
>> but I cannot find a keyword such as "label" from the online
>> manual.
>>
>> Is there something strange with my code above, or am I
>> missing something...?
>>
>> With best regards,
>> Takeshi Yamamoto
>>
>>
>> ------------------------------------------------------------------------------
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>> _______________________________________________
>> Chapel-users mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/chapel-users
>
>

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Chapel-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/chapel-users

Reply via email to