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

Re: [sc-users] 2D array question





On Fri, Mar 8, 2019, 10:36 AM <amindfv@xxxxxxxxx> wrote:

> Now, if you explain the first case as:
>
> A. x is an arrow pointing to "integer 5" somewhere
> B. y is an arrow pointing to the same "integer 5" that x is pointing to

Out of curiosity, is this actually what happens in sclang's implementation? I.e. there's an "integer 5" somewhere that both x and y have pointers to? In other words, if you were to look in memory, you'd see one "00000101" and not two?

As implemented, the slots for x and y hold a value 5, no indirection. I explained the situation in more detail a few replies back. :)

That wasn't my intuition - I thought of it as x "having a 5 value," with no pointer, and y having a totally separate 5 value. I definitely could be wrong, though! (The semantics are the same)

That is correct.

Brian