Alexandre Oliva wrote:
> > In other words, your new macro should not need to do this:
> 
> >    [= test-and-exit  test = (get "test")  ...  =]
> 
> > because it would be redundant.
> 
> Good.  But I had meant to write ``I'd like *you* to implement ...''
> :-)

Then I would need to understand better what you wanted to have
happen.

> I'm not even sure I'd know how to start implementing one macro in
> terms of another.  I recall your having stated this was impossible in
> earlier versions of AutoGen; I'm very happy this is now possible.

Yep:

   [= test-OR-exit  msg = "start-[= gather-the-message =]-end" =]

is now accepted.  What happens is that the string "sta...end"
is gathered up at load time.  When this invocation fires,
an "anonymous template" is created with that text and then processed.
The output is redirected to an unlinked file (no Windows here),
and read back in.

I remember your message referring to an "else" clause.
I would not nest macros, I would add an argument, and
maybe some sanity checks thus:

[=
 
DEFINE test-or-exit
 
=][=
 
  #  if there is no test, then just a message and exit
  =][=
 
  % test "\nif (%s) > /dev/null 2>&1 ; then" =][=

  (if (and (not (exist? "test"))
           (or  (exist? "invert")
                (exist? "else")
      )    )  (error "both 'else' and 'invert' require a 'test'))

  (if (and (exist? "invert") (exist? "else"))
      (error "Both 'invert' and 'else' ??")) =][=

  invert "  :\nelse"  =]
  $echo "$modename: [=msg=]" 1>&2[=

  ! no_help "\n  $echo \"$help\" 1>&2" =]
  exit 1[=

  % else "\nelse\n%s" =][=

  test "\nfi"         =][=
 
ENDDEF                =]

> Yep.  I guess it's just a matter of my getting use to it.  I'm happy
> you're giving me good reasons to learn more about AutoGen :-)

:-)  It took a long time....

_______________________________________________
Libtool mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/libtool

Reply via email to