Description Usage Arguments Value References Examples
The idea and funcition names mainly comes from Scheme (Gauche) and Haskell. see References
1 2 3 | lhs %:% rhs
lcons(lhs, rhs)
|
lhs |
car part |
rhs |
cdr part |
lazy cons of lhs
and rhs
.
http://hackage.haskell.org/package/base-4.7.0.0/docs/Prelude.html
http://hackage.haskell.org/package/base-4.7.0.0/docs/Data-List.html
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | # R's infix operator has left-associativity
# run
1 %:% (2 %:% (3 %:% lempty))
# can be parsed but not llist
1 %:% 2 %:% 3 %:% lempty
# repeat 1L as an infinit sequence
ones <- 1L %:% ones
# this was privous version of lcons that evaluate a cdr part as eager-eval.
`%:%` <- lcons <- function(x, y) {
`class<-`(pairlist(head = x, tail = function() y), "lcons")
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.