On Mar 23, 2009, at 9:27, Mark Engelberg wrote: > still be essential to the notion of equality). Any other tricks or > techniques for helping to hide or separate out the portions of a data > structure that are meant to be accessed or "altered" from the portions > that should only be accessed and changed by the existing support > functions?
One option is to have the data manipulated only by specific support functions, just like many OO languages take the approach that an object's state can only be modified by corresponding methods. You can't really stop client code from inspecting your objects and do evil things to them, just as you can't prevent client code in a language like Python from manipulating an object any way it likes. However, experience (in the Python world, for Clojure it's a bit early to tell) has shown that this hardly ever happens by accident. You seem to envisage exposing some aspects of your data structure as part of the public API and have others reserved for use by "authorized" support function. Could you give an example of a situation where this would be advantageous compared to a support- function-only approach? Konrad. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~----------~----~----~----~------~----~------~--~---