From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: (qmail 24137 invoked from network); 25 Apr 2020 20:27:29 -0000 Received: from minnie.tuhs.org (45.79.103.53) by inbox.vuxu.org with UTF8ESMTPZ; 25 Apr 2020 20:27:29 -0000 Received: by minnie.tuhs.org (Postfix, from userid 112) id DF6709C923; Sun, 26 Apr 2020 06:27:27 +1000 (AEST) Received: from minnie.tuhs.org (localhost [127.0.0.1]) by minnie.tuhs.org (Postfix) with ESMTP id 14B8B9C733; Sun, 26 Apr 2020 06:27:12 +1000 (AEST) Received: by minnie.tuhs.org (Postfix, from userid 112) id 690959C733; Sun, 26 Apr 2020 06:27:09 +1000 (AEST) Received: from sdaoden.eu (sdaoden.eu [217.144.132.164]) by minnie.tuhs.org (Postfix) with ESMTPS id 5BA9C9B962 for ; Sun, 26 Apr 2020 06:27:08 +1000 (AEST) Received: by sdaoden.eu (Postfix, from userid 1000) id 59A8E16054; Sat, 25 Apr 2020 22:27:06 +0200 (CEST) Date: Sat, 25 Apr 2020 22:27:06 +0200 From: Steffen Nurpmeso To: (Noel Chiappa) Message-ID: <20200425202706.AA2BQ%steffen@sdaoden.eu> In-Reply-To: <20200425194102.3A54318C0BE@mercury.lcs.mit.edu> References: <20200425194102.3A54318C0BE@mercury.lcs.mit.edu> Mail-Followup-To: (Noel Chiappa) , tuhs@tuhs.org User-Agent: s-nail v14.9.18-41-g8765acf8 OpenPGP: id=EE19E1C1F2F7054F8D3954D8308964B51883A0DD; url=https://ftp.sdaoden.eu/steffen.asc; preference=signencrypt BlahBlahBlah: Any stupid boy can crush a beetle. But all the professors in the world can make no bugs. Subject: Re: [TUHS] v7 K&R C X-BeenThere: tuhs@minnie.tuhs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: The Unix Heritage Society mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: tuhs@tuhs.org Errors-To: tuhs-bounces@minnie.tuhs.org Sender: "TUHS" Noel Chiappa wrote in <20200425194102.3A54318C0BE@mercury.lcs.mit.edu>: |> From: moanga | |>> To make chaining of calls simpler. Write |>> f()->g()->h()->i() | |Ah; I was confused by his notation; I didn't realize he meant the C \ |operator |'->'. Oh, i love this method-on-object as opposed to object-on-function methodology. while(_tr.read_line(*&_line) >= 0){ ln = _line.trim().squeeze().data(); len = _line.length(); which can easily exceed a 80x2[45] screen in C. Especially with "more modern" frameworks which try to avoid namespace pollution and easily exceed 20 bytes for a single function name alone. Of course error handling is often a problem unless you go for exceptions (terrible, especially if they do not have language builtin support for file and line number, at least without -DNDEBUG, imho), general state machines or whatever. While at C++, the checked automatic upcasts are also very helpful, especially if you have a deeper object hierarchy. (As in, struct object{}, struct drawable{struct object super...}, struct button{struct drawable super..}, then "drawable d;.. object*=&d (or for heaven's sake &d.super) is much much better as &d.super.super or even (object*)&d.) Damn i have given up on perfection, and sometimes even on "being explicit is better", but a shame it is. Ciao, a nice Sunday and Good luck! from Germany, --steffen | |Der Kragenbaer, The moon bear, |der holt sich munter he cheerfully and one by one |einen nach dem anderen runter wa.ks himself off |(By Robert Gernhardt)