[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Linear-update suffix: ! 1 or @



Olin:

> REVERSE!, APPEND! and friends
> have been around for a while, even though they aren't RnRS. These procedures
> have *always* had to be used in a "linear" fashion, even before I came along
> and did list-lib -- because of the empty list.
>
> That is, you cannot, *in general,* rely on this working:
>      (begin (append! foo bar)
>             foo) ; Use FOO non-linearly -- is now a longer list
> The problem is that FOO might be bound to (). Then APPEND has nothing to
> SET-CDR!; it just returns BAR. 

Yes, sure. But if non-nil, foo should be side-effected (guaranteed).

> I am *not* going to provide procedures that are guaranteed-side-effecting-
> when-possible-otherwise-functional. Ech. I *will* consider renaming these
> procedures. But this 1-suffix convention is pretty ugly, and you are going to

I believe all these linear-update/side-effecting/non-functional
procedures should for the time being be removed from the proposal or
split into another one, probably including copy and tree-copy.  The
thing seems not to be ripe for freezing.

Wouldn't the remaining functional rest for now be nice enough?

> @ looks as good as 1 to me. We now have a three-way selection: bang, at, or
> one.  Please vote.

Ah, no.

Greetings, Wolfgang.