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*

5
  • $\begingroup$ You certainly can do the second, again, using UpValues but I think your whitelist will be necessarily huge. Perhaps even more than the list interface. $\endgroup$ Commented Mar 11, 2017 at 22:37
  • $\begingroup$ @MB1965: The whitelist I had in mind consists of precisely those functions for which I have defined upvalues. It will not allow my object to behave like a true list in every possible situation, but at list it will prevent silent errors. $\endgroup$ Commented Mar 12, 2017 at 0:01
  • 1
    $\begingroup$ You'll want things like Message and Hold and HoldComplete and all these things that we don't usually think of as "functions" though, too. There are just so many of them and I think you might find the system emitting more messages that you really want to deal with. $\endgroup$ Commented Mar 12, 2017 at 0:03
  • $\begingroup$ @MB1965: I see your point. I guess I see no way to use the upvalue idea to implement this discreteData objects safely. I think the silent errors I illustrated represent to big a risk. $\endgroup$ Commented Mar 12, 2017 at 0:12
  • 1
    $\begingroup$ Might be worth implementing a blacklist instead. What sort of functions are you most concerned about? For instance it seems Listable functions are most apt to cause you trouble. $\endgroup$ Commented Mar 12, 2017 at 0:22