Macros We can add a very simple macro command, "define", which supports a straightforward text-substitution. For example: define math.stopIfGreaterThan(v) : math.ifGreaterThan(v) -> do.stop define waterSensor.levelUnder(v) : waterSensor.level -> math.stopIfGreaterThan(v) define knob.valueWhenChanged : knob.value -> math.stopIfNotChanged With macros, we can define lots of function variants without burdening the various Z-device's code. For example, distanceSensor.value might output only in centimeters. But we can have distanceSensor.feet, distanceSensor.yards, etc, with macros like: define math.centimetersToFeet : math.multiplyBy(30.48) define distanceSensor.feet : distanceSensor.value -> math.centimetersToFeet Thus, we don't need to add a lot of function subroutines to the actual distanceSensor code, it can just put out centimeters and we can handle the rest as macros. Thus, each z-device can stay "pure", supporting only its basic functions, and we can use macros to create many more derivative functions. Also note, macros are expanded by the host "Z-send" function, and do not affect the packet of numbers which is transmitted into the network. Thus there is no extra burden on the Z-cpus or the Z-OS in each device.