Ariel Scolnicov wrote:
> 
> >     is_readable(file) is really -r(file)
> 
> Has unpleasant syntax saying "is_readable".  Should be like normal
> English predicates.  Get the idea you do.  Is better even the Lisp -p
> convention!
> 
> What's wrong with doing it like I (and maybe a few others) speak, and
> saying "readable(file)"?  The "is_" prefix serves only to make
> predicates impossible to read out, leading to thinkos.

Yeah, I tend to agree. PHP does this terribly nastily with crap like

   is_readable($file);
   is_executable($file);
   is_directory($file);

Bleeech! Drop the is_ , I agree:

   readable($file);
   executable($file);
   directory($file);

In fact, I'd much rather still a more generic function like 'want' that
takes a list of things to check:

   file($file);           # does it exist?
   file($file, 'r');      # is it readable?
   file($file, 'w');      # is it writable?
   file($file, 'd');      # is it a directory?
   file($file, 'wd');     # is it a writable directory?
   file($file, 'dw');     # same thing

Otherwise we run the risk of 200 builtins just to check file types and
modes on all the different platforms....

-Nate

Reply via email to