On Thu, Apr 18, 2013 at 6:03 AM, Arne Babenhauserheide <arne_...@web.de>wrote:
> Am Mittwoch, 17. April 2013, 21:58:28 schrieb Alan Manuel Gloria:
> > On Wed, Apr 17, 2013 at 8:06 PM, Arne Babenhauserheide <arne_...@web.de
> >wrote:
> >
> > > At Wed, 17 Apr 2013 06:39:37 +0800,
> > > almkglor wrote:
> > > > Macros were not standard until R4RS, either (although most Scheme
> systems
> > > > pre-R4RS did have a Common Lisp-like unhygienic macro system). A
> better
> > >
> > > I did not know that… I had thought that lisps had macros from very
> early
> > > on.
> > >
> >
> > Going seriously off-topic, but well...
>
> I don’t consider the history of Lisp to be off-topic when we’re discussion
> what will hopefully be part of its future :)
>
> > (define-macro (example x)
> > `(foo ,x))
> >
> > and consider what happens when it's used in a context where 'foo is bound
> > locally:
> >
> > (let ((foo #t))
> > (example foo))
> > ==>
> > (let ((foo #t))
> > (foo foo))
>
> > On a Lisp-2, (foo foo) means "call the globally-bound function named 'foo
> > with the current value of the variable 'foo". Common Lisp augments this
> > further with an excellent package system that essentially changes (?) a
> > symbol's identity - 'foo in one package does not evaluate to the same
> > symbol as 'foo in another package unless it's been imported (if I
> > understood Common Lisp correctly, LOL). In a Lisp-1 like Scheme, it
> means
> > "call the current value of the variable 'foo with itself." Schemers also
> > prefer not to use Common Lisp's package system, often using lexical
> binding
> > to provide some kind of package system.
> >
> > This lead to a lot of research into "hygienic macro expanders", which I
> > *think* is not yet *quite* resolved today (there are two main branches of
> > hygienic macro expanders, the syntax-case branch and the
> > syntactic-closures/explicit-renaming branches, the syntax-rules system
> can
> > be implemented on top of either, Andre van Tonder did an implementation
> > that supposedly implements both syntax-case and explicit-renaming (but
> not
> > syntactic-closures, I think)
>
> It’s strange to see that many problems in what I consider as one of the
> most powerful feature of Lisp.
>
>
Anything with a lot of power has the risk of being horribly abused and
misused. Much of the research seems to be how to put proper safety locks
on a very powerful weapon so you don't accidentally shoot your foot, and
the *proper* shape of the safety lock. Everyone agrees a safety lock is
good (i.e. syntax-rules). People are (still?) arguing about the shape of
the lock (syntax-case or explicit-renaming/syntactic-closures).
> > Most coders would put a single module's code inside a single file, with
> > one-file-per-module. So it's not an issue, if it's in the file, it's
> part
> > of the module, indentation or no indentation
>
> Is there some automatism for that?
>
Not sure, it's just a habit based on the simplest way to write a Scheme
interpreter (i.e. load all the defines in this file), so most Scheme
implementations will just build up their module systems on top of that.
>
> > > Can the module reuse defines outside the module to avoid that?
> > >
> > >
> > Most module systems allow importing another module's exported bindings,
> and
> > few might be able to import "global" bindings, whatever "global" might
> mean
> > for your Scheme system's module system.
>
> Is “top-level in the file” global?
>
Depends. In Guile if there's a module declaration then anything in the
top-level is part of the module. Otherwise, it depends: earlier versions
had a "global" namespace, Guile-2 (maybe?) I think has a separate namespace
for REPL. Again, it depends on the exact implementation. The only thing
you can rely on is that a series of defines in a file will usually be
loadable/compileable in any Scheme; whether it's "global", or put in some
kind of module implicitly, or something else, depends on the Scheme.
>
> For example in Python you have to jump through some hoops if you want to
> use a function as method, but it is possible for most cases (there is the
> module functools dedicated to that and related hackery…).
>
> Thanks for your background info!
>
> Best wishes,
> Arne
> --
> singing a part of the history of free software:
>
> - http://infinite-hands.draketo.de
>
>
------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
_______________________________________________
Readable-discuss mailing list
Readable-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/readable-discuss