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:19:02 EST


Hi Matthias,

> Read Quine's set theory book for something like that and weep.

Yeah, like I said, I'm not used to it. Perhaps it's history for a reason.
 
> What's the objection to prefix? -- Matthias

Prefix is fine for functions or functional programs, but for scientific programs
that are more procedural or object-oriented in nature, the infix notation can be
more natural. If you allow a library to name an infix operator whatever it
wants, you have to either: (1) force the library to specify the precedence; (2)
force the same precedence on all user-defined operators; (3) allow the *user* of
the library to specify the precedence; (4) ignore precendence altogether
(Smalltalk); or (5) use ad hoc precedence, via commas and semicolons. If you
only allow libraries to use pre-existing symbols for infix operations (as in
C++), you don't have this problem.

Though, I like prefix in the case where you need to sum a lot of terms: it's
much easier to read the plus just once (and hope the author used Emacs to format
the code correctly). I think ideally you should have both options.

-Macneil



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