3 ms·
"No idea though where pointer dereferencing as foo.* = 42" I have no idea either, but it does remind me of BLISS; I remember there being BLISS-10 (for pdp-10)
by GeorgeTirebiter 5y ago
"No idea though where pointer dereferencing as foo.* = 42" I have no idea either, but it does remind me of BLISS; I remember there being BLISS-10 (for pdp-10) and BLISS-11 (for pdp-11), came out of CMU. (Apparently there were even more versions https://en.wikipedia.org/wiki/BLISS https://en.wikipedia.org/wiki/BLISS )
All variables were pointers; and so a common BLISS statement would be:
.Z = .X + .Y which in 'C' would of course be z = x + y
- deleted 5y ago[deleted]
- nemo1618 5y agoI actually love the foo.* syntax. Think about it like this: if foo were a struct, then foo.x would give you the x field. But what if you want all the fields? Then you'd write foo.* -- a Unix glob!
- gsliepen 5y agoInterestingly, you can do foo.operator*() in C++: https://godbolt.org/z/f5Geqcvdj https://godbolt.org/z/f5Geqcvdj
- GeorgeTirebiter 5y agoThere is a small bug there, should be: Z = .X + .Y Since variables are names of addresses, you have to de-reference the X and Y addresses, add them, and, (crucially), the result gets stored: in the place pointed to by Z --- you don't care what .Z is anymore, as you are about to overwrite it. When you think of it that way, z = x + y seems 'wrong' because the meaning of a variable name is different on the LHS and the RHS of '='