From: R Tyler Croy <tyler@linux.com>
Subject: Re: Introducing memcache-ada, a memcached client in Ada
Date: 20 Dec 2010 20:14:12 GMT
Date: 2010-12-20T20:14:12+00:00 [thread overview]
Message-ID: <slrnigve91.5bf.tyler@kiwi.local> (raw)
In-Reply-To: 4d0f1ed7$0$6990$9b4e6d93@newsspool4.arcor-online.net
On 2010-12-20, Georg Bauhaus <rm.tsoh.plus-bug.bauhaus@maps.futureapps.de> wrote:
> 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?
>
I was thinking about this last night to be honest, I felt somewhat frustrated
with all the GNAT-specific calls I had in the code base. There is the
adasockets library <https://github.com/samueltardieu/adasockets> but when I was
starting out I was a little apprehensive abvout including a third-party
dependency (I don't know what other compilers somebody might want to use).
Not sure what the best solution is, but I can relate to your feelings towards
compiler-specific functionality.
--
- R. Tyler Croy
--------------------------------------
Code: http://github.com/rtyler
Chatter: http://twitter.com/agentdero
http://identi.ca/dero
next prev parent reply other threads:[~2010-12-20 20:14 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-20 0:43 Introducing memcache-ada, a memcached client in Ada R Tyler Croy
2010-12-20 8:25 ` Thomas Løcke
2010-12-20 10:16 ` Georg Bauhaus
2010-12-20 9:36 ` Thomas Løcke
2010-12-20 20:14 ` R Tyler Croy [this message]
2010-12-21 0:56 ` Randy Brukardt
2010-12-21 7:52 ` Dmitry A. Kazakov
2010-12-20 19:36 ` Jeffrey Carter
2010-12-20 20:16 ` R Tyler Croy
2010-12-20 22:03 ` Simon Wright
2010-12-20 22:48 ` R Tyler Croy
2010-12-20 23:44 ` Simon Wright
2010-12-21 11:10 ` Georg Bauhaus
2010-12-21 11:21 ` Georg Bauhaus
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox