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

    From Tristan Wibberley@tristan.wibberley+netnews2@alumni.manchester.ac.uk to comp.lang.c on Sat Nov 14 18:36:34 2026
    From Newsgroup: comp.lang.c

    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-a 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.
    --
    Tristan Wibberley

    The message body is Copyright (C) 2026 Tristan Wibberley except
    citations and quotations noted. All Rights Reserved except that you may,
    of course, cite it academically giving credit to me, distribute it
    verbatim as part of a usenet system or its archives, and use it to
    promote my greatness and general superiority without misrepresentation
    of my opinions other than my opinion of my greatness and general
    superiority which you _may_ misrepresent. You definitely MAY NOT train
    any production AI system with it but you may train experimental AI that
    will only be used for evaluation of the AI methods it implements.
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From fir@profesor.fir@gmail.com to comp.lang.c on Sat Nov 14 20:58:07 2026
    From Newsgroup: comp.lang.c

    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-a 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

    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Tristan Wibberley@tristan.wibberley+netnews2@alumni.manchester.ac.uk to comp.lang.c on Sun Nov 15 00:54:54 2026
    From Newsgroup: comp.lang.c

    On 14/11/2026 19:58, fir wrote:
    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-a 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:

    {
    -a-a int var1,var2;
    -a-a int var3;
    }
    -a-a : extend(var2,var3) :
    {
    -a-a ++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


    It's not /much/ stupid, C++ added move semantics to achieve basically
    the same thing to much rejoicing despite the difficulties it adds to all
    uses of the language. The above syntax can make a lot of things clearer
    because it nominates objects as some kind of setup or background
    facility that relate objects of the meat of the problem but which aren't involved in it.

    of course, above I meant "++var2" or "++var3" instead of "++var1".
    --
    Tristan Wibberley

    The message body is Copyright (C) 2026 Tristan Wibberley except
    citations and quotations noted. All Rights Reserved except that you may,
    of course, cite it academically giving credit to me, distribute it
    verbatim as part of a usenet system or its archives, and use it to
    promote my greatness and general superiority without misrepresentation
    of my opinions other than my opinion of my greatness and general
    superiority which you _may_ misrepresent. You definitely MAY NOT train
    any production AI system with it but you may train experimental AI that
    will only be used for evaluation of the AI methods it implements.
    --- Synchronet 3.22a-Linux NewsLink 1.2