= Alternation Syntax

The v3 alternation syntax of `%{foo:-bar}` is no longer necessary, and has been removed.

The new approach is simpler and clearer, just use short-circuit `||`:
in an expression.

.Old Style - no longer supported
[source,unlang]
----
&Reply-Message := "Hello %{%{User-Name}:-none}"
----

.New Alternation
[source,unlang]
----
&Reply-Message := "Hello %{&User-Name || 'none'}"
----

This approach also means that nested alternation is no longer necessary:

.Old Style - no longer supported
[source,unlang]
----
&Reply-Message := "Hello %{%{NAS-Identifer}:-%{%{User-Name}:-none}}"
----

.New Alternation
[source,unlang]
----
&Reply-Message := "Hello %{&NAS-Identifier || &User-Name || 'none'}"
----

[NOTE]
====
Unlike version 3, any strings used in `||` alternation must be quoted.  Numbers and IP addresses do not need to be quoted.
====

// Copyright (C) 2021 Network RADIUS SAS.  Licenced under CC-by-NC 4.0.
// This documentation was developed by Network RADIUS SAS.
