Jacques Gélinas on Sun, 05 Aug 2018 23:06:05 +0200


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: Parser inline function problem


This is just an example of ecpressions being interpreted as functions,
notably Inside print() where the wanted context is “character string”.
Thus one must be very careful in inserting parenthesis in a print.
Compare
print("result="1+2)
print("result="(1+2))

I am asking if there is a switch to have the parser interpret
both statements as equivalents (as was the case in 2.4.1).

Jacques Gélinas



De : Bill Allombert
Envoyé : ‎dimanche‎, ‎5‎ ‎août‎ ‎2018 ‎11‎:‎44
À : pari-users@pari.math.u-bordeaux.fr

On Sun, Aug 05, 2018 at 03:24:44PM +0000, Jacques Gélinas wrote:
> Is it possible to stop the parser from searching for inline functions ?
>
> # v=version()
> %1 = [2, 11, 0]
> # print("v"(v));
>   ***   at top-level: print("v"(v))
>   ***                       ^-------
>   ***   not a function in function call

I do not understand what you want to do.

print("v"(v)) is invalid because "v"(v) is invalid, since
"v" is not a function (it is a character string).

Cheers,
Bill.