[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Scheme-reports] Why define-library requires a explicit begin form?
- To: 張書瀚 <zrqsmcx@x>
- Subject: Re: [Scheme-reports] Why define-library requires a explicit begin form?
- From: taylanbayirli@x (Taylan Ulrich B.)
- Date: Mon, 13 May 2013 13:20:13 +0200
- Cc: scheme-reports <scheme-reports@x>
- In-reply-to: <CAKSBGq6V-GkNx0zYC0LFTFQEegQynN5hR9Vn=Qou9q7SEjYeSQ@mail.gmail.com> ("張書瀚"'s message of "Mon, 13 May 2013 14:41:21 +0800")
- References: <CAKSBGq6V-GkNx0zYC0LFTFQEegQynN5hR9Vn=Qou9q7SEjYeSQ@mail.gmail.com>
張書瀚 <zrqsmcx@x> writes:
> Here is a example in r7rs-draft-9.pdf:
> (define-library (example life)
> (export life)
> (import (except (scheme base) set!)
> (scheme write)
> (example grid))
> (begin
> (define (life-count grid i j)
> ...)
> ...))
>
> why not:
> (define-library (example life)
> (export life)
> (import (except (scheme base) set!)
> (scheme write)
> (example grid))
> (define (life-count grid i j)
> ...)
> ...)
>
> The second one (which is more r6rs-alike) looks less verbose, isn't
> it?
> Can anyone please tell me why the first one is preferred, thank you
> very much!
The first one is preferred because it cleanly separates the declarative
library language from the actual Scheme code. What if you have an
`export' or an `import' function in your own code? (You could get
around it by wrapping them in a `begin' (or another such "escape") each
time you want to use them in the top-level of your own code, but that
would be very dirty, obviously if you ask me.)
_______________________________________________
Scheme-reports mailing list
Scheme-reports@x
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports