next up previous
Next: Unsupported functions. Up: Common problems Previous: Meta-commands.

Automatic concatenation in print functions.

Some functions support automatic concatenation. For example, print("x="x) is a valid GP statement where the string "x=" and the value of x are concatenated. There is no operators that mark the concatenation operation, this is why it is called automatic concatenation.

This feature is broken with GP itself, though of course it works for the usual usages. GP 2.2.4 use an less broken but incompatible algorithm, which still give exact same result in the usual cases.

Starting at 0.0.2, gp2c support automatic concatenation the same way as GP 2.2.4 (whatever version of GP you use). Previous versions had no support for automatic concatenation.

This may cause problems if you use strange constructs like print("a="[b]) that are no more allowed by GP 2.2.4. Please write print("a=",[b]) instead.

In any case, the gp2c author advise to not rely on this feature and always use commas.

Note: currently gp2c allows automatic concatenation with all functions, not just print-like functions. This may change in the future.



Bill Allombert 2006-01-28