Everything2
Near Matches
Ignore Exact
Full Text
Everything2

or

created by festung

(idea) by Tem42 (2 hr) (print)   ?   I like it! Tue Jan 11 2000 at 23:11:28

In the weak (or inclusive) sense, 'or' means that at least one, and perhaps more, of the given options could be. ("Do you want an apple or an orange?" could be answered "an apple", "an orange", or "both!") For clarification, sometimes 'and/or' is used.

In the strong sense (AKA the exclusive or, xor), 'or' means that there are two possibilities, only one of which can be ("It will be 10 or 15 minutes.").

In symbolic logic, 'or' is used in the weak sense, and is called a disjunction. It is symbolized by a lowercase 'v' (or ∨ if your browser supports it) called a wedge or a vee. This is an abbreviation of the Latin word for the weak sense of 'or', vel. (Latin also had a word for the strong sense, aut).

If you want to use the strong sense of 'or' in symbolic logic, you have to go the long way around;
(p or q) and not (p and q).
(p ∨ q) ∧ ~(pq)
Where ~ stands for 'negation' (standard symbol) and ∧ stands for 'and' (in symbolic logic, a bullet point is often used, but I am told that this upside-down arrow is also common).


(idea) by hobyrne (2.8 y) (print)   ?   I like it! Thu Dec 19 2002 at 3:27:40

"or" is a reserved word in the programming language Lua.

In the BNF syntax of Lua, it appears as a terminal atom in one substitution rule:
binopor
"binop" appears as a nonterminal atom in one substitution rule:
expexp binop exp

"or" is the disjunctive binary logical operator. Like the control structures, all logical operators consider "nil" as false and anything else as true. The disjunction operator "or" returns its first argument if it is different from "nil"; otherwise, it returns its second argument. (Both "and" and "or" use short-cut evaluation, that is, the second operand is evaluated only if necessary.)

There are two useful Lua idioms that use the logical operator "or". The first idiom is
x = x or v
which is equivalent to
if x == nil then x = v end
This idiom sets x to a default value v when x is not set.

The second idiom is
x = a and b or c
which should be read as x = (a and b) or c. This idiom is equivalent to
if a then x = b else x = c end
provided that b is not "nil".


Other systems do not use short-cut evaluation (a limited form of lazy evaluation), and both operands are always evaluated fully before the result of the "or" operation is determined. Yet other systems, nondeterministic systems, usually found in parallel processing environments, guarantee that the result of the "or" operation is logically correct, but does not guarantee that both operands are fully evaluated, it does not guarantee that either one in particular is evaluated (Lua guarantees that the first operand is evaluated), and it does not guarantee that an operand will not be only partially evaluated (Lua guarantees that the second operand will either be evaluated or not, with no in-between). Using impure functions or expressions with side-effects in nondeterministic systems is therefore considered harmful.

And, in other programming languages, the "or" keyword can have another meaning: a bitwise "or" on two numeric (usually unsigned integer) operands (giving another number, of the same type, as a result). A number may be considered an array of bits; in Eindhoven notation, any number (b) may be expressed as (+ : iZ : bi * 2i) - standard binary notation - each bi being either 0 or 1, thus making an array of bits. (For signed values, the sign bit is considered just another bit in the array; for integers, negative values of i need not be considered.) The "numeric or" performs the "logical or" operation on bits in corresponding positions in the two operands, and places the result of each "logical or" in the corresponding position in the result. In symbols, "b or c" evaluates to (+ : iZ : (bi or ci) * 2i).

The C symbol for "logical or" is || and the C symbol for "numeric or" is |.


(definition) by Webster 1913 (print) I like it! Wed Dec 22 1999 at 1:36:26

Or (?), conj. [OE. or, outher, other, auther, either, or, AS. awer, contr. from ahwaeer; a aye + hwaeer whether. See Aye, and Whether, and cf. Either.]

A particle that marks an alternative; as, you may read or may write, -- that is, you may do one of the things at your pleasure, but not both. It corresponds to either. You may ride either to London or to Windsor. It often connects a series of words or propositions, presenting a choice of either; as, he may study law, or medicine, or divinity, or he may enter into trade.

If man's convenience, health, Or safety interfere, his rights and claims Are paramount. Cowper.

Or may be used to join as alternatives terms expressing unlike things or ideas (as, is the orange sour or sweet?), or different terms expressing the same thing or idea; as, this is a sphere, or globe.

Or sometimes begins a sentence. In this case it expresses an alternative or subjoins a clause differing from the foregoing. "Or what man is there of you, who, if his son shall ask him for a loaf, will give him a stone?" Matt. vii. 9 (Rev. Ver. ).

Or for either is archaic or poetic.

Maugre thine heed, thou must for indigence Or steal, or beg, or borrow thy dispence. Chaucer.

 

© Webster 1913.


Or, prep. & adv. [AS. r ere, before. &root;204. See Ere, prep. & adv.]

Ere; before; sooner than.

[Obs.]

But natheless, while I have time and space, Or that I forther in this tale pace. Chaucer.

Or ever, Or ere. See under Ever, and Ere.

 

© Webster 1913.


Or, n. [F., fr. L. aurum gold. Cf. Aureate.] Her.

Yellow or gold color, -- represented in drawing or engraving by small dots.

 

© Webster 1913.


printable version
chaos

XOR Lua Bill Hicks I-type
Saw NY play Secret Plot
and/or and Why does taking a programming class in a language you already know suck so much? koan
propositional calculus Base minus 2 solution logical operation Lottery paradox
Bosom disjunction 2A03 This or that?
Bonneville Dam Rocky's Boots DeMorgan's Rule C
Y'know, if you log in, you can write something here, or contact authors directly on the site. Create a New User if you don't already have an account.
  Epicenter
Login
Password

password reminder
register

Everything2 Help

Cool Staff Picks
Things you could have written:
Vincent van Gogh
The Greifswald Werewolves
Benzene
Body Ritual Among the Nacirema
A Grandpa's Notebook
He didn't want to be Gary anymore
Latex. High heels. Knives.
Archaeology
Cassette Culture
im in ur base killin ur d00dz
Nicholas II
This program has performed an illegal operation and will be shut down
December 20, 2002
New Writeups
locke baron
Multiple Myeloma(thing)
SubSane
blonde, freckles, skinny, short(person)
arcanamundi
A Ruba'iyat for May(person)
riverrun
Timed Writing(idea)
auraseer
Fling(fiction)
StrawberryFrog
Iron Man(review)
devolution
Misogyny and Porn, East to West - An Empirical Analysis(idea)
devolution
Korea is a place that refuses to stand still(idea)
Beanie127
The Pacifist Soldier(fiction)
VergilKint
Distilled from Dreams(fiction)
Scaevola
Roman marriage(thing)
rootbeer277
m&m's Ice Cream Treats(review)
Transitional Man
Gus's Chalet(review)
minnow
.410 bore(thing)
shaogo
Phonautogram(thing)
This page courtesy of The Everything Development Company