F.E.L.T.

Functionally Equivalent Language Translation

DECF / --

(decf var-name [ delta ] )

(decf x)              ; destructivley decrements x by 1
(decf x 2)            ; by 2
(-- x (get-mode))     ; by whatever (get-mode) returned

See also INCF DECR INCR

This will destructivley modify the contents of the target variable by the amount specified, with the default being one. The optional delta value can be any valid expression for the target language and it will be applied at run-time.


Post-Decrement et al.

Many languages support the notion of "post-decrement", "pre-decrement", "post-increment" and "pre-increment". I have taken the view, at least for now and the foreseable future that these are, whilst "useful", nothing more than syntactic sugar, and as Alan Perlis has been quoted as saying:

Syntactic sugar causes cancer of the semicolon.

Who is Alan Perlis, and why do I quote him? Go find out...

This means that whilst post-increment and post-decrement are supported, there is currently no way to "inline" the pre-increment and pre-decrement operators found in other languages. That may grate with some but for now FELT stands fast on that mainly because Lisp doesn't offer it either and nobody found a reason to complain loud enough to get it changed!