// boolean.inc - boolean shell sections


//
//	NOT	(Does not work like C "!", use _ToBoolean() if this functionality is needed).
//
//		$0 = A [boolean]
//
//		$R1 = NOT A [boolean]
//
[Boolean-Not]

	set A = $($0)

	_If($(A))
		set Result = FALSE
	else
		set Result = TRUE
	endif

	Return $(Result)

//
//	OR
//
//		$0 = A [boolean]
//		$1 = B [boolean]
//
//		$R1 = A OR B [boolean]
//
[Boolean-Or]

	set A = $($0)
	set B = $($1)

	_If($(A))
		set Result = TRUE
	else
		set Result = $(B)
	endif

	Return $(Result)

//
//	AND
//
//		$0 = A [boolean]
//		$1 = B [boolean]
//
//		$R1 = A AND B [boolean]
//
[Boolean-And]

	set A = $($0)
	set B = $($1)

	_If($(A))
		set Result = $(B)
	else
		set Result = FALSE
	endif

	Return $(Result)

//
//	XOR
//
//		$0 = A [boolean]
//		$1 = B [boolean]
//
//		$R1 = A XOR B [boolean]
//
[Boolean-Xor]

	set A = $($0)
	set B = $($1)

	_If($(A))
		_SetNOT($(B), Result)
	else
		set Result = $(B)
	endif

	Return $(Result)
