Next: , Previous: , Up: iklib syntaxes   [Index]


6.8.17 Incrementing and decrementing

Syntax: ++ ?expr
Syntax: ++ ?expr ?step

Increment ?expr by ?step and return the result. Both ?expr and ?step must be expressions evaluating to a number object; when ?step is not given: it defaults to the fixnum 1.

As special case, when ?expr is an identifier: the syntax expands as follows:

#!vicare
(++ ?id ?step)
→ (begin
      (set! ?id (+ ?id ?step))
      ?id)
Syntax: pre-incr! ?expr
Syntax: pre-incr! ?expr ?step

Alias for ++.

Syntax: post-incr! ?expr
Syntax: post-incr! ?expr ?step

Increment ?expr by ?step and return the result. Both ?expr and ?step must be expressions evaluating to a number object; when ?step is not given: it defaults to the fixnum 1.

As special case, when ?expr is an identifier: the syntax expands as follows:

(post-incr! ?id ?step)
→ (receive-and-return (v)
        ?id
      (set! ?id (+ ?id ?step)))
Syntax: -- ?expr
Syntax: -- ?expr ?step

Decrement ?expr by ?step and return the result. Both ?expr and ?step must be expressions evaluating to a number object; when ?step is not given: it defaults to the fixnum 1.

As special case, when ?expr is an identifier: the syntax expands as follows:

#!vicare
(-- ?id ?step)
→ (begin
      (set! ?id (- ?id ?step))
      ?id)
Syntax: pre-decr! ?expr
Syntax: pre-decr! ?expr ?step

Alias for --.

Syntax: post-decr! ?expr
Syntax: post-decr! ?expr ?step

Decrement ?expr by ?step and return the result. Both ?expr and ?step must be expressions evaluating to a number object; when ?step is not given: it defaults to the fixnum 1.

As special case, when ?expr is an identifier: the syntax expands as follows:

(post-decr! ?id ?step)
→ (receive-and-return (v)
        ?id
      (set! ?id (- ?id ?step)))

Next: , Previous: , Up: iklib syntaxes   [Index]