New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initializing Header Stacks #198
Comments
There are no array initializers, you have to initialize each element by hand. |
This is definitely an inconsistency, (since other compound types can be initialized), but the one we can live with. Something for the future? |
Let's punt this until after the release. It would be good to have, but the
interaction with `next` and `last` could be subtle. And we wouldn't be able
to initialize stacks with holes...
…On Wed, May 10, 2017 at 8:16 PM, Vladimir Gurevich ***@***.*** > wrote:
This is definitely an inconsistency, (since other compound types can be
initialized), but the one we can live with. Something for the future?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#198 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ABwi0i3LpsPNcsWksDyz58WkCBhoy4qaks5r4n2GgaJpZM4NXb-9>
.
|
Let's implement something. |
In the interest of tidying up the set of active issues on the P4 specification repository, I'm marking this as "stalled" and closing it. Of course, we can always re-open it in the future if there is interest in resurrecting it. |
Personnel
Design
Implementation
p4-spec
:p4c
:Process
p4-spec
:p4c
:Hello,
I was wondering if it is possible to initialize header stacks, and if yes, how.
Obviously, we can initialize headers using tuples:
However, it is not clear what to do with a stack. I tried a tuple of tuples, which didn't go well:
The compiler said: "Cannot unify Tuple(2) to header vlan_tag_t[]"
I tried to flatten the initializer, by removing the internal braces. In that case the compiler could not unify Tuple(8) to vlan_tag_t[].
Casting didn't work either.
Is there any kind of tuple that can be unified with a header stack?
Thanks,
Vladimir
The text was updated successfully, but these errors were encountered: