associativity

associativity

(programming)
The property of an operator that says whether a sequence of three or more expressions combined by the operator will be evaluated from left to right (left associative) or right to left (right associative). For example, in Perl, the lazy and operator && is left associative so in the expression:

$i >= 0 && $x[$i] >= 0 && $y[$x[$i]] == 0

the left-most && is evaluated first, whereas = is right associative, so in

$a = $b = 42

the right-most assignment is performed first.
This article is provided by FOLDOC - Free Online Dictionary of Computing (foldoc.org)
Mentioned in
Copyright © 2003-2025 Farlex, Inc Disclaimer
All content on this website, including dictionary, thesaurus, literature, geography, and other reference data is for informational purposes only. This information should not be considered complete, up to date, and is not intended to be used in place of a visit, consultation, or advice of a legal, medical, or any other professional.