[m-dev.] Switch Goals.

Paul Bone pbone at csse.unimelb.edu.au
Sat Jun 21 21:34:00 AEST 2008


People probably already know this, but this switch goal is deterministic, but the complier disagrees, beleiving it to be nondet.

    (
        Memory = no_memory,
        MaybeHeader = no
    ;
        % The introduction of these three goals steams to stop the goal being
        % treated as one big switch, Instead it gets treated as a disjunction
        % whose first branch may fail, and whose second branch may succeed 
        % more than once.
        Self = self_link(TableInfo),
        Total = s("Total"),
        Percent = percent_label,
        (
            Memory = memory(Units),
            SubTitles = [Self, Percent, Total, Percent]
        ;
            Memory = memory_and_percall(Units),
            SubTitles = [Self, Percent, percall,
                Total, Percent, percall]
        ),
        (
            Units = units_words,
            Title = "Memory words"
        ;
            Units = units_bytes,
            Title = "Memory bytes"
        ),
        MaybeHeader = yes(table_header_group(Title, SubTitles,
            table_col_class_memory))
    )

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mercurylang.org/archives/developers/attachments/20080621/39a16066/attachment.sig>


More information about the developers mailing list