% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/generate_AndOr.R
\name{generate_AndOr}
\alias{generate_AndOr}
\title{Generation of character infix operators: `&`, `&&`, `|`, `||`}
\usage{
generate_AndOr()
}
\value{
Generates four infix operators in the global environment.
}
\description{
Generation of character infix operators: `&`, `&&`, `|`, `||`
}
\details{
This function generates infix operators: `&`, `&&`, `|`, `||`
in the global environment, \cr
which are almost equivalent to, resp, `\%&\%`, `\%&&\%`, `\%|\%`, `\%||\%` .
\cr
The difference is that `&` has precedence over `|`  but `\%&\%` does NOT.
\cr For example: \cr\cr
\code{"a" | "b" & "c"} produces \code{"(a) | ((b) & (c))"} \cr
but \cr
\code{"a" \%|\% "b" \%&\% "c"} produces \code{"((a) | (b)) & (c)"} .
\cr\cr
See the examples below.
\cr\cr
\code{ "a" & "b" } is equivalent to  \code{And( "a", "b" )}
and generates \code{"(a) & (b)"}.\cr
\code{"a" && "b"} is equivalent to  \code{And( "a", "b", oper="&&" )}
and generates \code{"(a) && (b)"}.\cr
\code{ "a" | "b" } is equivalent to \code{Or( "a", "b" )}
and generates \code{"(a) | (b)"}.\cr
\code{ "a" || "b"} is equivalent to  \code{Or( "a", "b", oper="||" )}
and generates \code{"(a) || (b)"}.\cr
\cr
Use \code{eval( parse(text=condition) )} to evaluate the expression.
\cr
\cr
To remove these operators: \cr
 \code{ rm(  `&`, `&&`, `|`, `||` ) }
}
\examples{
generate_AndOr()

"a" & "b"
"a" \%&\% "b"
And( "a", "b" )
"a" | "b"
"a" \%|\% "b"
Or( "a", "b" )

# precedences
"a" | "b" & "c"
"a" \%|\% "b" \%&\% "c"

"a" & "b" | "c"
"a" \%&\% "b" \%|\% "c"


}
