时间: 2021-07-31 作者:daque
十一、操纵符的步骤 table 3.6. 操纵符步骤 操纵符 刻画 ++, -- 自增,自减 -, ~, ! 单目 ** 乘幂 =~, !~ 形式配合 *, /, %, x 乘,除,取余,反复 +, -, . 加,减,联接 <<, >> 移位 -e, -r, etc. 文献状况 <, <=, >, >=, lt, le, gt, ge 不等比拟 ==, !=, <=>, eq, ne, cmp 十分比拟 & 位与 |, ^ 位或,位异或 && 论理与 || 论理或 .. 列表范畴 ? and : 前提操纵符 =, +=, -=, *=, 赋值 and so on , 逗点操纵符 not low-precedence logical not and low-precedence logical and or, xor low-precedence logical or and xor .操纵符贯串性(associativity): table 3.7. 操纵符贯串性 操纵符 贯串性 ++, -- 无 -, ~, ! right-to-left ** right-to-left =~, !~ left-to-right *, /, %, x left-to-right +, -, . left-to-right <<, >> left-to-right -e, -r, 无 <, <=, >, >=, lt, le, gt, ge left-to-right ==, !=, <=>, eq, ne, cmp left-to-right & left-to-right |, ^ left-to-right && left-to-right || left-to-right .. left-to-right ? and : right-to-left =, +=, -=, *=, right-to-left and so on , left-to-right not left-to-right and left-to-right or, xor left-to-right 倡导: 1、当你不决定某操纵符能否先实行时,确定要用括号精确之。 2、用多行、空格等办法普及步调的可读性。