Re: Daniel Jackson on types in Alloy


Subject: Re: Daniel Jackson on types in Alloy
From: Macneil Shonle (Macneil.Shonle@Sun.COM)
Date: Mon Feb 25 2002 - 10:04:02 EST


> > most of the time, a type error arises from misunderstanding precedence
> > rules, ...
>
> Oooh! I have a great idea for a language improvement that would statically
> eliminate a whole class of errors. :-)
>
> Paul

Not that this has anything to do with Daniel Jackson, Alloy, or types for that
matter, I think I good way to keep infix but get rid of precedence rules is to
do it Smalltalk style (always group left to right) with the ability to put a
comma or semi-colon (or double or triple commas, ...) after the operator:

  a + b + c == (a + b) + c
  a + b * c == (a + b) * c
  a +, b * c == a + (b * c)
  a * b +, c * d == (a * b) + (c * d)
  a * d +, c +; b * d == (a * (d + c)) + (b * d)

Some 18th century Mathematics was written this way, though I must say I'm not
used to it myself.

-Mac



This archive was generated by hypermail 2b28 : Mon Feb 25 2002 - 10:04:05 EST