llist: Make a finite lazy object from R's object

Description Usage Arguments Examples

Description

functions to construct and coerce lazy stream

Usage

1
2
3
4
5

Arguments

...

non lazy-stream object,

x

any type of object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
x <- llist(1, 2, 3) # arguments are evaluated
# y <- llist(1, repeat() {}, 3) # cannot return
z <- llist_lazy(1, repeat{}, 3) # can be defined
lhead(z) # => 1

# Convert R's vector (include R's list) to llist
# is.llist(as.llist(x)) is ALWAYS TRUE
as.llist(1:3) # => llist(1,2,3)

llist(1, list(2, 3))
# => llist(1, list(2,3))
# => only the first layer is converted

TobCap/lazystreamr documentation built on May 9, 2019, 4:50 p.m.