Macaulay2 » Documentation
Packages » Macaulay2Doc » The Macaulay2 language » operators » and
next | previous | forward | backward | up | index | toc

and -- conjunction

Description

If both t and u are booleans, then t and u returns true if both are true.

i1 : even 2 and isPrime 2

o1 = true

If they are both functions that return booleans, then the return value is also a function.

i2 : isEvenPrime = isPrime and even

o2 = isEvenPrime

o2 : FunctionClosure
i3 : isEvenPrime 2

o3 = true
i4 : isEvenPrime 3

o4 = false

See also

Ways to use symbol and:

  • Boolean and Boolean
  • Function and Function

For the programmer

The object and is a keyword.

This operator may be used as a binary operator in an expression like x and y. The user may install binary methods for handling such expressions with code such as

         X  and  Y := (x,y) -> ...

where X is the class of x and Y is the class of y.


The source of this document is in Macaulay2Doc/operators.m2:306:0.