Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • 3
    $\begingroup$ I only noticed this answer right now, but I'd stress again that modifications of built-in functions are the last resort and may have unintended consequences. The Part and Function are among those I would never touch for anything serious. Apart from the general problems which come with overloading built-ins, Part is particularly important. It is easy, for example, to inadvertently make assignments have different complexity (like linear instead of constant time), and break Part in other subtle ways. If nothing else, I'd seriously recommend to put a warning at the top in large bold font. $\endgroup$ Commented May 22, 2012 at 13:40
  • $\begingroup$ In fact, while I don't downvote, this answer is a close candidate for my downvote had I changed my mind. Please don't take it personally, you have many great posts, and I also did all these experiments with overloading built-ins, many times. It's just that there is a difference between our private experimentation and putting this stuff out in a public answer, because many people may get excited by this and not have enough knowledge to see the dangers of this approach (this does not refer to you, of course). $\endgroup$ Commented May 22, 2012 at 13:47
  • $\begingroup$ Yes I hesitated before putting this here, my previous answer didn't modify Part and Function, I left it to interested people. I put the code more for sharing the experimentation, in case someone could improve it. $\endgroup$ Commented May 22, 2012 at 14:48
  • $\begingroup$ It is a pity that we don't have some place where we could share experimental stuff without all that responsibility, which would be as easily accessible / readable /etc as here. May be some day... $\endgroup$ Commented May 22, 2012 at 14:58