From radford at cs.toronto.edu  Wed Nov  6 19:15:25 2013
From: radford at cs.toronto.edu (Radford Neal)
Date: Wed, 6 Nov 2013 13:15:25 -0500
Subject: [Rd] Dynamic list creation (SEXP in C) returns error
 "unimplemented type (29) in 'duplicate'" Dynamic list creation (SEXP in C)
 returns error
In-Reply-To: <CAPJUxXXcvh_9FmbZnR+u7oHO98xf3GdcFWbCuJDqaaXe-R+mUQ@mail.gmail.com>
References: <mailman.25.1383735608.27847.r-devel@r-project.org>
	<20131106170038.GA30482@cs.toronto.edu>
	<CAPJUxXXcvh_9FmbZnR+u7oHO98xf3GdcFWbCuJDqaaXe-R+mUQ@mail.gmail.com>
Message-ID: <20131106181525.GA8938@cs.toronto.edu>

On Wed, Nov 06, 2013 at 02:40:59PM -0300, George Vega Yon wrote:
> Hi! You are right, what I actually use is SET_LENGTH... Is that ok?
> El 06/11/2013 14:00, "Radford Neal" <radford at cs.toronto.edu> escribi?:

Is SET_LENGTH a documented feature of the API?  Not that I can see.

However, it is indeed different from SETLENGTH.  Perhaps your problem
is in the following code you posted:

  REPROTECT(SET_LENGTH(id,    length(lambda) + z), ipx0);
  REPROTECT(SET_LENGTH(lambda,length(lambda) + z), ipx1);

It looks like the first line should have length(id), not length(lambda).

Your usage of REPROTECT and duplicate seems odd.  If you make the
stuff you allocate part of your original list as soon as you allocate
it, you only need to protect the original list.  And it's not clear
why you think you need to duplicate vectors.

   Radford Neal



[Rd] Dynamic list creation (SEXP in C) returns error "unimplemented type (29) in 'duplicate'" Dynamic list creation (SEXP in C) returns error
Radford Neal