Re:Applying the Linus Torvalds “Good Taste” Coding Requirement
by kwhitefoot on Thursday October 27, 2016 @02:17AM
(#12803225)
I'll grant that you can't do it quite as efficiently as in C but you can do the same trick as I showed for VB.Net (in another post in this thread) and create a new entry that points at the head then use that as your indirect pointer. The problem is caused not by being unable to point at locals or members but by Pascal's pointers being strongly typed so that you can't simply dereference some random word length memory cell to get a new reference.
So not identical but still simpler than the tasteless version.
I thought that this was such a fundamental idea that it should be on Rosetta Code but the page for it at http://rosettacode.org/wiki/Singly-linked_list/Element_remov... is empty.
Perhaps we should all rush over there and fill it in. :-)
Edit: See entry on RC at http://rosettacode.org/wiki/Singly-linked_list/Element_remov...
'Modern' 'pascals' were different.