Re: more version 7 woes re phrase/3
Jan Wielemaker <[email protected]>
| Newsgroups | gmane.comp.ai.prolog.swi |
|---|---|
| Message-ID | <[email protected]> |
Samer,
On 12/21/2013 12:03 AM, Abdallah, Samer wrote:
> Hello again,
> I'm sorry if missed the discussion regarding this new feature, but it seems that phrase/3
> no longer works with an arbitrary type for the last two arguments, but requires
> two lists. This is something of a pain for me as I often use DCG notation to write
> all sorts of stateful code where the threaded value is not a list, but, e.g. a pair (X,Y)
> or a number. Is there any work around for this restriction?
This was added (as you may have guessed) to trap strings that are passed
to phrase/3.
Think of this the naive top level tests doing
?- phrase("hello", "h", Rest).
Nothing changed to the compilation though. My first impression is that
phrase/3 is designed to deal with lists. What about inventing another
name for phrase/3, or even, simply go back to the basics and rely
on call/3:
call(ruleset, StateIn, StateOut).
After all, I'd guess that you do not want general DCG body as
the first argument? If this is considered a good compromise,
I'll add a note to the docs of phrase/3.
Cheers --- Jan
>
> Samer.
>
> -------------- next part --------------
> A non-text attachment was scrubbed...
> Name: signature.asc
> Type: application/pgp-signature
> Size: 495 bytes
> Desc: Message signed with OpenPGP using GPGMail
> URL: <https://lists.iai.uni-bonn.de/pipermail/swi-prolog/attachments/20131220/aba6fc96/attachment.bin>
> _______________________________________________
> SWI-Prolog mailing list
> [email protected]
> https://lists.iai.uni-bonn.de/mailman/listinfo.cgi/swi-prolog
>