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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,bdcca6db8294fb00 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!news3.google.com!feeder1-2.proxad.net!proxad.net!feeder2-2.proxad.net!newsfeed.arcor.de!newsspool2.arcor-online.net!news.arcor.de.POSTED!not-for-mail Date: Mon, 20 Dec 2010 11:16:05 +0100 From: Georg Bauhaus Reply-To: rm.tsoh+bauhaus@maps.futureapps.de User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-GB; rv:1.9.2.8) Gecko/20100802 Thunderbird/3.1.2 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Introducing memcache-ada, a memcached client in Ada References: <4d0f1316$0$23759$14726298@news.sunsite.dk> In-Reply-To: <4d0f1316$0$23759$14726298@news.sunsite.dk> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Message-ID: <4d0f1ed7$0$6990$9b4e6d93@newsspool4.arcor-online.net> Organization: Arcor NNTP-Posting-Date: 20 Dec 2010 10:16:08 CET NNTP-Posting-Host: 5f10a861.newsspool4.arcor-online.net X-Trace: DXC=eeGOCj_5>2=nBOkdL^Lo7>4IUK?_;?S8 X-Complaints-To: usenet-abuse@arcor.de Xref: g2news2.google.com comp.lang.ada:17030 Date: 2010-12-20T10:16:08+01:00 List-Id: On 20/12/2010 09:25, Thomas L�cke wrote: > I do though have four suggestions: > > 1. Declare all the string literals ("STORED", "NOT_FOUND" and such) as > constants in the specification. Not sure why should they be public? These are protocol words that I think a user will not want to deal with. > 3. Take a look at the various search subprograms in Ada.Strings.Fixed > and Ada.Strings.Unbounded. Some of them might be able to replace a loop > here or there. Key string scanning looks just right as is to me where, e.g., Is_Control is used, when verbiage will otherwise be needed to pack every pattern into one object suitable for Index. You could say Key_Ch = ' ' in place of Character'Pos (Key_Ch) = 32 or use the white space characterising functions (like you used is_control), or exclude everything with a lower 'Pos if memcached wants this. I'd add an occasional "constant" to the String objects' declarations in the declare blocks. Compiler option -gnatwa warns about this and other issues. One more general comment, addressed to all interested: Don't we have a portable POSIX socket library? As much as I'm fond of GNAT, placing GNAT's helpful, yet compiler specific libraries in every program will make them non-Ada (in a portability sense). In the case of sockets, I don't see a compelling need to be compiler specific?