##ptr and ref as lval/rval

(pbclone means pass-by-creating-a-clone, usually on stack)

Ptr as lval — reseating
Ptr unwrapped as lval — pointee obj state change, possibly assignment overloading

Ref as lval during initialization — seating. ie permanently saving an address into the 4-byte ref
Ref as lval but not initialization — obj state change, possibly assignment overloading

Nonref primitive as lval — obj state change, just like java primitive
Nonref class type as lval — obj state change, possibly assignment overloading

Ptr (including “new struct123”) as rval — returns address

Ptr unwrapped as rval, initializing a ref — pbref by returning address
Ptr unwrapped as rval, not initializing a ref — pbclone
.
Ref as rval, initializing another ref — pbref by returning address
Ref as rval, not initializing another ref — pbclone
.
Nonref class type var as rval, initializing a ref — pbref by returning address
Nonref class type var as rval, not initializing a ref — pbclone
.
Nonref primitive var as rval, initializing a ref — pbref by returning address
Nonref primitive var as rval, not initializing a ref — pbclone
.
nonref primitive literal like “23.5” as rval, not initializing a ref — pbclone
nonref primitive literal like “23.5” as rval, initializing a ref — illegal

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s