Top
Back: 6.2 Major differences to the C programming language
Forward: 6.2.2 Evaluation of logical expressions
FastBack: 6. Tricks and pitfalls
FastForward: A. Examples
Up: 6.2 Major differences to the C programming language
Top: Singular 2-0-4 Manual
Contents: Table of Contents
Index: F. Index
About: About This Document

6.2.1 No rvalue of increments and assignments

The increment operator ++ (resp. decrement operator --) has no rvalue, i.e., cannot be used on the right-hand sides of assignments. So, instead of

 
j = i++;  // WRONG!!!

(which results in an error), it must be written

 
i++; j = i;

Likewise, an assignment expression does not have a result. Therefore, compound assignments like i = j = k; are not allowed and result in an error.


Top Back: 6.2 Major differences to the C programming language Forward: 6.2.2 Evaluation of logical expressions FastBack: 6. Tricks and pitfalls FastForward: A. Examples Up: 6.2 Major differences to the C programming language Top: Singular 2-0-4 Manual Contents: Table of Contents Index: F. Index About: About This Document
            User manual for Singular version 2-0-4, October 2002, generated by texi2html.