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-7-bit Path: g2news1.google.com!news1.google.com!news.glorb.com!news2.glorb.com!news-xfer.nntp.sonic.net!posts.news.sonic.net!nnrp0.nntp.sonic.net!not-for-mail Newsgroups: comp.lang.ada From: R Tyler Croy Subject: Re: Introducing memcache-ada, a memcached client in Ada References: <4d0f1316$0$23759$14726298@news.sunsite.dk> Reply-To: R Tyler Croy User-Agent: slrn/0.9.9p1 (Linux) Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: Date: 20 Dec 2010 22:48:01 GMT Organization: Sonic.Net NNTP-Posting-Date: 20 Dec 2010 22:48:01 GMT NNTP-Posting-Host: 42fcba83.news.sonic.net X-Trace: DXC=4B[[c@Fa=bG^Q[[?GPKa1Em4K\QM1CV^@1OYf0H`?;XAIdCan0RDo9@]C\c48cD:IKiPfIoOdF@g@H5I[4hlS>]F X-Complaints-To: abuse@sonic.net Xref: g2news1.google.com comp.lang.ada:16082 Date: 2010-12-20T22:48:01+00:00 List-Id: On 2010-12-20, Simon Wright wrote: > Jeffrey Carter writes: > >> The type Flags and the Set_Flags parameters of that type are not >> documented in the spec; if possible, they should be. In particular, >> the effect of the default value for Set_Flags should be described. >> >> The meaning of the expiration parameters, and especially of their >> default values, should be documented. The default of zero would seem >> to mean immediate expirations, which doesn't seem very useful. >> >> The meaning of the Boolean return values from some of the functions >> (which also appear as parameters) is unclear and should be documented. > > I think these are "symptoms" of a thin (thinnish) binding. In > particular, the type Expiration and its use is rather non-Ada style. Is > it really the case that the memcached server won't allow you to specify > a retention period greater than 30 days? (just checked -- yes -- well, > the Google Python API says "up to 1 month", close enough I suppose :-). > > I don't see why Set appears as two functions & one procedure? Would it > be sensible to say, perhaps, > > procedure Set (....); -- no expiry specified > > procedure Set (....; > Expiring_After : Duration); > > procedure Set (....; > Expiring_At : Ada.Calendar.Time); I was concerned about "hiding" too much of how Memcached works from the user by using "Duration" instead of the Expiration subtype that I created. As for the multiple overloads of Set/Get, that's to address a problem I'm not sure has a good solution. With Memcached, and I'd assume most other networked-services like it, there are expected error conditions where I personally find exceptions to be unnecessary. To account for this, I wanted to define the function which return booleans (perhaps a "Success", "Failure" enum would be better) in case the caller "cared" about the success of a Set call. While still providing a version of the same code which returns nothing, in the case of the user "not caring" what the Set returns as long as it doesn't except (Invalid_Key_Error for example) > > Why is type Connection tagged? I guess you have some expansion plans for > it?! Because I don't know why because, I was under the impression that tagging it was the only way to get "Connection.Get ()" style invocations under Ada 2005 -- - R. Tyler Croy -------------------------------------- Code: http://github.com/rtyler Chatter: http://twitter.com/agentdero http://identi.ca/dero