EEP: XXX Title: read/2 function for Mnesia 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-Oct-2008 Post-History: Abstract A convenience function mnesia:read/2 is added. Specification The 'mnesia' module has read/1 and read/3 and dirty_read/1 and dirty_read/2. But there is no read/2. So we add read(Tab, Key) -> read(Tab, Key, read). The documentation is revised to match. Motivation On the 22nd of October, 2008, attila.rajmund.nohl@ericsson.com complained that it is hard to switch between 'dirty_read' and 'read' because the arities don't match. Rationale In effect, this provides a default argument. With this addition, programmers can as easily switch between dirty_read(Tab, Key) and read(Tab, Key) as they can between dirty_read({Tab,Key}) and read({Tab,Key}). Backwards Compatibility Nothing should break. Most of the work is fixing the documentation. Reference Implementation (1) Add the two lines read(Tab, Key) -> read(Tab, Key, read). somewhere in mnesia.erl; just after read/1 would be good. (2) Change the documentation for dirty_read/2 from "This is the dirty equivalent of the mnesia:read/3 function." to "This is the dirty equivalent of the mnesia:read/2 function." (3) Add the documentation entry "read({Tab, Key}) -> transaction abort | RecordList Invokes mnesia:read(Tab, Key, read)." between the entries for read/1 and read/3. 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: