From lukas.stadler at oracle.com  Wed Sep 27 17:36:15 2017
From: lukas.stadler at oracle.com (Lukas Stadler)
Date: Wed, 27 Sep 2017 17:36:15 +0200
Subject: [Rd] logic ops with zero-extent raw vectors
Message-ID: <F18AEA1F-3000-4FA7-9BA1-A5DC447500CC@oracle.com>

Hi,

there was a change concerning logical operations about a year ago:
https://github.com/wch/r-source/commit/9e19d3e3dd5f657b5cfefe562bdd7ede2e2b8786
It's related to a discussion on this list:
https://hypatia.math.ethz.ch/pipermail/r-devel/2016-September/073068.html <https://hypatia.math.ethz.ch/pipermail/r-devel/2016-September/073068.html>

A change in logic.c:134 influences the result type of operations on zero-extent raw vectors.
Old behavior:
> raw(1) & raw(1)
[1] 00
> raw(0) & raw(0)
raw(0)
New behavior:
> raw(1) & raw(1)
[1] 00
> raw(0) & raw(0)
logical(0)

I'm wondering whether the logical result type was intentional, because, to me, the old behavior seems more consistent.

Best,
 Lukas
	[[alternative HTML version deleted]]



[Rd] logic ops with zero-extent raw vectors
Lukas Stadler