Newsgroups: comp.lang.scheme
Path: cantaloupe.srv.cs.cmu.edu!das-news.harvard.edu!news2.near.net!MathWorks.Com!europa.eng.gtefsd.com!howland.reston.ans.net!swrinde!elroy.jpl.nasa.gov!decwrl!pacbell.com!well!nbn!news.zeitgeist.net!news.cygnus.com!nntp!lord
From: lord@x1.cygnus.com (Tom Lord)
Subject: Re: Scheme _in_ Emacs?
In-Reply-To: jaffer@zurich.ai.mit.edu's message of 11 Sep 1994 15:03:36 GMT
Message-ID: <LORD.94Sep11153553@x1.cygnus.com>
Sender: news@cygnus.com
Nntp-Posting-Host: x1.cygnus.com
Organization: Cygnus Support
References: <RAMSDELL.94Aug17063434@triad.mitre.org> <TTHORN.94Aug17150829@ceres.daimi>
	<RAMSDELL.94Aug24085039@triad.mitre.org>
	<WGD.94Aug25012615@martigny.ai.mit.edu>
	<TFB.94Aug31020302@oliphant.cogsci.ed.ac.uk>
	<WGD.94Sep3205634@martigny.ai.mit.edu>
	<TFB.94Sep5132531@burns.cogsci.ed.ac.uk>
	<HARRISON.94Sep5085451@sp10.csrd.uiuc.edu>
	<BLUME.94Sep5110232@beth.princeton.edu>
	<HARRISON.94Sep5193413@sp10.csrd.uiuc.edu> <34gn3k$jh3@nkosi.well.com>
	<JAFFER.94Sep11110336@jacal.zurich.ai.mit.edu>
Date: Sun, 11 Sep 1994 22:35:53 GMT
Lines: 36



	Aubrey Jaffer writes:

	For parsing and unparsing, dynamically bound input and output
	ports save a LOT of needless argument consing.  

	One could explicitly pass ports (I used to do this but it got
	unwieldy) or enclose the whole program in a lambda (and then
	not be able to debug) but neither of these is better than dynamic
	scope in this application.



Yuck.  One extra argument should not slow function calls down that
much.  Enclosing code in LAMBDA should not make debugging awkward.
This sounds like a clear case of programming style being distorted
needlessly by deficiences in language implementation.

BTW, one technique that is intermediate between dynamic variables and
passing around lots of extra parameters is to pass around a dynamic
environment explicitly.

Like dynamic variables, passing around an explicit dynamic environment
is better than several-extra-parameters-many-functions because a
function can be modified to communicate new paraters to its indirect
call-graph descendendents without adding new parameters to the
intermediate functions.

Like adding new arguments to functions, passing an explicit dynamic
environment is better than dynamic variables because it doesn't
require the use of features like DYNAMIC-WIND, and is, in fact, more
flexible when it comes to integrating exotic flow of control with
dynamic state.

-t
