|
 |
Warp wrote:
> It would be less efficient because it would require always deep-copying
> data when it's passed around?
Basically. Deep-copying and duplicating.
If I say
X is a list [1, 2, 3]
Y is a list prepending 0 to X
Z is a list prepending 9 to X
then X is still out there only once, and Y and Z point to it. Lists are
"linked lists" rather than array-like lists.
>> The real situation is of course a bit more complicated than this, but
>> you get the idea.
>
> It looks like a really inefficient way of computing a simple calculation.
It's a lazy calculation. Hopefully the compiler can figure out when it
doesn't actually need to do that.
--
Darren New, San Diego CA, USA (PST)
Serving Suggestion:
"Don't serve this any more. It's awful."
Post a reply to this message
|
 |