problem with lists



I don't know of *any* descendent of Lisp (Scheme or other) which copies
list structure in assignment (or argument passing).

Why would it?  It isn't necessary in a purely functional style, and I'd
think it would make it much harder to write efficient code with rplacX.

          -s

On Sun, Dec 23, 2012 at 4:25 PM, Jochen Ziegenbalg <
ziegenbalg.dienstlich at googlemail.com> wrote:

> Dear Stavros,
>
> On Sun, Dec 23, 2012 at 7:44 PM, Stavros Macrakis <macrakis at alum.mit.edu>
> wrote:
> > Some programming languages have uniform 'value' semantics.  Many others
> have
> > 'reference' or 'object' semantics.  In object semantics, atomic/scalar
> > objects are immutable, and assigned by value, and composite objects are
> > mutable, and assigned by reference.  Maxima, like Lisp and Java, has
> > reference semantics.
>
> What about Scheme?
>
> > I agree that it would be good to document this.  Not clear that most
> users
> > would bother to check the documentation for ':', though, so where would
> you
> > document this?  In a tutorial, perhaps when the idea of assigning to
> > list/vector elements is introduced?  The issue is complicated by Maxima's
> > idiosyncratic treatment of arrays....
>
> I think it would be a good idea also to have explanations and examples
> to some fundamental techniques like assignments, parameter passing,
> scoping techniques etc. in the help system.   Of course, in the above
> case, this should be cross-referenced with the help text of ":".
>
> > There is no reason, though, to complicate your code with local variables,
> > assignments, and 'appends'.  Much more straightforward simply to
> construct
> > the result list you want directly:
> >
> >      increment_each(list) :=
> >             makelist( makelist( if i=j then list[i]+1 else list[i], i, 1,
> > length(list)), j, 1, length(list))
>
> Thank you,
> Jochen
>