Implementing nth1 list operation in SWI prolog
问题 How would you code your own predicate in Prolog, to do exactly what the nth1 function does? For those not familiar with that function, its power is best displayed through an example: ?- nth1(2, [a,b,c], E, R). E = b R = [a, c] When the nth1 function is called, and is passed the following: - an index of an element, of which is to be removed from the list (note that it is not zero-indexed, and that here, we are passing index 2) - the list (in this case, it is [a,b,c]) - E, which will be