[bitc-dev] Re: Small question

Jonathan S. Shapiro shap at eros-os.org
Thu Aug 18 02:05:53 EDT 2005


On Thu, 2005-08-18 at 01:54 -0400, Swaroop Sridhar wrote:
> Does the name of the interface have any significance inside the interface?
> 
> That is, if I have
> 
> (interface abc
>     ...
> 
> Can I write
>    (define abc::x 200) ??
> )
> 
> Swaroop.

No. The interface name isn't even in the same *name space* as other
identifiers, so you can NOT write abc::x. However, note that *because*
these are two different name spaces, it is perfectly legal (if perverse)
to write

	(import abc abc)
	(import def abc)

That is, the first import only defines abc in the identifier namespace.
It does not shadow it in the interface namespace.

HOWEVER:

I am thinking about something like TYPE-IMPORT. If one had this, then
one could conceivably write something like:

(interface abc
  (type-import abc abc)

  (defunion (abc::list 'a)
     nil (cons 'a)))

The way to think about type-import is that for every type declaration in
the type-imported interface, it makes a corresponding PROCLAIM
available. This would allow circular type definitions (only).

shap



More information about the bitc-dev mailing list