From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fac41,b87849933931bc93 X-Google-Attributes: gidfac41,public X-Google-Thread: 109fba,b87849933931bc93 X-Google-Attributes: gid109fba,public X-Google-Thread: 1108a1,b87849933931bc93 X-Google-Attributes: gid1108a1,public X-Google-Thread: 103376,b87849933931bc93 X-Google-Attributes: gid103376,public X-Google-Thread: 114809,b87849933931bc93 X-Google-Attributes: gid114809,public X-Google-Thread: f43e6,b87849933931bc93 X-Google-Attributes: gidf43e6,public From: piercarl@sabi.demon.co.uk (Piercarlo Grandi) Subject: Re: Exceptions as objects (was Re: What is wrong with OO ?) Date: 1997/02/08 Message-ID: #1/1 X-Deja-AN: 217476016 x-nntp-posting-host: sabi.demon.co.uk x-disclaimer: Contents reflect my personal views only references: <5acjtn$5uj@news3.digex.net> <32dd9fc8.262114963@news.sprynet.com> <5cu43v$jkn@nntpa.cb.lucent.com> <5d93d3$nhs$1@goanna.cs.rmit.edu.au> <5dds5b$gcs@mulga.cs.mu.OZ.AU> <01bc14ab$3ce476e0$752d54c7@vbykov.hip.cam.org> <5def36$rjd@mulga.cs.mu.OZ.AU> <01bc1513$e030fcc0$752d54c7@vbykov.hip.cam.org> <5did8t$mbk@mulga.cs.mu.OZ.AU> content-type: text/plain; charset=US-ASCII organization: Home's where my rucksack's mime-version: 1.0 (generated by tm-edit 7.94) newsgroups: comp.lang.c++,comp.lang.smalltalk,comp.lang.eiffel,comp.lang.ada,comp.object,comp.software-eng Date: 1997-02-08T00:00:00+00:00 List-Id: >>> "fjh" == Fergus Henderson writes: [ ... ] fjh> The difference is that things that are part of the library are things fjh> that a user can program user-defined alternatives. For example, fjh> in C, printf() is part of the standard library, and you can write a fjh> my_printf() function that does similar things to printf() (and fjh> is perhaps implemented as a layer on top of printf()). On the fjh> other hand, it's not possible to do the equivalent for Pascal's fjh> write statement or for C's for loops, because these are part of fjh> the language proper, not the standard library. Well, even if 'printf' were syntactically a statement and not a procedure call, you could still write your 'my_printf' as a procedure; similarly that 'if then else' is not a procedure call in ``Pascal'' does not forbid you from writing a procedure like 'myif(condition,thenPart,elsePart)'. The real reason why/why not is rather different from being alanguage primitive or not; it is whether one has the reflective abilities to implement one's own verion of 'printf' or 'myif'. In ``C'' one has the reflective facilities for writing one's own 'printf' (such facilities are '#include ', which allow a procedure to ``reflect'' on its parameter list), but not for writing control structures (except for some very limited ability using preprocessor macros). Pascal does not offer reflective abilities/primitives for parameter lists or control structures. There are languages that offer user-visible primitives that allow building ad-hoc control structures, by way of ``reflection''; usually such facilities, as a bit of overkill, are based on that extremely powerful reflective ability, the one to reflect on program state via continuations/closures, and the associated one, the ability to reflect on program fragments; for example Scheme and Smalltalk-80 allow definitions of control structures using either/both reflection on continuation/closures and code fragments. Neither are avalable in ``C'' or ``Pascal'', and thus control abstraction is not possible; the issue is not thus quite related to having some reserved syntax or not.