🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.c
Article #1981

Re: C and its peasant 'ancestors'

#1981
From: Dan Cross
Date: Sun, 29 Nov 2026 22:45
26 lines
1933 bytes
In article <11ehuri$3ps8n$1@raubtier-asyl.eternal-september.org>,
Bonita Montero  <Bonita.Montero@gmail.com> wrote:
>Am 29.11.2026 um 20:21 schrieb Lawrence D’Oliveiro:
>
>> On Sun, 29 Nov 2026 20:08:10 +0100, Bonita Montero wrote:
>
>>> Virtual functions in C++ need less storage since you need only one
>>> virtual method table pointer per baseclass.
>
>> That’s actually a limitation, because it disallows “monkey-patching”.
>
>When do you need to change the polymorphic type of a class at
>runtime. In OOP languages no one has missed that feature so far.

It's actually not even that hard.  Most class instances have a
single pointer to a vtbl; you can "monkey patch" C++ just by
replacing that with a pointer to a different table that points
to a different thunk.

To bring this back to C, though, space-efficient dispatch
through function pointers has been part of the language since
nearly the beginning: consider the device switches in early
Unix.

	- Dan C.
Technical Details
Message-ID: <11ei9tp$sps$1@reader2.panix.com>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!weretis.net!feeder9.news.weretis.net!panix!.POSTED.spitfire.i.gajendra.net!not-for-mail
References: <11dup6q$v4j9$1@dont-email.me> <11eht6p$3p4pj$1@raubtier-asyl.eternal-september.org> <11ehu0i$3pgmn$1@dont-email.me> <11ehuri$3ps8n$1@raubtier-asyl.eternal-september.org>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!weretis.net!feeder9.news.weretis.net!panix!.POSTED.spitfire.i.gajendra.net!not-for-mail
From: cross@spitfire.i.gajendra.net (Dan Cross)
Newsgroups: comp.lang.c
Subject: Re: C and its peasant 'ancestors'
Date: Sun, 29 Nov 2026 22:45:13 -0000 (UTC)
Organization: PANIX Public Access Internet and UNIX, NYC
Message-ID: <11ei9tp$sps$1@reader2.panix.com>
References: <11dup6q$v4j9$1@dont-email.me> <11eht6p$3p4pj$1@raubtier-asyl.eternal-september.org> <11ehu0i$3pgmn$1@dont-email.me> <11ehuri$3ps8n$1@raubtier-asyl.eternal-september.org>
Injection-Date: Sun, 29 Nov 2026 22:45:13 -0000 (UTC)
Injection-Info: reader2.panix.com; posting-host="spitfire.i.gajendra.net:166.84.136.80";
	logging-data="29500"; mail-complaints-to="abuse@panix.com"
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
Originator: cross@spitfire.i.gajendra.net (Dan Cross)