[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A (Low-Level) Opaque Object Proposal for R5RS



  Guy Steele wrote:

  The trouble with UP and DOWN is that they are already a layer of metaphor
  removed from what you're really trying to say.

Agreed.

  An opaque object
  is presumably trying to make access to its innards impossible, not just
  difficult.

Well, impossible when the passkey is kept secret, otherwise it still serves
to make abstraction-crossing access explicit in the case where the passkey
is trivial.

This, by the way, is why I wanted the passkey to be an optional argument in
the opaque type constructor and the up/down coercions: some of us will use
this mechanism just to make it explicit when we are going from abstract to
concrete and back again, without any effort toward passkey secrecy. Even
this watered down use can be important, especially when teaching students
the hazards of abstraction violations and how they might insulate
themselves from inadvertently committing it. For this use, the extra passkey
argument would just be a nuisance, like an extraneous #f buzz argument.

  Other languages have used such (admittedly mundane) verb pairs as
  SEAL and UNSEAL or HIDE and REVEAL.  Consider also VEIL and UNVEIL,
  or SAFEGUARD and EXPOSE, or WRAP and UNWRAP.

I like VEIL and UNVEIL.  Has a nice romantic ring to it, and just a subtle
hint of hiding something without going to too much effort about it.