Jeroen Demeyer on Tue, 22 Nov 2005 12:00:27 +0100


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

Re: print1() behaviour changed


Bill Allombert wrote:
In fact, the reason is very different:

PARI/GP has the notion of 'input line': it reads a full input line
and evaluate it. If the output does not end by a \n, it adds it,
so the next output will be properly aligned.

print1(0);print1(1); is a single input line but print1(0);\nprint1(1);
is two input lines. The solution is to use braces around your
script to make it look like a single input line:
{print1(0);\nprint1(1);}



It does not normally affect scripts.  It only affects running scripts as
gp -q < script

In that case you can do
gp -q script </dev/null
instead, or use braces.

Thanks for your reply.  Your "braces" suggestion works indeed.