Hi,
If you would deal with it that simple, it would
be that simple. But the analogy is broken, although
13211-1 defines a behaviour for:
7.8.7 (->)/2 - if-then
The DCG draft leaves if-then unspecified:
7.14.12 ->//2 - if-then
The effect of (->)//2 in grammar rules except
in the first argument of an alternative (cf. 7.14.5)
shall be implementation dependent.
So although tony dodd(*) defined a behaviour
for (->)/2 the initial draft from tony dodd
was already screwed up in that he needed 3 clauses
to define (;)/2 and (->)/2 instead only 2 clauses.
And the current draft then got further botched,
since the reference implementation noew does not
support (->)/2 anymore, probably a coding error (**)
of the simple spec from tony dodd.
Bye
(*)
people.sju.edu/~jhodgson/wg17/d895.ps
(**)
I guess there is a confusion about T3, making it
the main entry point (for bodies), wheras T (for rules)
resp T2 (for bodies) are the main entry points in
Tony Dodds spec. Shame.
ulr...@mips.complang.tuwien.ac.at (Ulrich Neumerkel) schrieb:
> Jan Burse <
janb...@fastmail.fm> writes:
>>
ulr...@mips.complang.tuwien.ac.at (Ulrich Neumerkel) schrieb:
>>> Jan Burse <
janb...@fastmail.fm> writes:
>>>> Just a thought. Adding (*->)/2 to the DCG
>>>> standard would be nice. I have the feeling
>>>> that it could be useful in the Mini Isabelle
>>>> Clones Command language.
>>>
>>> You can add such constructs as an implementation specific extension.
>>>
>>> Before adding (;)//2 resp. (*->)//2 or if//3 as a grammar control
>>> construct to DCGs, the corresponding control construct (;)/2 (*->)/2
>>> or if/3 would need to be defined. There are all kinds of subtle
>>> differences between implementations. In particular w.r.t. cuts
>>> in If and Then ; the relation to 7.6.2 etc. I cannot see any
>>> convergence there.
>>
>> The (;)/2 exists already:
>>
>> 7.14.4 (;)//2 â alternative
>
> This is in analogy 13211-1 to
>
> 7.8.6 (;)/2 - disjunction and
> 7.8.8 (;)/2 - if-then-else
>
>> But for a (*->)/2 it would need some modding. Especially:
>>
>> 7.14.5 (;)//2 with (->)//2 â if-then-else
>>
>>