4 ms·
right, but doesn't that contradict this: > "in Copper, variables only store functions" because here, `x` clearly stores an object... is this about the whole "
by uryga 6y ago
right, but doesn't that contradict this:
> "in Copper, variables only store functions"
because here, `x` clearly stores an object... is this about the whole "object-function" thing where Copper doesn't really distinguish the two?
(btw i'm sure this is explained in the docs... but maybe this'll help folks like me who often just read the comments)
- nercht12 6y agoCopper does not distinguish between function and object. An object-function has two parts: the member part and the executable body. In C++, it's analogous to: class FunctionObject { FunctionObject* members[]; void* operator() { /* executable body */ } };