Maybe I can explain my question even better, now: what I am asking about is not how to do anything algorithmically, but what single notation for new operators can conveniently handle all three common cases of how one would like to define them: - just lower (or higher) in precedence than the previous operator in the list (without naming it); - the same precedence as the previous operator in the list (without naming it); - just lower, higher, or the same, in precedence as some named operator. Now that I explain the question this way, one possible answer is apparent -- just use your suggested notation, but with an additional keyword :previous to use in place of the operator name. So you could make incremental definitions relative to the precedence of named operators, but let the definitions in your large file of built-in operators be relative to whatever operator came just earlier in the list, regardless of name. This is still not good enough with regard to editing the main list to change the order within a group of operators of the same precedence, since the first one of the group is the one which has to say it is :lower-than :previous rather than :same-as :previous. This problem is analogous to the problem with comma-separated list formats, when you want to add or delete items at the end, or reorder items including the one at the end. This is (I imagine) why the C programing language allows a trailing comma at the end of an array initializer. - BruceReceived on Saturday, 21 September 1996 15:39:31 UTC
This archive was generated by hypermail 2.4.0 : Saturday, 15 April 2023 17:19:57 UTC