[Rprotobuf-commits] r588 - in pkg: . R vignettes

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Dec 21 01:16:54 CET 2013


Author: murray
Date: 2013-12-21 01:16:54 +0100 (Sat, 21 Dec 2013)
New Revision: 588

Modified:
   pkg/ChangeLog
   pkg/R/00classes.R
   pkg/vignettes/RProtoBuf-intro.Rnw
Log:
Fix a bug in as.list() for descriptor objects, and document this
method in the vignette.



Modified: pkg/ChangeLog
===================================================================
--- pkg/ChangeLog	2013-12-19 07:55:14 UTC (rev 587)
+++ pkg/ChangeLog	2013-12-21 00:16:54 UTC (rev 588)
@@ -1,3 +1,8 @@
+2013-12-20  Murray Stokely  <murray at FreeBSD.org>
+
+	* R/00classes.R: Correct a bug that incorrectly dispatched
+	  as.character() when as.list() was called on Descriptor objects.
+
 2013-12-18  Murray Stokely  <murray at FreeBSD.org>
 
 	* R/completion.R (.DollarNames.EnumValueDescriptor): Add

Modified: pkg/R/00classes.R
===================================================================
--- pkg/R/00classes.R	2013-12-19 07:55:14 UTC (rev 587)
+++ pkg/R/00classes.R	2013-12-21 00:16:54 UTC (rev 588)
@@ -206,7 +206,7 @@
 		"readASCII" = function( input ) readASCII( x, input ),
 		"toString" = function(...) toString(x, ...) ,
 		"as.character" = function(...) as.character(x, ...) ,
-		"as.list" = function(...) as.character(x, ...) ,
+		"as.list" = function(...) as.list(x, ...) ,
 		"asMessage" = function() asMessage(x),
 		"fileDescriptor" = function() fileDescriptor(x ),
 		"name" = function(...) name(x, ... ),

Modified: pkg/vignettes/RProtoBuf-intro.Rnw
===================================================================
--- pkg/vignettes/RProtoBuf-intro.Rnw	2013-12-19 07:55:14 UTC (rev 587)
+++ pkg/vignettes/RProtoBuf-intro.Rnw	2013-12-21 00:16:54 UTC (rev 588)
@@ -884,6 +884,8 @@
 this descriptor.\\
 \texttt{as.character} & \ref{Descriptor-method-ascharacter} & character representation of a descriptor\\
 \texttt{toString} & \ref{Descriptor-method-tostring} & character representation of a descriptor (same as \texttt{as.character}) \\
+\texttt{as.list} & \ref{Descriptor-method-aslist} & return a named
+list of the field, enum, and nested descriptors included in this descriptor.\\
 \texttt{asMessage} & \ref{Descriptor-method-asmessage} &
 return DescriptorProto message. \\
 \hline
@@ -1003,6 +1005,16 @@
 writeLines( as.character(tutorial.Person) )
 @
 
+\subsubsection{as.list}
+\label{Descriptor-method-aslist}
+
+The \texttt{as.list} method returns a named list of the field, enum,
+and nested descriptors included in this descriptor.
+
+<<>>=
+tutorial.Person$as.list()
+@
+
 \subsubsection{asMessage}
 \label{Descriptor-method-asmessage}
 



More information about the Rprotobuf-commits mailing list