Re: function call chaining

From: Date: Wed, 20 Jan 2010 10:59:22 +0000
Subject: Re: function call chaining
References: 1 2 3 4 5 6 7 8 9  Groups: php.internals 
Request: Send a blank email to internals+get-46835@lists.php.net to get a copy of this message
Religious programming is the problem. On Tue, Jan 19, 2010 at 6:28 PM, Gwynne Raskind <gwynne@darkrainfall.org> wrote: > On Jan 19, 2010, at 5:54 PM, Alain Williams wrote: >>>> $eep->oop()->ork()->ah()->ah(); >>>> >>>> the newcomer will have to spend significant time rummaging around the >>>> source code to figure out what classes are involved. >>> As opposed to: >>> $oop = $eep->oop(); >>> $ork = $oop->ork(); >>> $ah = $ork->ah(); >>> $ah2 = $ah->ah(); No amount of syntax change will alter the "true believer", it just creates new religions. New rituals, new syntax, new languages. To that end, I suggest a "trinity" operator, three colons in a row... ObjectIDont'Understand::methodIhaven'tread:::DoWhatIWant. When it fails, the failing will be on the part of the invocator, because the trinity is not bound by logic. Any bugs would question the faith, which is infallible, by definition. Backing up, maybe it's a bad idea to argue about compilers.... with people who haven't written them.

« previous php.internals (#46835) next »