[plt-scheme] Structures added to MzLib
This depends where the open is. If the definition context where the
open appears allows duplicate bindings (the top-level or a structure
for example) then there is no problem. If the definition context does
not (an internal-define position), then there will be an error, but it
will come from the enclosing construct, not the open. ML has no
definitions contexts that prevent duplicate bindings, except for rec,
which only allows function definitions, syntactically.
-Scott
On Wednesday, March 19, 2003, at 04:14 PM, Paul Steckler wrote:
>> The (open path) form may appear anywhere a (define ...) form
>> can appear. The open form places all of the identifiers
>> exported from the structure indicated by the path into the
>> context of the open expression (the binding context of the
>> first identifier in the path is used).
>
> Are there any checks for duplicate bindings when open'ing a structure?
>
> Ocaml allows an open to shadow a previous binding:
>
> # open List;;
> # map;;
> - : ('a -> 'b) -> 'a list -> 'b list = <fun>
> # open Array;;
> # map;;
> - : ('a -> 'b) -> 'a array -> 'b array = <fun>
>
> -- Paul