Content deleted Content added
m Signing comment by 210.84.17.212 - "→Examples of difficulties introduced by declarativeness?: " |
|||
Line 58:
::I find the Prolog construct cuts-in-all-cases-except-the-last more readable than the Mercury equivalent. But that's just my opinion which of course falls foul of [[WP:OR]]. But there is no issue of expressiveness. The claim "harder to express" needs removing or a reliable source. [[User:Pgr94|pgr94]] ([[User talk:Pgr94|talk]]) 10:57, 3 December 2009 (UTC)
Mercury: What you really want is something like this:
(
Line 74:
),
OpenHours = (8 - 17)
).
This is a switch whose third case is a multi-cons-id case, This gets compiled efficiently, expresses the computation clearly and (in the right context) uses the determinism checker to ensure that all days are covered exactly once. It can also be run in reverse where the OpenHours is ground and Day is free, where it would be nondeterministic. <span style="font-size: smaller;" class="autosigned">—Preceding [[Wikipedia:Signatures|unsigned]] comment added by [[Special:Contributions/210.84.17.212|210.84.17.212]] ([[User talk:210.84.17.212|talk]]) 01:56, 12 February 2010 (UTC)</span><!-- Template:UnsignedIP --> <!--Autosigned by SineBot-->
|