msp-strath / Mary

Mary is the successor of Marx, a content delivery and assessment engine based on markdown and git
17 stars 1 forks source link

Prio guards #56

Closed pigworker closed 4 years ago

pigworker commented 4 years ago

I think this branch could be merged. All tests pass.

But should it be merged? Whatever I've forgotten, I've don't remember, but perhaps you do.

Meanwhile, there might still be a few bikesheds to bother about.

  1. I've used % for prioritized choice, but perhaps that's bold. I wouldn't cry over ?> or some such, as long as its asymmetric, short, etc.
  2. I've used \ for effect masking. Again, bold. I had originally plotted ^ and I might still prefer that.
  3. I've used | for guarding, as in p | g1 -> e1 | g2 -> e2 ... which is very far from weird, but removes the option to use | as a clause separator. Lots of things would work instead, including ,.

Feel free to kick around before merging.

pigworker commented 4 years ago

Also holler if you think it's barbaric of me to allow

p | g -> e
      -> e'

In general, a pattern is followed by a nonempty sequence of right hand sides, each of which is either | g -> e or just -> e.

fredrikNordvallForsberg commented 4 years ago

I think you also forgot examples/guards.shonkier, but now we have the gold for it at least.

fredrikNordvallForsberg commented 4 years ago

Colour opinions:

  1. I like ?>.
  2. I'm not a big fan of \, as the arguments are swapped compared to CSP's hiding operator. I'm happy with ^.
  3. I'm in favour of | for guards.
  4. I think I would be happier with p | g -> e | -> e' over p | g -> e -> e'(ie a right hand side is either unguarded, or a nonempty sequence of | maybe-guard -> es)
pigworker commented 4 years ago

OK, I'll make those changes.