[m-dev.] Fw: Replacement syntax for DCGs
Ralph Becket
rafe at cs.mu.OZ.AU
Tue Nov 27 10:32:06 AEDT 2001
Peter Ross, Monday, 26 November 2001:
>
> These are some of the points that you need to consider.
Michael Day addressed most of these in his reply, but here's my take.
> How to you declare the predicate/function which uses this threading?
Just as with DCGs, the _ ! _ notation is purely syntactic sugar for
the definition.
> What about it you want it to have multiple modes?
Again, as with DCGs, the mode declarations are entirely separate from
the _ ! _ notation.
> What about it you want to using this syntax on higher order. What are
> the implications of that?
Michael's suggestion was what I had in mind, using the same thing as is
currently done for DCGs. For example,
array ! io ! list__foldl2(
( array ! io ! pred(X::in, di, uo, di, uo) is det :-
...
),
[1, 2, 3]
)
> I would be nice to generalise this to the case of having more than one
> pair of state arguments threaded. How would you declare that?
See above!
- Ralph
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to: mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions: mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------
More information about the developers
mailing list