[its-hackers] Muddle function to remove a node from a list.
taa at alum.mit.edu
Wed Apr 14 00:22:24 CEST 2021
What's the actual code for this? Semantics seems unclear to me: although you can mangle a multiple element list to remove any element as a side effect (seems less than tasteful, but that's another matter), what do you do with a singleton?
Or are you modifying an atom's value, rather than the list itself?
Ceterum autem censeo Microsoftem esse delendam.
From: Eric Swenson <eric at swenson.org>
Sent: Sunday, April 11, 2021 4:25:02 PM
To: rrs0 at earthlink.net <rrs0 at earthlink.net>
Cc: Lars Brinkhoff <lars at nocrew.org>; Its Hackers <its-hackers at its.victor.se>; ChrisXReeve at gmail.com <ChrisXReeve at gmail.com>; Timothy Anderson <taa at alum.mit.edu>
Subject: Re: [its-hackers] Muddle function to remove a node from a list.
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??
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the its-hackers