[snipped totally correct reasoning]

> So, for potential efficiency purposes, should we rewrite this line to use:
> 
> as_lineno_stack=$as_lineno_stack=as_lineno_stack

Actually  as_lineno_stack=${as_lineno_stack}as_lineno_stack=

> or maybe even write AS_APPEND([var],[text]), which expands to a shell 
> function 
> that uses += on bash and traditional appends elsewhere?

That could be added (but AS_VAR_APPEND please, for consistency).

>> +m4_defun([AS_LINENO_POP],
>> +[eval $as_lineno_stack; test "x$as_lineno_stack" = x && AS_UNSET
> ([as_lineno])])
> 
> On the other hand, this efficiency argument is probably moot - even if a 
> shell 
> can recognize an append pattern and make it linear, the eval that shrinks the 
> variable size will probably still exhibit quadratic behavior by copying the 
> entire substring of the old definition back into the new definition on every 
> iteration.  And the quadratic nature of this algorithm is only apparent on 
> heavily nested code; how deep do you anticipate a typical nesting of the 
> as_lineno_stack to reach?

2 :-)  Toplevel will call ac_func_c_check_func, which will call
ac_func_c_try_compile, and that's it.

It could be 3, with sizeof->compute_int->try_compile (but right now I
only added a function for compute_int, so with my pending patches this
also gives 2).

Anyway I don't expect more than 5.

Paolo


Reply via email to