chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] hash-table with missing keys


From: F. Wittenberger
Subject: Re: [Chicken-users] hash-table with missing keys
Date: Thu, 19 May 2005 12:07:37 +0200

Am Donnerstag, den 19.05.2005, 04:46 -0400 schrieb Michele Simionato:
> On 5/19/05, felix winkelmann <address@hidden> wrote:
> > On 5/19/05, Michele Simionato <address@hidden> wrote:
> > >
> > > Yes, this is what I am doing now, but it is ugly, too low-level for my 
> > > taste.
> > 
> > No, it's perfectly fine... ;-)
> > 
> > > Felix, I give you an ultimatum: or you raise an exception,
> > > or you give me a hash-table-has-key? function! ;-)
> > >
> > 
> > okok...
> > 
> 
> I am thinking of hash-tables containing booleans, for instance users
> with a given permission, and I want to know if the user is in the table or
> not. Perhaps the negative version "hash-table-missing-key?" is more useful

Please don't do that, please!

Please swap your condition.  Don't introduce yet another negation just
because a particular use of it would seem more intuitively.  It is
always confusing, once you start assembling more complicated
expressions.  Remeber all those config files, where you've been giving
switches of the style
"disable-feature-X-if-Y-is-not-true-but-Z-is-notvalid-either".  Should
it be set to #t or #f ?

> than the positive version "hash-table-has-key?", since tipically I want
> to raise an error if the key is missing.
> 
>              Michele
> 
> 
> _______________________________________________
> Chicken-users mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/chicken-users





reply via email to

[Prev in Thread] Current Thread [Next in Thread]