From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-x236.google.com (mail-wi0-x236.google.com [IPv6:2a00:1450:400c:c05::236]) by hurricane.the-brannons.com (Postfix) with ESMTPS id 70C2677AD7 for ; Tue, 24 Dec 2013 07:30:34 -0800 (PST) Received: by mail-wi0-f182.google.com with SMTP id en1so7400391wid.15 for ; Tue, 24 Dec 2013 07:30:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=lkLETtUlJY9/eXEh/N/RhB1NdIvvcV6RfJKhu0rSsOU=; b=FHSpJoBUg/0fVY8iVSb42r7divYYsMd2H6ff6CP/4HjddUH2OufpfpngXiWJxNjM6i CnucoZMK4e1imKh3yS17hTaDGMF9x3jwl+owsAmrLBoWsg6suc9aYtVUlXnR9keZKucS /r9CZiSZqKk94VN8HUma1LqF3HXMhhIdMmlmDvajy2xm4D5Rc3bA+DqFdJ7X4l6trvXi y22Bsghylb4k17ZZP2hkQrCwjCtyB4wX8zB7/xKJBO+frC0nzr5WcX00v6xpcXSqktR7 AJ1UiG5UrFkDMn8+t7TJ/ONJymAYrgUCuXFpdz0xFxYfK1b9X838X3rFU+99yE9NEdXj Azbw== X-Received: by 10.194.122.99 with SMTP id lr3mr23681568wjb.21.1387899027440; Tue, 24 Dec 2013 07:30:27 -0800 (PST) Received: from toaster.adamthompson.me.uk (toaster.adamthompson.me.uk. [2001:8b0:1142:9042::2]) by mx.google.com with ESMTPSA id hb7sm36696757wib.6.2013.12.24.07.30.25 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 24 Dec 2013 07:30:25 -0800 (PST) Date: Tue, 24 Dec 2013 15:30:17 +0000 From: Adam Thompson To: Karl Dahlke Message-ID: <20131224153017.GA18259@toaster.adamthompson.me.uk> References: <20131124043018.eklhad@comcast.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20131124043018.eklhad@comcast.net> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Edbrowse-dev@lists.the-brannons.com Subject: Re: [Edbrowse-dev] Mix X-BeenThere: edbrowse-dev@lists.the-brannons.com X-Mailman-Version: 2.1.17 Precedence: list List-Id: Edbrowse Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Dec 2013 15:30:34 -0000 On Tue, Dec 24, 2013 at 04:30:18AM -0500, Karl Dahlke wrote: > Adam writes: > > > Slightly pedantic note about this, in c++ you *should* really use > > #include > > Rather than > > #include > > But that's my point, isn't it? > We don't have to change everything over right away for it to work. > Maybe we should, someday, but we don't have to, not right away. > The preexisting code works. Yep, I was just pointing it out, though it's certainly not required. > > > You could also use > > cin >> s; > > Instead of > > getline(cin, s); > > This is not true. > If someone types in the line Good point, I forgot about the whitespace, probably because I never use a plain cin >> to do input. > hello world > > The first construct will capture only hello, a string separated bye whitespace, > whereas getline() captures the entire line. > The tutorial recommends using getline, > because you know exactly what you are getting, the line as it was typed. > It doesn't vary with whitespace. > Then you can analyze it and take action accordingly. > So when I do convert edbrowse to c++, > I can replace fgets with getline. > Still there are advantages. > I don't have to have a fixed buffer of a fixed size, > or worry about what happens if the user types in a line longer than that buffer, > or clip crlf off of the entered line; > c++ does all that for us. Technically, if building with gcc (or against readline I *think*), you can do this anyway. > So there are still some big advantages to c++, and yet, > you can't really go all the way over to the shorthand that your > professor put up on the board and showed you how cool it is. Nope, and personally I don't actually think this syntax is "cool" either. > > Yes I will globally replace bool with eb_bool. > Obviously I thought the bool datatype was very useful, > but I hadn't anticipated the collision with bool in c++. > Thanks for spotting that one. > I'll make that change and push in the next day or so. Already made, also have replaced true and false with eb_true and eb_false. Patches to be sent in a few minutes. Cheers, Adam.