Re: "maplist" for DCG?

Michael Ben Yosef <[email protected]>
Newsgroups gmane.comp.ai.prolog.swi
Message-ID <CABnaNcp5fQa3p1m+z-1wDffefs8jz_QrRMFQtNJBMoS=fvFvFg@mail.gmail.com>
> maplist(F, In, Out) is one thing, but how do you do the equivalent with a DCG, so the effect is something//2
> something(f, [In1, In2, In3])
> is equivalent to
> f(In1), f(In2), f(In3)
>
> where f/1 might be:
> f(X) --> { code(X,Y)}, [Y].
>
> In other words each input gets processed and appended to the DCG list.  I feel like there's probably a standard predicate for this.
>
>
> Alan Baljeu

Is the something//2 you're looking for not simply foldl/4? (Sorry I'm
late to this thread.)

Michael
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.