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

Reply via email to