Email list hosting service & mailing list manager

put library <body> at top-level Per Bothner (30 Nov 2005 20:33 UTC)
(missing)
(missing)
(missing)
(missing)
Re: put library <body> at top-level Per Bothner (03 Dec 2005 16:16 UTC)
Re: put library <body> at top-level Ray Blaak (03 Dec 2005 16:17 UTC)
import suggestion Ray Blaak (03 Dec 2005 16:17 UTC)
Re: put library <body> at top-level Matthew Flatt (30 Nov 2005 22:20 UTC)
Re: put library <body> at top-level Per Bothner (30 Nov 2005 22:29 UTC)
Re: put library <body> at top-level Bradd W. Szonye (03 Dec 2005 16:16 UTC)

import suggestion Ray Blaak 01 Dec 2005 18:35 UTC

Instead of having an import bind multiple libraries, e.g.

(import "balloon"
            (only "stack" push! pop!)
            ...)

I suggest that import should work an only a single library at a time.
The reason is that the <import-set> specifies the library and at most
single special action (only, rename, add-prefix, etc.) What happens if
you need to do multiple actions for a library, e.g.

(import (only "stack" push! pop!)
            (add-prefix "stack" stack:)
            (rename "stack" (clear! empty!))

This could have a well-defined meaning (e.g. one gathers all "stack"
related clauses to process them in aggregation), but it seems
unnecessary, complex, and confusing to keep respecifying "stack"

What we want to say is "I am importing stack, and that also involves a
subset, a prefix addition, and a renames". I.e. specify the library
once, and then the subactions, e.g.

(import "stack" (only push! pop!) (add-prefix stack:) (rename (clear!
empty!)))

Much cleaner. To import multiple libraries, just have multiple import
statements:

(import "lib1") ; imports everything
(import "lib2" (except something-secret))

Cheers,
Ray Blaak