Skip to content

Commit

Permalink
nextmode() returns visibly
Browse files Browse the repository at this point in the history
  • Loading branch information
shikokuchuo committed Nov 29, 2023
1 parent 0b89ef3 commit 3d8955e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* `nextmode()` improvements:
+ simplified function signature to take a 'refhook' argument comprising a list of serialization / unserialization functions.
+ registered 'refhook' functions apply to external pointer type objects only.
+ no longer returns invisibly for easier confimation that the correct functions have been registered.
* `reap()` updated to always return either a zero on success or else an integer 'errorValue'.
* `pipe_notify()` arguments 'add', 'remove' and 'flag' now default to FALSE instead of TRUE for easier selective specification of the events to signal.
* Fixes regression in release 0.10.4 that caused a potential segfault using `ncurl()` with 'follow' set to TRUE when the server returns a missing or invalid relocation address.
Expand Down
11 changes: 5 additions & 6 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -290,21 +290,20 @@ strcat <- function(a, b) .Call(rnng_strcat, a, b)
#' @param mark [default FALSE] (for advanced use only) logical value, whether to
#' mark serialized data with a special bit.
#'
#' @return Invisibly, a list comprising the currently-registered 'refhook'
#' functions.
#' @return A list comprising the currently-registered 'refhook' functions.
#'
#' @details Calling this function without any arguments returns (invisibly) the
#' @details Calling this function without any arguments returns the
#' currently-registered 'refhook' functions (and resets 'mark' to FALSE).
#'
#' @examples
#' nextmode(refhook = list(function(x) serialize(x, NULL), unserialize),
#' mark = TRUE)
#' print(nextmode())
#' nextmode()
#'
#' nextmode(NULL)
#' print(nextmode())
#' nextmode()
#'
#' @export
#'
nextmode <- function(refhook = list(), mark = FALSE)
invisible(.Call(rnng_next_mode, refhook, mark))
.Call(rnng_next_mode, refhook, mark)
9 changes: 4 additions & 5 deletions man/nextmode.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3d8955e

Please sign in to comment.