Skip to content

Commit

Permalink
Move section
Browse files Browse the repository at this point in the history
Signed-off-by: Vladimír Štill <[email protected]>
  • Loading branch information
vlstill committed Feb 3, 2025
1 parent e3e1a96 commit 958c576
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions p4-16/spec/P4-16-spec.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -3510,6 +3510,25 @@ itself can be evaluated at compilation time. This restriction is
designed to ensure that the width of the result of the conditional
expression can be inferred statically at compile time.

[#sec-string-ops]
=== Operations on strings

The only operation allowed on strings is concatenation, denoted by
`++`. For string concatenation, both operands must be strings and
the result is also a string. String concatenation can only be
performed at compile time.

[source,p4]
----
extern void log(string message);
void foo(int<8> v) {
// ...
log("my log message " ++
"continuation of the log message");
}
----

[#sec-bit-ops]
=== Operations on fixed-width bit types (unsigned integers)

Expand Down Expand Up @@ -3861,25 +3880,6 @@ finding this information in a section dedicated to type `varbit`.

Additionally, the maximum size of a variable-length bit-string can be determined at compile-time (<<sec-minsizeinbits>>).

[#sec-string-ops]
=== Operations on strings

The only operation allowed on strings is concatenation, denoted by
`++`. For string concatenation, both operands must be strings and
the result is also a string. String concatenation can only be
performed at compile time.

[source,p4]
----
extern void log(string message);
void foo(int<8> v) {
// ...
log("my log message " ++
"continuation of the log message");
}
----

[#sec-casts]
=== Casts

Expand Down

0 comments on commit 958c576

Please sign in to comment.