[its-hackers] Muddle function to remove a node from a list.
eric at swenson.org
Sun Apr 11 22:25:02 CEST 2021
My opinion only and not necessarily based on any well-founded principles or precedents:
It should return the mutated list. The caller already has the node that was removed (having passed it as an argument), but in order to perform further operations on the mutated list, having your function return it allows callers to invoke functions on the result of calling your function — rather than having saved a reference to the before-mutated list in a local variable, and then having to perform tour side-effecting function, ignoring the result, and having to referenced the saved reference to the now-mutated list.
> On Apr 11, 2021, at 11:53, rrs0 at earthlink.net wrote:
> Hi Lars, and muddle hackers,
> While working on the ITS Muddle Package System, I found a need for function that removes a
> Node from .OBLIST. SO I wrote a general purpose node remover that modifies the original
> List. My question is my function more useful if it returns the List or the node it removed??
More information about the its-hackers