p4-spec icon indicating copy to clipboard operation
p4-spec copied to clipboard

Repeated table properties?

Open jnfoster opened this issue 4 years ago • 3 comments

Section 13.2 of the P4 Language Spec says

Syntactically a table is defined in terms of a set of key-value properties.

Note that we say a "set" and not a "list" or a "bag." Does this mean that each key can occur at most once? Or do we mean that each unique key-value pair can occur at most once? @jafingerhut reports that the front-end rejects tables declared with repeated keys. Perhaps we should clarify...

Also, the use of the word "key" is possibly confusing, given that key is a required property.

jnfoster avatar Dec 13 '21 21:12 jnfoster

Today the table is treated like a namespace and the properties like declarations. That's why you cannot have duplicates.

mihaibudiu avatar Dec 14 '21 00:12 mihaibudiu

Sure. I'll make a PR on the text to clarify the confusing bits...

jnfoster avatar Dec 14 '21 01:12 jnfoster

Fixed by #1163.

jnfoster avatar Oct 07 '22 18:10 jnfoster

Closing as fixed.

jnfoster avatar Nov 11 '23 13:11 jnfoster