All pastes #244780 Raw Edit

Something

public text v1 · immutable
#244780 ·published 2006-11-10 04:31 UTC
rendered paste body
The general form is:
    type name qualifiers = init;

Where the components are loosely defined as:
    type: one of int, char, ...etc..., user defined types
    name: [a-zA-Z_][a-zA-Z_0-9]*
    qualifiers: one of '*', '[' number ']', '(' arg_list ')'
    init: one of '{' func body '}'
             '[' array init ']'
             '(' struct contents ')'

Examples:

int(int a) x = {
    return a+3;
};
/* is valid, and is also the same as */
int x(int a) = {
    return a+3;
};

/*note these can be mixed, since an fn decl is identical to a variable decl:*/
int a = 3, x(int n) = {return n+4;}, y[3] = [1, 2, 3];