<feed xmlns='http://www.w3.org/2005/Atom'>
<title>otp.git/lib/stdlib/examples, branch OTP-21.3.1</title>
<subtitle>Mirror of Erlang/OTP repository.
</subtitle>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/otp.git/'/>
<entry>
<title>erl_parse: Add parsing for new map type syntax</title>
<updated>2016-04-28T14:14:25+00:00</updated>
<author>
<name>Magnus Lång</name>
<email>margnus1@telia.com</email>
</author>
<published>2016-02-27T17:49:33+00:00</published>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/otp.git/commit/?id=a07a1d465994427d322c523f26dcabefeb14cf01'/>
<id>a07a1d465994427d322c523f26dcabefeb14cf01</id>
<content type='text'>
erl_types typesets mandatory keys with :=, and uses "..." as a shorthand
for "any() =&gt; any()". Add these to erl_parse so that all representable
types can be written in type-specs.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
erl_types typesets mandatory keys with :=, and uses "..." as a shorthand
for "any() =&gt; any()". Add these to erl_parse so that all representable
types can be written in type-specs.
</pre>
</div>
</content>
</entry>
<entry>
<title>stdlib: Update erl_id_trans to handle types and specs</title>
<updated>2016-02-17T11:58:19+00:00</updated>
<author>
<name>Hans Bolinder</name>
<email>hasse@erlang.org</email>
</author>
<published>2015-11-27T15:08:24+00:00</published>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/otp.git/commit/?id=a57f06ac6c2986feb14de0557d8051c8489788ee'/>
<id>a57f06ac6c2986feb14de0557d8051c8489788ee</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Change license text to APLv2</title>
<updated>2015-06-18T09:31:02+00:00</updated>
<author>
<name>Bruce Yinhe</name>
<email>bruce@erlang.org</email>
</author>
<published>2015-06-18T09:31:02+00:00</published>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/otp.git/commit/?id=738c34d4bb8f1a3811acd00af8c6c12107f8315b'/>
<id>738c34d4bb8f1a3811acd00af8c6c12107f8315b</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>stdlib: Fix erl_id_trans example</title>
<updated>2014-04-03T13:36:50+00:00</updated>
<author>
<name>Björn-Egil Dahlberg</name>
<email>egil@erlang.org</email>
</author>
<published>2014-04-03T13:36:50+00:00</published>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/otp.git/commit/?id=e26dbc750fdd207c852bf9006668c5771f465dcf'/>
<id>e26dbc750fdd207c852bf9006668c5771f465dcf</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>stdlib: Fixup id_transform_SUITE</title>
<updated>2014-01-28T16:06:42+00:00</updated>
<author>
<name>Björn-Egil Dahlberg</name>
<email>egil@erlang.org</email>
</author>
<published>2013-10-25T01:57:38+00:00</published>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/otp.git/commit/?id=6868557c0244140ea7709822e8f7a0ba26029b21'/>
<id>6868557c0244140ea7709822e8f7a0ba26029b21</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>EEP 37: Funs with names</title>
<updated>2013-12-12T09:46:08+00:00</updated>
<author>
<name>Anthony Ramine</name>
<email>n.oxyde@gmail.com</email>
</author>
<published>2012-11-10T16:06:01+00:00</published>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/otp.git/commit/?id=acbca8379bdde12612e27f3313a5c73f4db25381'/>
<id>acbca8379bdde12612e27f3313a5c73f4db25381</id>
<content type='text'>
This adds optional names to fun expressions. A named fun expression
is parsed as a tuple `{named_fun,Loc,Name,Clauses}` in erl_parse.

If a fun expression has a name, it must be present and be the same in
every of its clauses. The function name shadows the environment of the
expression shadowing the environment and it is shadowed by the
environment of the clauses' arguments. An unused function name triggers
a warning unless it is prefixed by _, just as every variable.
Variable _ is allowed as a function name.

It is not an error to put a named function in a record field default
value.

When transforming to Core Erlang, the named fun Fun is changed into
the following expression:

    letrec 'Fun'/Arity =
               fun (Args) -&gt;
                       let &lt;Fun&gt; = 'Fun'/Arity
                       in Case
    in 'Fun'/Arity

where Args is the list of arguments of 'Fun'/Arity and Case the
Core Erlang expression corresponding to the clauses of Fun.

This transformation allows us to entirely skip any k_var to k_local
transformation in the fun's clauses bodies.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This adds optional names to fun expressions. A named fun expression
is parsed as a tuple `{named_fun,Loc,Name,Clauses}` in erl_parse.

If a fun expression has a name, it must be present and be the same in
every of its clauses. The function name shadows the environment of the
expression shadowing the environment and it is shadowed by the
environment of the clauses' arguments. An unused function name triggers
a warning unless it is prefixed by _, just as every variable.
Variable _ is allowed as a function name.

It is not an error to put a named function in a record field default
value.

When transforming to Core Erlang, the named fun Fun is changed into
the following expression:

    letrec 'Fun'/Arity =
               fun (Args) -&gt;
                       let &lt;Fun&gt; = 'Fun'/Arity
                       in Case
    in 'Fun'/Arity

