[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Bug & co
Yannis BRES comments Manuel Giraud problem:
> > I think the function `reverse!' in MzScheme 103 is buggy.
...
> I think that the behaviour of functions with side-effects is undefined on
> pairs that are not allocated at run-time : when l is defined by (define l '(a
> b c d)) instead of (define l (list 'a 'b 'c 'd)), pairs are built at compile-
> time...
Couldn't you have checked before answering? With l defined as (list 'a 'b 'c 'd)
you MUST GET EXACTLY THE SAME BEHAVIOUR.
How, for goodness' sake, l can guess what happened to the data it points to?
It continues to point to the *same cell*.
This is - sorry to appear harsh - an *elementary* fact belonging to what we
call "call by value" (here: dereferenced argument).
J. Karczmarczuk
- References:
- Bug & co
- From: Manuel Giraud <giraud@tif.inria.fr>
- Re: Bug & co
- From: Yannis BRES <Yannis.BRES@cma.inria.fr>