Path: csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Ben Bacarisse Newsgroups: comp.lang.javascript Subject: Re: Not understanding OOP stuff Date: Tue, 25 Jul 2017 11:31:27 +0100 Organization: A noiseless patient Spider Lines: 27 Message-ID: <87inigolj4.fsf@bsb.me.uk> References: <1914438.irdbgypaU6@PointedEars.de> <02ec6752-8a2d-4116-9396-71d36dcbd579@googlegroups.com> <87k22zrmtj.fsf@bsb.me.uk> <3298850e-dce6-4384-af58-8bb58830960f@googlegroups.com> <87379msw5i.fsf@bsb.me.uk> <87a83ur1kp.fsf@bsb.me.uk> <3335323.kQq0lBPeGt@PointedEars.de> <871sp5ph3z.fsf@bsb.me.uk> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="262d22a30eb43a29f8d3970a6557c777"; logging-data="3492"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+tUCecyf73BlYUwZQtEoDfCDfijXtWUas=" Cancel-Lock: sha1:0ZFhPFiJtSQz1jEBJi/obCweis8= sha1:x90tbXxTi8nai88WanAxw4n0a5Q= X-BSB-Auth: 1.9e725d5c7e2dc6ad6b0e.20170725113127BST.87inigolj4.fsf@bsb.me.uk Xref: csiph.com comp.lang.javascript:33662 John G Harris writes: > On Tue, 25 Jul 2017 00:09:20 +0100, Ben Bacarisse > wrote: > > >>For example, in a message passing language the message can fail if the >>object does not implement that particular message. In your examples, >>the message sending (which is just a function call) can't fail for that >>reason. >> >>To my mind, message passing would look rather more like: >> >> var msg = ["foo", 42, 23]; >> o.process_message(msg); >> >>This would succeed or fail depending on whether o's prototype chain >>included a foo method at that time. > > Surely doing a.foo() will fail if a and its prototype chain don't > implement the foo kind of message. The suggested code included a.foo = . -- Ben.