Prefer builtin commands to macros in GHCi command resolution (#3858)
authorMax Bolingbroke <batterseapower@hotmail.com>
Sat, 2 Apr 2011 22:59:06 +0000 (23:59 +0100)
committerMax Bolingbroke <batterseapower@hotmail.com>
Sat, 2 Apr 2011 22:59:06 +0000 (23:59 +0100)
commit2a86d5c7db21b39673aa8f4ba2c6aee714719262
treee0c21046bd127dbbe98012d3967ab6007d89ac92
parent6552d9fcee9dcd676ae45896e7f4486d8a95b566
Prefer builtin commands to macros in GHCi command resolution (#3858)

Current precedence rules in GHCi are that:

 * User macros are *always* preferred in command resolution
 * User macros that are defined earlier are preferred to those that
   are defined earlier on
 * Builtin commands have lowest precedence

However this caused user confusion because e.g. defining a macro beginning
with "i" would override the standard :info command whenever the user typed
the abbreviated command :i.

The new precedence rules are based on the view that things defined earlier
are always preferred to things defined later. The builtin commands are logically
defined earliest of all (when GHCi starts) so they always take precedence.
ghc/InteractiveUI.hs