An implicit input is information a function receives without an argument. Reading a global variable is a common example: surrounding state enters the computation invisibly. section 4.7 section 4.10
Keep these distinctions in view:
- Explicit inputs arrive through arguments; implicit inputs arrive through any other route. section 4.7
- Actions may have implicit inputs and outputs, while calculations have none by definition. section 4.13
- Implicit inputs couple a function to surrounding state, limiting when it can run and making testing harder. section 5.3
Turning a global read into an argument
A shipping rule that reads shopping_cart_total can run only when that global is correctly set. Change gets_free_shipping(item_price) to gets_free_shipping(total, item_price), then pass shopping_cart_total at the call site. The rule remains an action if it performs other effects, but its calculation depends on an explicit input. section 4.10 section 5.4
function update_shipping_icons() {
var buy_buttons = get_buy_buttons_dom();
for(var i = 0; i < buy_buttons.length; i++) {
var button = buy_buttons[i];
var item = button.item;
if(gets_free_shipping(shopping_cart_total, item.price))
button.show_free_shipping_icon();
else
button.hide_free_shipping_icon();
}
}
function gets_free_shipping(total, item_price) {
return item_price + total >= 20;
}
Compare the shipping rule before and after replacing its global cart-total read with an explicit total argument. section 4.10 section 5.4
Reduce implicit inputs incrementally rather than trying to eliminate every action. Identify each hidden read, replace it with an argument, and update callers. The result is more modular, reusable, and testable. section 5.3 section 19.9

