A word that is attached to another word

. The opposite of suffix Also, a 3-digit numeral in a phone number, also referred to as NXX. So if your phone number was 312-555-1212, your prefix would be 555.

Also, a way of doing math. Normal people do math in infix notation, which results in problems with operator precedence and introduces the need for parentheses. Infix looks like this:

(2 + 3) * 5

Prefix would look like this:

* + 2 3 5

If we put the infix expression into a binary tree, we can get the prefix equivalent by traversing the tree like so:

  1. Write down the number or symbol at the current node.
  2. Go to the left node and recurse.
  3. Go to the right node and recurse.

I'm not up on prefix notation, so I can't really say what the benefits of it are. I know that LISP uses it to some degree. But I don't have much LISP experience either, so I might be talking out my ass. Maybe someone who knows this better can elaborate? Compare to my postfix node, which has a lot more information about all this. In general, prefix is the same idea as postfix only in reverse.

LISP is a prefix notation language. While it is true that you do not need parentheses if using prefix notation and you restrict yourself to only binary operators, LISP extends its operators to be more than binary. This extension requires the use of parentheses for grouping. (/ (+ 2 3 4 5) 2)
is equivalent to
(2 + 3 + 4 + 5) / 2

The primary benefit of prefix notation here is that the function or operator is at the start of the list, and the remainder of the list is the argument to it. Mostly, its a different way of thinking of how to deal with operations.

Pre*fix" (?), v. t. [imp. & p. p. Prefixed (?); p. pr. & vb. n. Prefixing.] [L. praefixus, p. p. of praefigere to fix or fasten before; prae before + figere to fix: cf. F. pr'efix fixed beforehand, determined, pr'efixer to prefix. See Fix.]

1.

To put or fix before, or at the beginning of, another thing; as, to prefix a syllable to a word, or a condition to an agreement.

2.

To set or appoint beforehand; to settle or establish antecedently.

[Obs.] " Prefixed bounds. "

Locke.

And now he hath to her prefixt a day. Spenser.

 

© Webster 1913.


Pre"fix (?), n. [Cf. F. pr'efixe.]

That which is prefixed; esp., one or more letters or syllables combined or united with the beginning of a word to modify its signification; as, pre- in prefix, con- in conjure.

 

© Webster 1913.

Log in or register to write something here or to contact authors.