bug-automake
[Top][All Lists]
Advanced

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

Re: Problems with the new Var code


From: Tim Van Holder
Subject: Re: Problems with the new Var code
Date: Tue, 3 Jun 2003 14:34:59 +0200

> >>> "Tim" == Tim Van Holder <address@hidden> writes:
> 
> [...]
> 
>  >> But again, let's rename these if they can be less
>  >> confusing.  Maybe s/search/search_for/, or s/search/seek/?  Any
>  >> other idea?
> 
>  Tim> 'find' or 'locate' are perfectly good prefixes (the 
> latter works both
>  Tim> as a command and as an action, so is perhaps an even 
> better source);
>  Tim> 'search_for' is ok too, I guess.
> 
> I'm quite confused.  You know there are *two* functions in the
> code, don't you?  
> 
> +  # Try to locate configure.in or configure.ac in the current
> +  # directory.  It may be absent.  Complain if both files exist.
> +  my $filename = search_configure_ac;
> +
> +  # Likewise, but bomb out if the file does not exist.
> +  my $filename = find_configure_ac;

err oops - I misread the diff then - I thought you had moved
'find_configure_ac' in General.pm to 'search_configure_ac'
in Configure_ac.pm (hence my surprise at the change of name).

So

  my $filename = find_configure_ac;

is the equivalent of

  my $filename = search_configure_ac;
  die if !defined $filename;

and the only reason these are two functions is so that the 'die'
workaround is safely hidden in the package?

Maybe 'find_*' for the optional find, and 'require_*' for the
non-optional find?

+  # Try to locate configure.in or configure.ac in the current
+  # directory.  It may be absent.  Complain if both files exist.
+  my $filename = find_configure_ac;
+
+  # Likewise, but bomb out if the file does not exist.
+  my $filename = require_configure_ac;

Of course, it does not really feel natural that require_* returns the
file name if found.

Any particular reason for not simply having an argument that indicates
whether or not the file is required?

+  # Try to locate configure.in or configure.ac in the current
+  # directory.  It may be absent.  Complain if both files exist.
+  my $filename = find_configure_ac("optional");
+
+  # Likewise, but bomb out if the file does not exist.
+  my $filename = find_configure_ac("required");





reply via email to

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