On Wed, 14 Oct 2009 01:40:46 -0400, Brian Harvey <[email protected]>
wrote:
> The fundamental problem you're trying to solve is to
> restrict the applicability of certain bindings to a corral, and that
> isn't
> just something that you can do by layering a bazillion lambdas; it's the
> very thing that a single lambda does!
I presume that you are talking about
(lambda ()
(define ---) ...
expr ...)
Where the set of definitions is limited by the scope introduced by the
lambda. That is done by a lambda, and scoping is a perfectly good thing to
use lambdas for, but that's not the only type of scoping that matters.
Given a set of identifiers, how do I control the visibility of these
identifiers to the outside world? Not just how do I make sure these
identifiers are visible only inside a certain world, but how do I make
sure that only some of them are visible to the outside?
Say I have a set of definitions, and only want three of them: a, b, and c,
visible to a section of code, but I want the entire set to be evaluated in
the same scope? How would I do this with just lambda? I could do:
(call-with-values
(lambda () (define ---) ... (values a b c))
(lambda (a b c) expr ...))
Do you want to write code like that for every module? Moreover, that
doesn't scale to multiple modules very well at all, and it certainly gets
into the realm of way too many lambdas. I assume that you don't use LET
either? I mean, after all, it translates almost directly into a single
lambda, right?
Another problem with the above is that it isn't a purely lambda based
solution. Also, how do I separate out my modules into separate files this
way and then load them? Bind each thunk lambda to a definition and then
have a series of tested calls? Well, I also have to specify my exports
exactly too, and so how is that? I have ahard time believing that you
seriously want to program like this. This is too much even for WG1.
Aaron W. Hsu
--
Of all tyrannies, a tyranny sincerely exercised for the good of its
victims may be the most oppressive. -- C. S. Lewis
_______________________________________________
r6rs-discuss mailing list
[email protected]
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss