aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/src/qlc_pt.erl
AgeCommit message (Collapse)Author
2017-03-08stdlib: Fix handling of locations and annotationsHans Bolinder
2016-09-02Fix overridden BIFsBjörn Gustavsson
The filters in a list comprehension can be guard expressions or an ordinary expressions. If a guard expression is used as a filter, an exception will basically mean the same as 'false': t() -> L = [{some_tag,42},an_atom], [X || X <- L, element(1, X) =:= some_tag] %% Returns [{some_tag,42}] On the other hand, if an ordinary expression is used as a filter, there will be an exception: my_element(N, T) -> element(N, T). t() -> L = [{some_tag,42},an_atom], [X || X <- L, my_element(1, X) =:= some_tag] %% Causes a 'badarg' exception when element(1, an_atom) is evaluated It has been allowed for several releases to override a BIF with a local function. Thus, if we define a function called element/2, it will be called instead of the BIF element/2 within the module. We must use the "erlang:" prefix to call the BIF. Therefore, the following code is expected to work the same way as in our second example above: -compile({no_auto_import,[element/2]}). element(N, T) -> erlang:element(N, T). t() -> L = [{some_tag,42},an_atom], [X || X <- L, element(1, X) =:= some_tag]. %% Causes a 'badarg' exception when element(1, an_atom) is evaluated But the compiler refuses to compile the code with the following diagnostic: call to local/imported function element/2 is illegal in guard
2016-09-01qlc_pt: Simplify code because of updated erl_expand_recordsBjörn Gustavsson
erl_expand_records now adds "erlang:" to calls to BIFs, so we can simplify the code.
2016-06-09stdlib: Correct types and specsHans Bolinder
2016-02-17stdlib: Update qlc_pt to handle typed record fieldsHans Bolinder
2016-01-20stdlib: Update erl_parse(3)Hans Bolinder
Calls to map_anno(), fold_anno(), and mapfold_anno() with lists of erl_parse trees have been replaced. Those functions accept lists of erl_parse trees, but it was not the intention when the functions were introduced, and it is not documented.
2015-08-21stdlib: fix a qlc bug introduced in 18.0Hans Bolinder
As pointed out by roowe, qlc does not handle errors in early compiler (scanner, parser) well in OTP 18.0.
2015-06-18Change license text to APLv2Bruce Yinhe
2015-04-30stdlib: Silence some of qlc's warningsHans Bolinder
As long as the Erlang Compiler and qlc do not agree on the location of LC warnings, qlc's own warnings about patterns and filters that always fail have been silenced.
2015-04-30stdlib: Use module erl_annoHans Bolinder
2014-03-03Fix a qlc bug where filters were erroneously optimized awayHans Bolinder
Thanks to Sam Bobroff for reporting the bug.
2013-12-12EEP 37: Funs with namesAnthony Ramine
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) -> let <Fun> = '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.
2013-01-25Update copyright yearsBjörn-Egil Dahlberg
2013-01-25Make adjustments for UnicodeHans Bolinder
2013-01-09qlc: Remove support for packagesBjörn Gustavsson
2012-01-27Move types and specs from erl_bif_types.erl to modulesHans Bolinder
2011-05-12Types and specifications have been modified and addedHans Bolinder
2010-02-12Merge branch 'ks/stdlib-cleanups' into ccase/r13b04_devErlang/OTP
* ks/stdlib-cleanups: stdlib: clean up as suggested by tidier OTP-8435: ks/stdlib-cleanups
2010-02-10stdlib: clean up as suggested by tidierKostis Sagonas
Hans Bolinder (the author/maintainer of qlc) prefers for readability reasons to use length/1 in a guard when it is known that the list is guaranteed to be short, so the change suggested by tidier for line 875 of qlc_pt has not been included.
2009-11-20The R13B03 release.OTP_R13B03Erlang/OTP