Re: standard function to change element at list position ?



On 2006-06-29, none <kaizer@xxxxxxx> wrote:
Hello,
is there a standard function that allows the value at some list position
to be changed by another value?

Examle:

change(List, Number, NewValue, NewList)

change([k, q, u], 3, z, NewList)

NewList would equal [k, q, z]

Not that I'm aware of. In all my years of Prolog programming I've never
had the need to do this. I have the impression you have are using the
wrong representation and you should have been using a compound term or
some array library. Of course it is not hard to write ...

Cheers -- Jan
.