Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:53573 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 53019 invoked from network); 24 Jun 2011 12:08:34 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Jun 2011 12:08:34 -0000 Authentication-Results: pb1.pair.com header.from=ml@anderiasch.de; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=ml@anderiasch.de; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain anderiasch.de from 81.169.138.148 cause and error) X-PHP-List-Original-Sender: ml@anderiasch.de X-Host-Fingerprint: 81.169.138.148 ares.art-core.org Received: from [81.169.138.148] ([81.169.138.148:42432] helo=mail.anderiasch.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 3E/24-23673-25C740E4 for ; Fri, 24 Jun 2011 08:00:20 -0400 Message-ID: <4E047C43.4030109@anderiasch.de> Date: Fri, 24 Jun 2011 14:00:03 +0200 User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.9.2.18) Gecko/20110616 Thunderbird/3.1.11 MIME-Version: 1.0 To: internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: from __future__ import... From: ml@anderiasch.de (Florian Anderiasch) Hello, there's something that's been on my mind for a while, but I've not yet fully managed to think more about feasibility. For those who didn't know this already, Python has a pseudo-module __future__ that allows BC breaks in future versions to be anticipated. I'll quote an example: =================================================== Under 2.0, it prints: x is 42 Nested scopes[2] are being introduced in 2.1. But under 2.1, it still prints x is 42 and also generates a warning. In 2.2, and also in 2.1 *if* "from __future__ import nested_scopes" is included at the top of scope.py, it prints x is 666 =================================================== The whole process is detailed in PEP-236 [1]. So, I do know we're in dealing with BC differently than python does and even the import methodology may make slightly less sense with namespaces... ...but did everyone ever put some thought into this? - As this is done at compile-time, wouldn't it be a glorified auto-prepend on steroids? - Would it imply backporting much stuff? probably not possible, like for example "traits in 5.3" - Would it be worth some effort in PHP itself so that people could code forward-compatible in 5.x to anticipate BC breaks in 5.x+1? - Does it make sense at all? :) Just some food for thought. Greetings, Florian [1] http://www.python.org/dev/peps/pep-0236/