Nothing
Code
Queue1 <- R6::R6Class("Queue", public = list(initialize = function(...) {
for (item in list(...)) {
self$add(item)
}
}, add = function(x) {
private$queue <- c(private$queue, list(x))
invisible(self)
}, remove = function() {
if (private$length() == 0) return(NULL)
head <- private$queue[[1]]
private$queue <- private$queue[-1]
head
}), private = list(queue = list(), length = function() base::length(private$
queue)))
construct(Queue1$new(1, 2), check = FALSE)
Output
R6::R6Class(
classname = "Queue",
public = list(
remove = (function() {
if (private$length() == 0) return(NULL)
head <- private$queue[[1]]
private$queue <- private$queue[-1]
head
}) |>
(`environment<-`)(
constructive::.env(
"0x123456789",
parents = c("0x123456789", "0x123456789", "0x123456789", "namespace:constructive")
)
),
add = (function(x) {
private$queue <- c(private$queue, list(x))
invisible(self)
}) |>
(`environment<-`)(
constructive::.env(
"0x123456789",
parents = c("0x123456789", "0x123456789", "0x123456789", "namespace:constructive")
)
),
initialize = NULL
),
private = list(
queue = list(1, 2),
length = (function() base::length(private$queue)) |>
(`environment<-`)(
constructive::.env(
"0x123456789",
parents = c("0x123456789", "0x123456789", "0x123456789", "namespace:constructive")
)
)
),
parent_env = emptyenv()
)$new() |>
(function(r6_obj) {
assign(
'initialize',
(function(...) {
for (item in list(...)) {
self$add(item)
}
}) |>
(`environment<-`)(
constructive::.env(
"0x123456789",
parents = c("0x123456789", "0x123456789", "0x123456789", "namespace:constructive")
)
),
envir = r6_obj
)
r6_obj
})()
Code
construct(Queue1$new(1, 2), check = FALSE, one_liner = TRUE)
Output
R6::R6Class(classname = "Queue", public = list(remove = (function() {if (private$length() == 0) return(NULL); head <- private$queue[[1]]; private$queue <- private$queue[-1]; head}) |> (`environment<-`)(constructive::.env("0x123456789", parents = c("0x123456789", "0x123456789", "0x123456789", "namespace:constructive"))), add = (function(x) {private$queue <- c(private$queue, list(x)); invisible(self)}) |> (`environment<-`)(constructive::.env("0x123456789", parents = c("0x123456789", "0x123456789", "0x123456789", "namespace:constructive"))), initialize = NULL), private = list(queue = list(1, 2), length = (function() base::length(private$queue)) |> (`environment<-`)(constructive::.env("0x123456789", parents = c("0x123456789", "0x123456789", "0x123456789", "namespace:constructive")))), parent_env = emptyenv())$new() |> (function(r6_obj) {assign("initialize", (function(...) {for (item in list(...)) {self$add(item)}}) |> (`environment<-`)(constructive::.env("0x123456789", parents = c("0x123456789", "0x123456789", "0x123456789", "namespace:constructive"))), envir = r6_obj); r6_obj})()
Code
Queue2 <- R6::R6Class("Queue", public = list(add = function(x) {
private$queue <- c(private$queue, list(x))
invisible(self)
}, remove = function() {
if (private$length() == 0) return(NULL)
head <- private$queue[[1]]
private$queue <- private$queue[-1]
head
}), private = list(queue = list(), length = function() base::length(private$
queue)))
construct(Queue2$new(), check = FALSE)
Output
R6::R6Class(
classname = "Queue",
public = list(
remove = (function() {
if (private$length() == 0) return(NULL)
head <- private$queue[[1]]
private$queue <- private$queue[-1]
head
}) |>
(`environment<-`)(
constructive::.env(
"0x123456789",
parents = c("0x123456789", "0x123456789", "0x123456789", "namespace:constructive")
)
),
add = (function(x) {
private$queue <- c(private$queue, list(x))
invisible(self)
}) |>
(`environment<-`)(
constructive::.env(
"0x123456789",
parents = c("0x123456789", "0x123456789", "0x123456789", "namespace:constructive")
)
)
),
private = list(
queue = list(),
length = (function() base::length(private$queue)) |>
(`environment<-`)(
constructive::.env(
"0x123456789",
parents = c("0x123456789", "0x123456789", "0x123456789", "namespace:constructive")
)
)
),
parent_env = emptyenv()
)$new()
Code
construct(Queue2$new(), check = FALSE, one_liner = TRUE)
Output
R6::R6Class(classname = "Queue", public = list(remove = (function() {if (private$length() == 0) return(NULL); head <- private$queue[[1]]; private$queue <- private$queue[-1]; head}) |> (`environment<-`)(constructive::.env("0x123456789", parents = c("0x123456789", "0x123456789", "0x123456789", "namespace:constructive"))), add = (function(x) {private$queue <- c(private$queue, list(x)); invisible(self)}) |> (`environment<-`)(constructive::.env("0x123456789", parents = c("0x123456789", "0x123456789", "0x123456789", "namespace:constructive")))), private = list(queue = list(), length = (function() base::length(private$queue)) |> (`environment<-`)(constructive::.env("0x123456789", parents = c("0x123456789", "0x123456789", "0x123456789", "namespace:constructive")))), parent_env = emptyenv())$new()
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.