2009/10/14 Aaron W. Hsu <[email protected]>:
> 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 ...)

-ish

> 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:

(define (thing-functor using-f0 using-f1 body)
  .
  .
  .
  (body def-0 def-1 def-2)
  )


> Do you want to write code like that for every module?

Done it. Wrote macros to make it pretty. Quit using the macros because
they didn't add much.  Still use the functors though. Isn't
parameterization over functions the whole point of working in a HOF
language?

> doesn't scale to multiple modules very well at all,

It's not too bad, actually. One of my code readers recently referred
to my styles as "pointless programming" though :) To be pedantic, it's
because there is no fixed point in the environment for most of it.
Having done endless code refactorizations, I think it's a feature,
personally :)

> solution. Also, how do I separate out my modules into separate files this
> way and then load them?

This is a completely different, and orthogonal problem. I think it was
Lynn Winebarger that first commented that one of the key features of a
module system is to provide a means for specifying the assembly of a
program from persistent components (I paraphrase mightily) - and that
is something that LAMBDA does not address.

So in short, most people clamoring for a module system in Scheme are
guilty of conflating multiple issues. They want some means of
manipulating the *top-level* environment so that they can willy nilly
redefine the semantics of associated with free variables. First-class
environments (whatever else I may think about them) are a reasonable
solution to that. They *also* want an assembly and persistence
mechanism.

Until the community wraps its head around the fact that "module
system"  is a concept that needs serious factorization, there is not
going to be anything better than LAMBDA and LOAD to come out of the
discussion. Come to think of it, LAMBDA and LOAD are a pretty good
solution after all...

david rush
-- 
Obviously a module-system Luddite...

_______________________________________________
r6rs-discuss mailing list
[email protected]
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss

Reply via email to