clarkgrubb / hyperpolyglot

hyperpolyglot.org
Other
473 stars 94 forks source link

PARI/GP missing argument behavior #94

Open CRGreathouse opened 6 years ago

CRGreathouse commented 6 years ago

As of version 2.6.0, the default strictargs was added, which changes missing argument behavior. If the default is set to 1, arguments are required unless they have default values. If set to 0, missing arguments are set to 0.

? default(strictargs) %1 = 0 ? (x->x^2)() %2 = 0 ? default(strictargs,1) ? (x->x^2)() at top-level: (x->x^2)() ^--------- in anonymous function: x ^- missing mandatory argument 'x' in user function. Break loop: type 'break' to go back to GP prompt