Skip to content

Commit

Permalink
Convert to Markdown
Browse files Browse the repository at this point in the history
Conflicts:

	eep-0005.md
	eep-0006.md
	eep-0007.md
	eep-0008.md
	eep-0009.md
	eep-0010.md
	eep-0011.md
	eep-0012.md
  • Loading branch information
KennethL authored and RaimoNiskanen committed Apr 6, 2010
1 parent 6150b5a commit 716d4a9
Show file tree
Hide file tree
Showing 8 changed files with 837 additions and 891 deletions.
41 changes: 21 additions & 20 deletions eeps/eep-0005.md
@@ -1,17 +1,18 @@
EEP: 5
Title: More Versatile Encapsulation with export_to
Version: $Revision$
Last-Modified: $Date$
Author: Per Gustafsson
Status: Draft
Type: Standards Track
Content-Type: text/x-rst
Created: 10-Aug-2007
Erlang-Version: R12B-0
Post-History:
EEP 5: More Versatile Encapsulation with export_to
====

Author: Per Gustafsson
Status: Draft
Type: Standards Track
Content-Type: text/x-markdown
Created: 10-Aug-2007
Erlang-Version: R12B-0
Post-History:

====

Abstract
========
--------

This EEP describes a new directive called export_to which allows a
module to specify exactly which other modules that can call a function
Expand All @@ -22,7 +23,7 @@ his code should be used.
This is an idea originally proposed by Richard O'Keefe.

Specification
=============
-------------

This is the syntax for the export_to directive:

Expand All @@ -31,16 +32,16 @@ This is the syntax for the export_to directive:
where `f` is the name of a function of arity `a` and `m` is a
module. (Perhaps we should allow a list of modules)

This means that the function f/a can be called from the module
m. Whether the call is a static call, dynamic call or an apply should
This means that the function `f/a` can be called from the module
`m`. Whether the call is a static call, dynamic call or an apply should
not matter.

In addition these functions should act as exported functions to the
rest of the world i.e. calls to these functions should always be to
the latest version of the function.

Motivation
==========
----------

The module in Erlang have several roles. It is the unit of compilation
and code reloading. It is also the unit of encapsulation, because the
Expand All @@ -67,14 +68,14 @@ the export directive, but to be an alternative in the case when the
programmer knows all possible collaborators.

Rationale
=========
---------

There are some choices in designing the export_to syntax for example
should m be allowed to be a list of modules or should we have an
export_to list where each entry is a module, function/arity pair. One
reason to use the suggested syntax is that it reads pretty easily as:

export to module m this list of functions [f/a]
export to module `m` this list of functions `[f/a]`

Another issue is whether we should have some syntactic sugar for
specifying common export patterns e.g. exporting a set of functions to
Expand All @@ -89,14 +90,14 @@ creating such extensions without having to change the Erlang runtime.
.. Other languages that have something like this?

Backwards Compatibility
=======================
-----------------------

Adding an export_to directive should be totally backwards
compatible. Since writing such a directive now causes a syntax error
since it is not a legal attribute.

Implementation
==============
--------------

This feature has not been implemented yet, but here are some goals
that we think the implementation should fulfill:
Expand Down
35 changes: 18 additions & 17 deletions eeps/eep-0006.md
@@ -1,28 +1,29 @@
EEP: 6
Title: New BIFs for tuple and binary sizes
Version: $Revision$
Last-Modified: $Date$
Author: Bjorn Gustavsson
Status: Draft
Type: Standards Track
Content-Type: text/x-rst
Created: 10-Aug-2007
Erlang-Version: R12B-0
Post-History:
EEP 6: New BIFs for tuple and binary sizes
====

Author: Bjorn Gustavsson
Status: Draft
Type: Standards Track
Content-Type: text/x-markdown
Created: 10-Aug-2007
Erlang-Version: R12B-0
Post-History:

====

Abstract
========
--------

This EEP describes the two new guards BIFs ``tuple_size/1`` and ``byte_size/1``
as a prefered alternative to the ``size/1`` BIF.

Specifications
==============
--------------

``byte_size/1::bitstring() -> integer()``

Returns the number of bytes needed to store the entire *bitstring*
(see http://www.erlang.org/eeps/eep-0004.html). This BIF will return
(see <http://github.com/KennethL/EEP/blob/master/eep-0004.md>). This BIF will return
the same value as ``(bit_size(Bin)+7) div 8`` (that is, the number
of bytes will be rounded up if number of bits is not evenly divisible by 8).
This BIF is allowed in guards.
Expand All @@ -33,7 +34,7 @@ Returns the size of a tuple. This BIF will fail if passed anything
that is not a tuple. This BIF is allowed in guards.

Rationale
=========
---------

The ``size/1`` BIF accepts either a binary or a tuple, and returns
either the size of binary in bytes or the size of the tuple.
Expand All @@ -54,12 +55,12 @@ and the correct expression ``(bit_size(B)+7) div 8`` is not immediately
obvious.

Implementation
==============
--------------

The implementation is trivial.

Backwards Compatibility
=======================
-----------------------

Code containing local functions named ``tuple_size/1`` or ``byte_size/1`` need
to be changed.
Expand Down

0 comments on commit 716d4a9

Please sign in to comment.