From tkeitt at utexas.edu  Wed May 25 14:32:15 2016
From: tkeitt at utexas.edu (Tim Keitt)
Date: Wed, 25 May 2016 07:32:15 -0500
Subject: [Rd] Suggestion: mkString(NULL) should be NA
In-Reply-To: <CAOQ5NyftzeVpbRGxM0Jd6=8f00VENWnAmW2oBQchALqvzKJOmA@mail.gmail.com>
References: <CABFfbXt7raZDRaGP+T=XWKeBZq8oh88FRh8+Xj7jFkf_VFspsA@mail.gmail.com>
	<CABFfbXu0LTrSy9Qq5mouq6fX=nN=NF9xshtM8Q9khYn3cWtEQw@mail.gmail.com>
	<CADwqtCP2O7zUSJ3BHvYbkD25EyJPyj9LhdazJf5UzELVW1_9-w@mail.gmail.com>
	<CABFfbXtUHYepH93PZrYktNbFfNX-Y8iF5Pk6DYOgUFk=MGK7pA@mail.gmail.com>
	<CADwqtCNLmskyk1v_syjGeH6H4tnLTAkihKh8c0gHuc7nHDqpDQ@mail.gmail.com>
	<22341.32520.155909.439980@stat.math.ethz.ch>
	<CABFfbXtVi09hpKc-FbgWBbPkJrU1V2bNdsTHqBEdxFK2rfmpog@mail.gmail.com>
	<CAOQ5NyftzeVpbRGxM0Jd6=8f00VENWnAmW2oBQchALqvzKJOmA@mail.gmail.com>
Message-ID: <CANnL8gpKeY7XVeLf+WyKCT_C2yjGo69_t25r-LTdmVu93_6eCw@mail.gmail.com>

On Wed, May 25, 2016 at 7:22 AM, Michael Lawrence <lawrence.michael at gene.com
> wrote:

> On Wed, May 25, 2016 at 4:23 AM, Jeroen Ooms <jeroen.ooms at stat.ucla.edu>
> wrote:
>

I'm not disagreeing with what's been said in this thread, but I can't help
but recall that I brought up this exact issue probably 15 years ago and was
told (by Brian, I believe) "don't do that" (pass a null pointer), which was
perfectly fine. The real issue was not the behavior but that it was not
documented or consistent. I've lived by the mantra since that you can never
trust a pointer in R code. User must always check for NULL.

I just wrote my own functions mkXXX_safe that wrap the internals and check
the pointer.

THK

http://www.keittlab.org/

	[[alternative HTML version deleted]]



[Rd] Suggestion: mkString(NULL) should be NA
Tim Keitt