Re: Capabilities interact nicely with Substructural Types and Reactivity
Tony Arcieri <[email protected]>
| Newsgroups | gmane.comp.capabilities.general |
|---|---|
| Message-ID | <CAHOTMVLFqGFx3CLs5oE5wmVJ7y5RM1r8bSu-Q4yjhO9GbuJMsg@mail.gmail.com> |
On Thu, Sep 12, 2013 at 9:41 AM, <[email protected]> wrote: > Someone shoot my down if I'm off in the weeds here, but I'm pretty sure > you can get the equivalent of a private constructor in javascript by doing > the following , which boils down to having the constructor check if the > caller to the factory is on the clist (a public method). If so, call the > callee's private factory method (an internal anonymous function), else > return/throw an exception indicating you aren't on a clist to do that. This reminds me of a Ruby library called i-told-you-it-was-private, except instead of just throwing an exception, in a brazen act of offensive programming it deletes the caller's source code files ;) https://github.com/fxn/i-told-you-it-was-private/blob/master/lib/i-told-you-it-was-private.rb -- Tony Arcieri _______________________________________________ cap-talk mailing list [email protected] http://www.eros-os.org/mailman/listinfo/cap-talk