From atp at piskorski.com  Thu Oct 28 22:07:40 2010
From: atp at piskorski.com (Andrew Piskorski)
Date: Thu, 28 Oct 2010 16:07:40 -0400
Subject: [Rd] must .Call C functions return SEXP?
In-Reply-To: <14761267-D550-4BAC-9498-F1E0D32465E3@r-project.org>
References: <20101027234347.GA69179@piskorski.com>
	<1E6722DD-D3E2-4BDD-A9BE-C07271B3D1FC@r-project.org>
	<20101028134821.GA49312@piskorski.com>
	<14761267-D550-4BAC-9498-F1E0D32465E3@r-project.org>
Message-ID: <20101028200740.GA60469@piskorski.com>

On Thu, Oct 28, 2010 at 10:59:26AM -0400, Simon Urbanek wrote:

> Because R assumes that you don't mess with the arguments, it also
> optimizes b to point to the same object as a which you then modify.

> I hope it sheds some light on it.

Indeed!  Thank you Simon, that was a thorough and illuminating answer.

(Now I have better understanding of how the machine works, and what
the dangerous sharp bits are.  :)

-- 
Andrew Piskorski <atp at piskorski.com>
http://www.piskorski.com/



[Rd] must .Call C functions return SEXP?
Andrew Piskorski