New feature in v3: cast!
Alan DeKok
aland at deployingradius.com
Mon May 13 18:36:48 CEST 2013
Matthew Newton wrote:
> 'update' sections have been a pain in the past, but with the new
> ability to update multiple things in one section, it's much
> better. It does separate 'unlang' from most languages, and makes
> it look more like a configuration than a program. As much as
> removing/depracating it seems good (and I agree it is more usual
> for programmers), I'm not sure it's the best thing for a
> configuration language.
I agree. It may be useful, or it may be too confusing.
> I'm slightly struggling to see why the new '&' is needed. I'm
> probably being a bit slow!
Nope.
> Obviously
>
> "%{Example-Attribute}"
>
> is a string, but why not:
>
> %{Example-Attribute}
>
> rather than
>
> &Example-Attribute
The %{...} is verbose (IMHO). Plus, the xlat API is *completely*
separated from the conditional parser. So exposing the internals of
xlat to unlang requires some careful butchering of the code.
Adding '&' was simpler. And is prettier.
> So what is the difference between
>
> &User-Name := "prefix%{User-Name}"
>
> and
>
> %{User-Name} := "prefix%{User-Name}"
>
> apart from the latter is slightly longer to type, of course!
The first one requires no knowledge of the xlat internals.
Alan DeKok.
More information about the Freeradius-Devel
mailing list