Difference between memberchk/2 and member/2...

emacstheviking <[email protected]>
Newsgroups gmane.comp.gnu.prolog.general
Message-ID <CAEiEuULhqzYitp22kxC9XJTjF2qmSJjw7tRQ_3FN_uvZrmiz4g@mail.gmail.com>
Given this rule:

is_digit(C) :- memberchk(C, "0123456789").

which used to use "member",

and given that I intend to be parsing a source language read from a
file into a character list, what would be the more correct /
appropriate one to use and why?

I know that member() can backtrack and therefore be used to iterate
over a list but is that useful / relevant in my example rule ?

Thanks,
Sean.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.