🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.c
Article #1543

Re: (fir's c theory) scopes are wrong

#1543
From: fir
Date: Sat, 14 Nov 2026 19:58
92 lines
3611 bytes
Tristan Wibberley pisze:
> On 12/05/2026 11:22, fir wrote:
>> i once remember was writing about things that inheritance is wrong
>> -
>> the general conclusion realated to this (though specific conclusuins was
>> other i dont remember but it was thatmore proper inheritance is
>> (i donr remember) containing of substrutures (i dont remember so
>> this is in arhive of this group, i remember i was writing on this)
>>
>> the general conclusion related to his is could ba said that tag systems
>> are much better than tree structures - thsi is becouse if you have
>> something (say its file) you could  only have one directory and one
>> directory above this when in reality you would like to have many
>> - its tag system (or what its called if it have other name, i call it
>> tag system)
>>
>> i not noticed hovever stict conclusion fo it : C scopes
>>
>> c scopes have tree structure { {}{{}{}}} etc so they ate just wrong
>>
>> you should allow the intersection od scopes
>>
>> like
>> a{
>>
>> b{
>> }//end of a
>>
>>
>> } //end of b
> 
> 
> There are a lot of difficulties with this, better to explicitly transfer
> lives between scopes:
> 
> {
>    int var1,var2;
>    int var3;
> }
>    : extend(var2,var3) :
> {
>    ++var1;
> }
> 
> 
> There are still some problems like: isn't it too easy to transfer a
> pointer to a variable that's gone out of scope, easier than when
> returning a value.
> 
> no i dint mean that this is rather stupid, i meant more like 
inter-function scopes or inter file-scopes


f1()
{
   scope bunny;
}

f2()
{
   scope bunny;
   scope deer;
}

f3()
{
   scope bunny;
}

f4()
{
    scope deer;
}

acope bunny is inside f1 f2 f3
scope deer is f2 f4

so f2 seens also f4 ..f1 sees f2 f3 etc

this is alos to files if you get 120 files may build named
scopes same way ...

not like now when you include all say you see all - each one sees each one

some thing like "use/include module/file x" works a bit like that though 
defining scopes works something diferent as module name is ona and 
scopes may cover a pool of files

this mechanism eventually also could find where are the things given 
file uses (which s sometimes hard) especially as maybe code editor sould 
help with goin to such files
Technical Details
Message-ID: <11daehh$27hes$1@dont-email.me>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.hispagatos.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
References: <10tuv11$1slr0$1@dont-email.me> <11da9ni$25o2o$1@dont-email.me>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.hispagatos.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
From: fir <profesor.fir@gmail.com>
Newsgroups: comp.lang.c
Subject: Re: (fir's c theory) scopes are wrong
Date: Sat, 14 Nov 2026 20:58:07 +0100
Organization: A noiseless patient Spider
Lines: 92
Message-ID: <11daehh$27hes$1@dont-email.me>
References: <10tuv11$1slr0$1@dont-email.me> <11da9ni$25o2o$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 14 Nov 2026 19:58:42 +0000 (UTC)
Injection-Info: dont-email.me;
	logging-data="2344412"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX19Iz5ntJQK4D16Ut93GDzkv6TPUPtc/PsU="; posting-host="7b42559f1e977b2f5b518dce224551e7"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:140.0) Gecko/20100101
 Firefox/140.0 SeaMonkey/2.53.24
Cancel-Lock: sha1:9RjOUFv2Kzhz0VbhVFYlauA8gr8= sha256:jjvuI7zBISohWNUu5MDrqwORTTWXRhD+RUie+fPHzLQ=
	sha1:9HXHt4QMRwoXYDq+7xDIsIhLkOQ= sha256:7fMi4TOxWunPNv6CY8mkmQc6q2s6PD7EMkSePy1yF9w=
In-Reply-To: <11da9ni$25o2o$1@dont-email.me>