Coercing 'this'
# Mark S. Miller (17 years ago)
On Mon, Sep 15, 2008 at 8:12 PM, David-Sarah Hopwood < david.hopwood at industrial-designers.co.uk> wrote:
When you ask for suggestions to prevent the existing confusion, do you mean:
- the fact that some built-ins have different specified behaviour when used as functions vs as constructors, and this can't be expressed by self-hosting code in all cases?
- the fact that something intended as a constructor can be called as a function and vice-versa?
- both?
Both.
Mark S. Miller wrote:
esdiscuss/2008-August/006941
Yes, so it does.
If we choose any other desugaring (perhaps using 'this' for performance reasons, say), we should make sure that it retains that property.
When you ask for suggestions to prevent the existing confusion, do you mean: