On the contrary: NULL is a constant, {} is an expression, which needs to be
evaluated before you know its value. And, considering lazy evaluation and all
that, I wouldn't bet on the compiler to optimize the difference away.
-pd
> On 30 Apr 2026, at 11.42, Duncan Murdoch <murdoch.duncan at
gmail.com> wrote:
>
> The news item for a recent R-devel bug fix says this:
>
> - ?cut(1:11, {})? now signals an error for the invalid ?breaks?, fixing
PR#19057, thanks to Kevin Ushey.
>
> When I read that, I wondered why {} was used. Does it give some weird
exotic object? No, its value is NULL, which was used in the referenced bug
report.
>
> So my question is: why use {} instead of NULL in an expression? I
don't think there are any efficiency advantages.
>
> Duncan Murdoch
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
--
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Office: A 4.23
Email: pd.mes at cbs.dk Priv: PDalgd at gmail.com