[plt-scheme] Native code generation and immutable pairs

From: Jim Blandy (jimb at red-bean.com)
Date: Fri Mar 10 12:42:41 EST 2006

On 3/10/06, Lauri Alanko <la at iki.fi> wrote:
> On Fri, Mar 10, 2006 at 01:22:29AM -0800, Noel Welsh wrote:
> > There is always a tradeoff between changes that improve a
> > language and supporting backwards compatability.  This is
> > one of those cases.
> So you are suggesting changing "cons"? What exactly would this buy? Any
> new code can use immutable-cons, and any existing code can be easily
> changed to use immutable-cons. Changing "cons" directly would only
> benefit pure legacy code that would perhaps become automatically more
> efficient without having to touch the code.
> A change that only makes legacy code more efficient doesn't sound very
> forward-thinking to me.

When I call 'list', what sort of list does that produce?  When I write
a variable arity function, what sort of list contains its arguments? 
When I import SRFI-1 and call 'take' or 'zip', what sort of list do I
get?  I'd still like to be able to use all those.  In the sense that
you're using the phrase, those are all "legacy code", and it's
important to allow programs that use them to be efficient.

To get back to where I am now --- just without mutable lists --- I'd
need immutable-list, immutable-quasiquote, immutable-arglist-lambda,
immutable-arglist-named-let, immutable-map, immutable-zip, ...  So
it's definitely a second-class citizenship.

Posted on the users mailing list.