- Code: Select all
`arg(N, Term, Arg). % N'th argument of Term = Arg`

Currently (ISO) arg/3 fails immediately if N is unbound, why not have it enumerate each N, 0 =< N < arity of Term?

then the following would happen:

- Code: Select all
`?- arg(N, foo(x,y,z), Arg).`

N = 1,

Arg = x ;

N = 2,

Arg = y ;

N = 3,

Arg = z

(this already works in SWI by the way, but not GNU)