where Args is the list of arguments of 'Fun'/Arity and Case the
Core Erlang expression corresponding to the clauses of Fun.

This transformation allows us to entirely skip any k_var to k_local
transformation in the fun's clauses bodies.
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove support for the query keyword and query expressions</title>
<updated>2013-01-16T11:46:47+00:00</updated>
<author>
<name>Loïc Hoguin</name>
<email>essen@ninenines.eu</email>
</author>
<published>2012-11-19T17:31:03+00:00</published>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/otp.git/commit/?id=0dc3a29744bed0b7f483ad72e19773dc0982ea50'/>
<id>0dc3a29744bed0b7f483ad72e19773dc0982ea50</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove support for tuple funs</title>
<updated>2012-08-17T09:12:15+00:00</updated>
<author>
<name>Björn Gustavsson</name>
<email>bjorn@erlang.org</email>
</author>
<published>2012-08-02T09:26:48+00:00</published>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/otp.git/commit/?id=de7e01c958ff7c9e6da4034a53567a30a4ae5792'/>
<id>de7e01c958ff7c9e6da4034a53567a30a4ae5792</id>
<content type='text'>
Tuple funs were deprecated in R15B (in commit a4029940e309518f5500).
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Tuple funs were deprecated in R15B (in commit a4029940e309518f5500).
</pre>
</div>
</content>
</entry>
<entry>
<title>Update to work with whitespace in exec path</title>
<updated>2012-06-05T08:52:16+00:00</updated>
<author>
<name>Lukas Larsson</name>
<email>lukas@erlang-solutions.com</email>
</author>
<published>2012-05-30T16:45:34+00:00</published>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/otp.git/commit/?id=5f8867fb985b2b899e2ba8391652c7111f9df9bb'/>
<id>5f8867fb985b2b899e2ba8391652c7111f9df9bb</id>
<content type='text'>
OTP-10106
OTP-10107
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
OTP-10106
OTP-10107
</pre>
</div>
</content>
</entry>
<entry>
<title>EEP-23: Allow variables in fun M:F/A</title>
<updated>2011-11-07T12:57:03+00:00</updated>
<author>
<name>Björn Gustavsson</name>
<email>bjorn@erlang.org</email>
</author>
<published>2010-04-09T13:50:17+00:00</published>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/otp.git/commit/?id=ff432e262e65243cbc983fcb002527f8fae8c78b'/>
<id>ff432e262e65243cbc983fcb002527f8fae8c78b</id>
<content type='text'>
Currently, the external fun syntax "fun M:F/A" only supports
literals. That is, "fun lists:reverse/1" is allowed but not
"fun M:F/A".

In many real-life situations, some or all of M, F, A are
not known until run-time, and one is forced to either use
the undocumented erlang:make_fun/3 BIF or to use a
"tuple fun" (which is deprecated).

EEP-23 suggests that the parser (erl_parse) should immediately
transform "fun M:F/A" to "erlang:make_fun(M, F, A)". We have
not followed that approach in this implementation, because we
want the abstract code to mirror the source code as closely
as possible, and we also consider erlang:make_fun/3 to
be an implementation detail that we might want to remove in
the future.

Instead, we will change the abstract format for "fun M:F/A" (in a way
that is not backwards compatible), and while we are at it, we will
move the translation from "fun M:F/A" to "erlang:make_fun(M, F, A)"
from sys_pre_expand down to the v3_core pass. We will also update
the debugger and xref to use the new format.

We did consider making the abstract format backward compatible if
no variables were used in the fun, but decided against it. Keeping
it backward compatible would mean that there would be different
abstract formats for the no-variable and variable case, and tools
would have to handle both formats, probably forever.

Reference: http://www.erlang.org/eeps/eep-0023.html
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Currently, the external fun syntax "fun M:F/A" only supports
literals. That is, "fun lists:reverse/1" is allowed but not
"fun M:F/A".

In many real-life situations, some or all of M, F, A are
not known until run-time, and one is forced to either use
the undocumented erlang:make_fun/3 BIF or to use a
"tuple fun" (which is deprecated).

EEP-23 suggests that the parser (erl_parse) should immediately
transform "fun M:F/A" to "erlang:make_fun(M, F, A)". We have
not followed that approach in this implementation, because we
want the abstract code to mirror the source code as closely
as possible, and we also consider erlang:make_fun/3 to
be an implementation detail that we might want to remove in
the future.

Instead, we will change the abstract format for "fun M:F/A" (in a way
that is not backwards compatible), and while we are at it, we will
move the translation from "fun M:F/A" to "erlang:make_fun(M, F, A)"
from sys_pre_expand down to the v3_core pass. We will also update
the debugger and xref to use the new format.

We did consider making the abstract format backward compatible if
no variables were used in the fun, but decided against it. Keeping
it backward compatible would mean that there would be different
abstract formats for the no-variable and variable case, and tools
would have to handle both formats, probably forever.

Reference: http://www.erlang.org/eeps/eep-0023.html
</pre>
</div>
</content>
</entry>
</feed>
