🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.c
Article #726

Re: Taming The Switch-Statement

#726
From: Chris M. Thomasson
Date: Sat, 24 Oct 2026 01:33
18 lines
2367 bytes
On 10/23/2026 3:40 PM, Lawrence D’Oliveiro wrote:
> On Fri, 23 Oct 2026 14:21:15 -0700, Chris M. Thomasson wrote:
> 
>> I like self.
>>
>> void foo(struct foo* const self);
> 
> The trouble with a fixed name is, how do you refer to the instance of
> an outer class?

Well, self can be internal to the API logic. See, user code does not 
need to care how self is organized. It just needs to allocate n bytes 
aligned on a boundary and call into the API to init it. calling a 
deinit, or destroy whatever after its done. So the caller manages the 
main memory. After its done it can make the memory go out of scope or 
deallocate it, free or whatever.

So, internal to the lib, self->foo is there.
Technical Details
Message-ID: <11bh1u6$2av4s$1@dont-email.me>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
References: <119qf6l$2rmg3$1@dont-email.me> <11b6224$2ejik$1@dont-email.me> <11b774o$2m8c9$3@dont-email.me> <11b7k22$2v8e5$1@dont-email.me> <11b8f5h$67l$1@reader2.panix.com> <11baah2$3te3v$1@dont-email.me> <11bb5ou$8nfg$2@dont-email.me> <11bcc4o$jt81$1@dont-email.me> <20261022094427.210@kylheku.com> <11bdp73$15nor$1@dont-email.me> <11bf2s9$1eo7q$2@dont-email.me> <11bgj4c$265sc$2@dont-email.me> <11bgno8$27pn2$1@dont-email.me>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
From: "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>
Newsgroups: comp.lang.c
Subject: Re: Taming The Switch-Statement
Date: Fri, 23 Oct 2026 18:33:56 -0700
Organization: A noiseless patient Spider
Lines: 18
Message-ID: <11bh1u6$2av4s$1@dont-email.me>
References: <119qf6l$2rmg3$1@dont-email.me> <11b6224$2ejik$1@dont-email.me>
 <11b774o$2m8c9$3@dont-email.me> <11b7k22$2v8e5$1@dont-email.me>
 <11b8f5h$67l$1@reader2.panix.com> <11baah2$3te3v$1@dont-email.me>
 <11bb5ou$8nfg$2@dont-email.me> <11bcc4o$jt81$1@dont-email.me>
 <20261022094427.210@kylheku.com> <11bdp73$15nor$1@dont-email.me>
 <11bf2s9$1eo7q$2@dont-email.me> <11bgj4c$265sc$2@dont-email.me>
 <11bgno8$27pn2$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 24 Oct 2026 01:33:59 +0000 (UTC)
Injection-Info: dont-email.me;
	logging-data="2456732"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1/L3mTgYaq5On5nQAjtXJQt9YA6Let6FtQ="; posting-host="c5e96a087f12799cb6d50e90d5c19783"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:MzvhJ0IVg5q8RQs5YRhtpghEYLk= sha256:MuhRntWrkkR/SD8j6niHR5OC0IsUQA+N0zhj8Ot2M84=
	sha1:adyThvmhQbpXImJq7sQGBWQ/5iU= sha256:Zp7jDIR+N4OgWHioh+kS1ejKQohCqeYfKwmRcDCkH4Q=
Content-Language: en-US
In-Reply-To: <11bgno8$27pn2$1@dont-email.me>