Timeline for 'Tuple' vs 'List' operations in python
Current License: CC BY-SA 3.0
8 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Mar 31, 2015 at 0:09 | comment | added | Ixrec | @overexchange I'm actually looking at it right now. I'll probably attempt to answer it tomorrow if no one else does. | |
| Mar 31, 2015 at 0:07 | vote | accept | overexchange | ||
| Mar 31, 2015 at 0:00 | comment | added | Ixrec | Normally, "insert" and "delete" refer to operations that mutate an existing object rather than methods which return a new object. That's how I've been using them here. I wouldn't necessarily call your code "wrong", through it is potentially confusing/misleading. I also don't really see the point of an immutable linked list, since linked lists are best when you want to do a lot of (mutating) insertions/deletions. | |
| Mar 30, 2015 at 23:55 | comment | added | overexchange | For your point: "mutating operations like insert/delete". I implemented insert/delete operations maintaining immutability here.Is the insert/delete implementation here wrong semantically? | |
| Mar 30, 2015 at 23:54 | history | edited | Ixrec | CC BY-SA 3.0 | added 1161 characters in body |
| Mar 30, 2015 at 23:36 | comment | added | Ixrec | It has nothing to do with performance. It's semantics. An immutable type, by definition, is one that does not allow you to perform mutating operations like insert/delete. As soon as you implement those operations it's not immutable anymore. I could add a brief explanation of why immutable types are a Very Good Thing if that would help. | |
| Mar 30, 2015 at 23:34 | comment | added | overexchange | I tried implementing insert/delete operations on immutable type here in java. I mean, which factor does not allow us to implement such operations? Is it cpu time && memory space usage factor? | |
| Mar 30, 2015 at 22:56 | history | answered | Ixrec | CC BY-SA 3.0 |