Carl Sorensen <c_soren...@byu.edu> writes: > From: Gianmaria Lari <gianmarial...@gmail.com> > Date: Tuesday, April 9, 2019 at 8:17 AM > To: David Kastrup <d...@gnu.org> > Cc: lilypond-user <lilypond-user@gnu.org> > Subject: Re: scheme memory address > > I wanted to print the address of the variable x and then the address > of the parameter lst just to show that x and lst have different > address (so x is passed by value. I could infer the same assigning to > lst a new value and see that at the exit of the function x didn't get > update). I hope I didn't say nothing wrong. > > > Here's a stack overflow discussion about the various equal predicates > in Scheme. If you want to find out if two variables are the same > object in memory, use eq? or eqv?, depending on the type of data the > variables are (i.e., the data that the symbol is bound to). > > https://stackoverflow.com/questions/16299246/what-is-the-difference-between-eq-eqv-equal-and-in-scheme > > I think understanding it would help you.
If you want to find out if two variables are at the same place in memory (if at all), just use eq? . The problem is that its output is unspecified when talking about numerical values exactly because there is no guarantee that non-immediate numbers share or not share a memory location even when their pedigree would suggest they are identical. eq? will tell you if they do which is neither dependable nor useful in Scheme. -- David Kastrup _______________________________________________ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user