gvwilson / sdxpy

Software Design by Example: a tool-based introduction with Python
https://third-bit.com/sdxpy/
Other
373 stars 55 forks source link

/func - Section 8.1: Definition and Storage (2023-10-02) - `decl_func` instead of `func`? #247

Open sback opened 1 year ago

sback commented 1 year ago

In Chapters 7 and 8, all defined operations are represented as verbs, which simplifies understanding with the format do_verb. However, for functions, we use the term func and implement it as do_func. This feels inconsistent to me. The phrase "do a function" is somewhat ambiguous. Perhaps, to maintain consistency, we could name it with a verb, like set_func or decl_func, similar to the set and do_set format used for variables.

sback commented 1 year ago

Considering this again, I would probably go for decl_func rather than set_func as the latter may generate some confusion since we do not give the function a name in the declaration.