[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]

RE: [ID 20000120.001] Diff to add print formatting to debugger




> > Aliases don't work for arbitrary command string.
> 
> Do not they?  I thought they do.  If they do not, this is what need to
> be addressed.

I should be cleared - even though the first alias string is used as a
pattern
element the operation the user types is used as an index to find the
pattern.
So, something like

  =p\%(.) p sprintf "\%$1"

winds up in the alias hash with an index of "p\%(.)".  Typing:

	p%x $foo

looks at $alias{"p%x"} which doesn't match the above.  A fix would be to
make the alias hash an array and do pattern matching on EACH alias instead
of just the one that matches the hash index.  However, that would require 
the aliases to be carefully constructed so as not to match more than one 
command.  That would mess up lots of people who use them now.

> 
> If you cannot alias an arbitrary string, alias 'p', and type things as
> 
>   p %8x $var

Same problem here.  Since the LHS of the pattern is used as the alias index
the only possible pattern to use is "p".  That prohibits me from having
something
that matches "p %8x" and replacing it with "p sprintf "%8x".

And this goes back to the "general usefulness" issue.  Since this extends
the 
functionality of the print command w/o getting into anyones way...

  - Jim 


Follow-Ups from:
Ronald J Kimball <rjk@linguist.dartmouth.edu>
Ilya Zakharevich <ilya@math.ohio-state.edu>

[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]