firefly icon indicating copy to clipboard operation
firefly copied to clipboard

Support _=Expr initializer for records

Open KronicDeth opened this issue 5 years ago • 1 comments

If several fields are to be assigned the same value, the following construction can be used:

#Name{Field1=Expr1,...,FieldK=ExprK, _=ExprL}

Omitted fields then get the value of evaluating ExprL instead of their default values. This feature is primarily intended to be > used to create patterns for ETS and Mnesia match functions.

This is not implemented in EIR:

stderr:    Compiling /Users/runner/work/lumen/otp/lib/common_test/src/ct_config.erl
error: unrecognized token
    ┌─ /Users/runner/work/lumen/otp/lib/common_test/src/ct_config.erl:301:19
    │
301 │                      config=File,_='_'}),
    │                                  ^ expected: "atom"

error: parsing failed

      Failed /Users/runner/work/lumen/otp/lib/common_test/src/ct_config.erl

Affects the following files in OTP:

  • lib/common_test/src/ct_config.erl
  • lib/common_test/src/ct_util.erl
  • lib/common_test/src/ct_util.erl

KronicDeth avatar Sep 21 '20 22:09 KronicDeth

Per Dec 9 standup, @hansihe will check to see if this is resolved or not

bcardarella avatar Dec 09 '20 16:12 bcardarella