Uploaded image for project: 'Erlang/OTP'
  1. Erlang/OTP
  2. ERL-1461

match_spec support for :_ map keys

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Trivial
    • Resolution: Won't Do
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      This is currently an invalid match spec for data that looks like this

      #{
        chars: #{
          53533=> #{class: :mage},
          13543135=> #{class: :archer},
        } 
      }
      
      ets.match_object(Account, {'_', #{chars: #{'_'=> #{class: :mage}}}})
      
      ** (ArgumentError) argument error

      Results in an argument error. Because the key of a map cannot be :_.

      I think that the match_spec can be extended to support this use case (as well as lists).

       

        Attachments

          Activity

            People

            Assignee:
            lukas Lukas Larsson
            Reporter:
            vans1631 vans163
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: