[m-dev.] proof-of-concept code for choosing a grade

Zoltan Somogyi zoltan.somogyi at runbox.com
Sun Dec 6 04:45:33 AEDT 2015

On Sat, 5 Dec 2015 22:26:05 +1100, Peter Wang <novalazy at gmail.com> wrote:
> Another approach may be to write the compute grade code in Mercury
> for the compiler.  Then, from the same data, enumerate all valid grades
> and generate a shell script that uses pattern matching or other simple
> techniques to select a valid grade given the values of the variables.
> See the attached script for example.  It is an awk script but something
> similar could be done in shell.  I think the number of valid grades
> should not be too great.

Yes, I think this approach can be made to work. It can even be
extended to give meaningful error messages for (at least SOME
cases of) conflicting grade components. Writing shell code by hand
would be too much of a maintenance burden when the set of
grade components change, but generating the shell code
automatically makes that a non-issue.

I will look into this and report back.


More information about the developers mailing list