Re: [Scheme-reports] REPL Helmut Eller (14 Nov 2012 08:51 UTC)
Re: [Scheme-reports] REPL Alex Shinn (14 Nov 2012 09:07 UTC)
Re: [Scheme-reports] REPL Helmut Eller (14 Nov 2012 09:13 UTC)
Re: [Scheme-reports] REPL Alex Shinn (14 Nov 2012 09:26 UTC)
Re: [Scheme-reports] REPL Helmut Eller (14 Nov 2012 10:22 UTC)
Re: [Scheme-reports] REPL Marc Feeley (14 Nov 2012 21:06 UTC)
Re: [Scheme-reports] REPL John Cowan (14 Nov 2012 21:26 UTC)
Re: [Scheme-reports] REPL Marc Feeley (14 Nov 2012 22:05 UTC)
Re: [Scheme-reports] REPL Alex Shinn (14 Nov 2012 23:46 UTC)
[Scheme-reports] equal? Alan Watson (15 Nov 2012 00:40 UTC)
Re: [Scheme-reports] equal? Jim Rees (15 Nov 2012 02:36 UTC)
Re: [Scheme-reports] equal? John Cowan (15 Nov 2012 16:26 UTC)
Re: [Scheme-reports] equal? Alan Watson (15 Nov 2012 16:35 UTC)
Re: equal? Arthur A. Gleckler (17 Nov 2012 20:32 UTC)
Re: [Scheme-reports] REPL John Cowan (15 Nov 2012 16:23 UTC)
Re: [Scheme-reports] REPL Aaron W. Hsu (15 Nov 2012 23:47 UTC)
Re: [Scheme-reports] REPL Shiro Kawai (16 Nov 2012 01:16 UTC)
Re: [Scheme-reports] REPL Per Bothner (14 Nov 2012 21:37 UTC)
Re: [Scheme-reports] REPL Marc Feeley (14 Nov 2012 21:49 UTC)
Re: [Scheme-reports] REPL Andy Wingo (04 Jan 2013 13:02 UTC)
Re: [Scheme-reports] REPL John Cowan (04 Jan 2013 15:42 UTC)
Re: [Scheme-reports] REPL Alaric Snell-Pym (04 Jan 2013 16:30 UTC)
Re: [Scheme-reports] REPL Helmut Eller (15 Nov 2012 07:44 UTC)
Re: [Scheme-reports] REPL John Cowan (15 Nov 2012 16:04 UTC)
Re: [Scheme-reports] REPL Per Bothner (15 Nov 2012 16:17 UTC)

Re: [Scheme-reports] REPL Per Bothner 14 Nov 2012 21:32 UTC

On 11/14/2012 01:01 PM, Marc Feeley wrote:
> Let me say that I find it contrary to the spririt of Scheme to prevent redefinition and assignment of exported variables.

Let me say that regardless of the "spirit of Scheme", I think disallowing
redefinition / re-assignment is a Good Thing.  At least as a default:
It might be reasonable to allow re-assignment for variable that have been
explicitly declared to allow that, though I don't see a major use case
for it.
Also, an implementation might allow a "debug mode" that can allow
exported variables to be re-assigned, but I don't think it should be
alloweded in normal use.

Two alternative to consider (perhaps for WC2):

* Kawa has a define-variable form which is used to explicitly mark dynamic
variables.  I.e. these force dynamic run-time lookup, without inlining.
This is also a convenient way to turn off compile-time undefined-variable
warnings/errors, for compilers that offer that.

* A mechanism to define "properties": Associate a variable with a pair
of a getter and a setter function.  This allows generate read or write hooks
(useful for debugging and many other purposes).  One might allow exporting
of a getter/setter pair, which can be used as a variable.
(This is just an idea - I haven't actually tried to see how this might
work for Scheme libraries.)

>  It is something Schemers do all the time.  Of course there is the usual argument that this restriction is in place to allow efficient compilation, allowing, among other things, inlining of exported functions.

That's an important reason, but equally important is that it makes programs
more maintainable and understandable *to humans*.  It makes it easier to
debug a program if you can easily find all the places that assign to a
variable.  This restriction is also helpful if you care about security.

>  So it seems that preventing this useful feature (function redefinition at the REPL, or by a "load" or "eval") is simply there to make the Scheme implementer's life easier.  That's the wrong thing to optimize... if implementation difficulty is a concern we will soon get rid of continuations, the REPL, and maybe closures and garbage collection.

Well, there are good arguments for getting rid of traditional general
continuations - and not just implementation difficulty.  It does seem
clear that something *like* continuations - or co-routines - are valuable.
--
	--Per Bothner
per@bothner.com   http://per.bothner.com/

_______________________________________________
Scheme-reports mailing list
Scheme-reports@scheme-reports.org
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports