Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:82450 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 70179 invoked from network); 11 Feb 2015 08:12:50 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Feb 2015 08:12:50 -0000 Authentication-Results: pb1.pair.com smtp.mail=pthreads@pthreads.org; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=pthreads@pthreads.org; sender-id=unknown Received-SPF: error (pb1.pair.com: domain pthreads.org from 209.85.220.50 cause and error) X-PHP-List-Original-Sender: pthreads@pthreads.org X-Host-Fingerprint: 209.85.220.50 mail-pa0-f50.google.com Received: from [209.85.220.50] ([209.85.220.50:50735] helo=mail-pa0-f50.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B0/8E-33902-10F0BD45 for ; Wed, 11 Feb 2015 03:12:50 -0500 Received: by mail-pa0-f50.google.com with SMTP id hz1so2443073pad.9 for ; Wed, 11 Feb 2015 00:12:47 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=5+lv/xZC1n5c1xbYfCBpH/sm/b92Cd0dXMd2LUFX0mc=; b=JdfbJuuhf2r7Qlwxe789GMmnQTAUrOfFbKL924xuh3sSDcHfp3IT5SC9YT2owpgI0Y 8hwrRDZkEmTUxAse5ICHsvbPyijNjbYGj0afk68hSlDSDw/ntMxlLk2zXJZxHfuz3kwu p2F/QmMw8stJDfbVGqNLyjrZ0ElEZy3egFBl5q+sZ1ASFdFAHkhMECF4+Fw7CEJC5oS3 QYMaLLTpCArFJOMoUDIfiFBRaQlqzqqsINM/PEnhTNocVhsdsD0MGb41MBTsCng/kM2Z MFwDmN6A7Tv9QZ4AoaK+k5TvQQ4MrRrGTGfGsklRwMKQCTurlXEEnofJ5whRXz72hst9 jIsA== X-Gm-Message-State: ALoCoQkRmVIebMtNLJRCLud8GE1nNXQIw/mt1Be6UfBwMZjrk6AyblJg4ytwa8Iynf7/jcDaqYzv MIME-Version: 1.0 X-Received: by 10.70.102.131 with SMTP id fo3mr44907684pdb.78.1423642367528; Wed, 11 Feb 2015 00:12:47 -0800 (PST) Received: by 10.70.49.100 with HTTP; Wed, 11 Feb 2015 00:12:47 -0800 (PST) X-Originating-IP: [109.145.22.92] In-Reply-To: <54DB0E55.9000207@gmail.com> References: <54DAFD32.3000005@gmail.com> <54DB0BC0.20304@gmail.com> <54DB0E55.9000207@gmail.com> Date: Wed, 11 Feb 2015 08:12:47 +0000 Message-ID: To: Stanislav Malyshev Cc: Dmitry Stogov , Yasuo Ohgaki , =?UTF-8?Q?Fran=C3=A7ois_Laupretre?= , PHP Internals Content-Type: multipart/alternative; boundary=001a11c30bd09aa958050ecb9196 Subject: Re: [PHP-DEV] Design by Contract From: pthreads@pthreads.org (Joe Watkins) --001a11c30bd09aa958050ecb9196 Content-Type: text/plain; charset=UTF-8 > Just a thought - what about something like __pre/__post? We own __*, so no BC problems. I'm not married to the words being used, at all. I think this is a good idea, we would need __pre, __post , and __invariant, or some combination of three. Any objection to using __ prefixed names, and any other suggestion for them, or just use the above ? Cheers Joe On Wed, Feb 11, 2015 at 8:09 AM, Stanislav Malyshev wrote: > Hi! > > >> function foo($a) > >> require($a >= 0) > >> { > >> } > > > > This is a step better but still we have the similar issues with > > readability, to which reuse of 'require' is added. > > Just a thought - what about something like __pre/__post? We own __*, so > no BC problems. > OTOH, don't our new parsing improvements allow us to handle syntax like > this without introducing a keyword that would be forbidden as > class/function name? The context is pretty unambiguous here. > -- > Stas Malyshev > smalyshev@gmail.com > --001a11c30bd09aa958050ecb9196--