REBOL [
Title: "Increment and Decrement"
Date: 24-Apr-1999
File: %incdec.r
Purpose: {
Increment and decrement a variable by one.
}
Category: [util 3]
]
set '++ func ['word] [set word (get word) + 1]
set '-- func ['word] [set word (get word) - 1]
;Quick test:
test-inc-dec: [
num: 10
++ num
print num
-- num
print num
print ++ num
print num
print -- num
print num
]
do test-inc-dec