EEP: XXX Title: F/N converts to {F,N} in *all* directives Version: $Revision: 14 $ Last-Modified: $Date: 2007-06-29 16:24:01 +0200 (Fri, 29 Jun 2007) $ Author: Richard A. O'Keefe Status: Draft Type: Standards Track Erlang-Version: R12B-4 Content-Type: text/plain Created: 22-Sep-2008 Post-History: Abstract In directives the form F/N (where F is an atom and N is a non-negative integer) should be converted to {F,N}. Specification In any directive the form F/N (where F is an atom and N is a non-negative integer) should be converted to {F,N}, provided that it is not in an expression that would be evaluated. Other occurrences of X/Y are not addressed by this EEP. In particular, occurrences of X/Y in -record or -enum declarations would be evaluated, so are not affected. Motivation Compare -compile({inline, [{ukeymerge3_12,13}, {ukeymerge3_21,13}, {rukeymerge3_12a,11}, {rukeymerge3_21a,13}, {rukeymerge3_12b,12}, {rukeymerge3_21b,12}]}). -deprecated( [{new_set,0},{set_to_list,1},{list_to_set,1},{subset,2}]). with -compile({inline, [ ukeymerge3_12/13, rukeymerge3_12a/11, rukeymerge3_12b/12, ukeymerge3_21/13, rukeymerge3_21a/13, rukeymerge3_21b/12]}). -deprecated([ list_to_set/1, new_set/0, set_to_list/1, subset/2]). The improvement in readability is dramatic. The improvement in consistency is worth having: it's no longer a case of new_set/0 in an -export or -import directive but {new_set,0} in a -deprecated directive, it's the same in all directives, making it easier to find directives that mention a particular function. Rationale Directives that contain real expressions, such as -record (and, if it is accepted, -enum) require a certain amount of care. Otherwise, F/N occurrences in -export and -import directives _are_ converted to tuples (by farity_list), so this is just a small matter of extending the notion elsewhere. I cannot imagine why this wasn't done years ago. Backwards Compatibility There are currently no directives where F/N is accepted, is not part of an expression to be evaluated, and does not signify a function, and those where it does signify a function already treat it as an {F,N} tuple. No existing code can be affected. Reference Implementation None yet; I really ought to be writing exam questions. References None. Copyright This document has been placed in the public domain. Local Variables: mode: indented-text indent-tabs-mode: nil sentence-end-double-space: t fill-column: 70 coding: utf-8 End: