《通链参考手册》


Macro INCF, DECF

●语法设定:

incf place [delta-form] => new-value

decf place [delta-form] => new-value

●参数和值:

place---a place.

delta-form---a form; evaluated to produce a delta. The default is 1.

delta---a number.

new-value---a number.

●详情:

incf and decf are used for incrementing and decrementing the value of place, respectively.

The delta is added to (in the case of incf) or subtracted from (in the case of decf) the number in place and the result is stored in place.

Any necessary type conversions are performed automatically.

For information about the evaluation of subforms of places, see Section 5.1.1.1 (Evaluation of Subforms to Places).

●例子:

 (setq n 0)
 (incf n) =>  1      
 n =>  1
 (decf n 3) =>  -2   
 n =>  -2
 (decf n -5) =>  3      
 (decf n) =>  2      
 (incf n 0.5) =>  2.5
 (decf n) =>  1.5
 n =>  1.5

●副作用:

Place is modified.

●受制于: 无。

●例外情况: 无。

●更多信息:

+, -, 1+, 1-, setf

●说明: 无。


X3J13设计清单非标准部分,可查下面章节:


◇首页 § ◎章节目录 § □内容索引 § ○符号索引 § △术语表 § ※设计草案