GHC Poll: scope in GHCi

Simon Marlow
Wed, 23 Jan 2002 12:30:34 -0000

> "Simon Marlow" <> writes:
> > 	:m [+|-] [*]M1 ... [*]Mn      (n >=3D 0)
> (nit: I would paraphrase to make n >=3D 1, since you start numbering =
> 1.  Wrap the whole M-list with optionality brackets if that's the
> intended meaning (setting the scope to nothing?  The default?))

The n >=3D 0 trick is used in the Haskell report so I thought it might =
familiar to people here :-)

> > Currently the non-* form isn't supported for compiled modules, and
> > attempting to set an unsupported scope results in an error.
> Since, if I understand correctly, there is no explicit way of
> differentiating between compiled and interpreted modules, so why not
> simply fall back to interpreting the module in question?

Because that requires a reload, which might be counter-intuitive (:m
doesn't otherwise cause loading of modules), and furthermore it would
erase any bindings made so far on the command line.

But :m might emit a message like the following if you attempt to set the
scope to the top-level of a compiled module:

	> :m Foo
	module 'Foo' is compiled; to include its top-level scope,
      try ':interpret Foo', ':reload', then ':m Foo'.

Where ':interpret Foo' would force interpreting of module Foo starting
from the next reload.