Learn R Programming

pmatch (version 0.1.4)

[<-.pmatch_bind: Bind variables to pattern-matched expressions.

Description

The bind object itself doesn't do anything. It simply exists in order to define notation for binding variables using the sub-script operator.

Usage

# S3 method for pmatch_bind
[(dummy, ...) <- value

Arguments

dummy

The bind object. Only used to dispatch to the right subscript operator.

...

Patterns to assign to.

value

Actual values to assign

Examples

Run this code
# NOT RUN {
bind[x, y] <- c(2,4)
x == 2
y == 4

llist := NIL | CONS(car, cdr : llist)
L <- CONS(1, CONS(2, CONS(3, NIL)))
bind[CONS(first, CONS(second, rest))] <- L
first == 1
second == 2

# }

Run the code above in your browser using DataLab