Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:83103 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 6647 invoked from network); 18 Feb 2015 18:28:49 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Feb 2015 18:28:49 -0000 Authentication-Results: pb1.pair.com smtp.mail=guilhermeblanco@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=guilhermeblanco@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.223.181 as permitted sender) X-PHP-List-Original-Sender: guilhermeblanco@gmail.com X-Host-Fingerprint: 209.85.223.181 mail-ie0-f181.google.com Received: from [209.85.223.181] ([209.85.223.181:38142] helo=mail-ie0-f181.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B5/13-25021-0E9D4E45 for ; Wed, 18 Feb 2015 13:28:49 -0500 Received: by iecrd18 with SMTP id rd18so3474710iec.5 for ; Wed, 18 Feb 2015 10:28:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=m2F5kapTXXBnnmKDpAXyud/LQCZ7iV9Uo1sCHWC/apg=; b=Pm6LAKg+2BJ2KjprD/xCmKeHapDoOedW/g+3ABWD9I/i8H2Ct4u0ePAgotkfTBLAmY aNe/J9zNzuAMW0JyeN8hvj+BKEjWo/soogOR5qvoE7xu856Lsc1dRkGsbipaMOMBkEim DAUU6VOLN4OUvVRbx0SAwWriYjZJ7aAmdAtseQ+lH+gm78MFOSIL+iedIbdgki8RzIM2 9sntT3zIbEanr+MGMN3wxn7u3UfcSWq4r2y6pTNXK8eIzb72o0hLvehstZvEOEmbN1dc WjFY9elH6DqVFJd3oWRXlnloGvgqOYJ+YgR8+DL8bqLSseVuU4SkzdeFsY726l0A5xHq b62w== X-Received: by 10.50.234.194 with SMTP id ug2mr4655332igc.39.1424284126324; Wed, 18 Feb 2015 10:28:46 -0800 (PST) MIME-Version: 1.0 Received: by 10.64.238.75 with HTTP; Wed, 18 Feb 2015 10:28:25 -0800 (PST) In-Reply-To: References: <02a101d04af9$507484f0$f15d8ed0$@php.net> <02ff01d04b72$abae34a0$030a9de0$@php.net> <032801d04b8d$8ff3dce0$afdb96a0$@php.net> Date: Wed, 18 Feb 2015 13:28:25 -0500 Message-ID: To: Dmitry Stogov Cc: francois , Benjamin Eberlei , Alexander Lisachenko , Nikita Popov , PHP Internals , Pierrick CHARRON , Pierre Joye , Zeev Suraski , Andi Gutmans , Joe Watkins , Yasuo Ohgaki , Sebastian Bergmann , Stanislav Malyshev , Rasmus Lerdorf Content-Type: multipart/alternative; boundary=001a1134b56268b1f1050f60fd91 Subject: Re: [PHP-DEV] Annotations in PHP7 From: guilhermeblanco@gmail.com ("guilhermeblanco@gmail.com") --001a1134b56268b1f1050f60fd91 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi Dmitry, > Are you (and Doctrine team) interested in this annotation idea? I'd say that Benjamin nailed in our possible usage: class Foo { } Now I do feel we need to elaborate some sort of named parameters. Doctrine tries to simplify a lot developer's life by using consistency in default mapping and only if the user wants to override default behavior he needs to override a given parameter. This means in a case where you're mapping a JoinColumn ( https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/Mapping/= JoinColumn.php ), you may only want to specify the onDelete=3D"CASCADE" operation instead of name, referencedColumnName and many other parameters. Trying to map this in your default parameter passing, we'd have something like: public $address; As I said, named parameters make a lot of sense when mapping defaults. Now by looking at this syntax, I still think we're closer to a simple array implementation (ReflectionClass::getMetadata(string $name)) and having something like: <[ "orm" =3D> [ new OneToOne("Address"), new JoinColumn(default, default, default, default, "CASCADE") ] ]> public $address; PS: We haven't even started on talking about overrides yet... =3D\ Regards, On Wed, Feb 18, 2015 at 12:04 PM, Dmitry Stogov wrote: > > > On Wed, Feb 18, 2015 at 6:14 PM, Fran=C3=A7ois Laupretre > wrote: > >> Hi Dmitry, >> >> >> >> Right. That=E2=80=99s what I got from your last reply. But my question w= as about >> another post where you are talking about =E2=80=98compile time evaluatio= n=E2=80=99 of >> expressions, which is different from the bare key/value storage I >> understood first, and poses the problem of compile time evaluation scope >> (which also exists at runtime). >> >> >> >> If you just store the expression as a bare string or AST without >> evaluating it, that=E2=80=99s fine and, even, much better from a perform= ance point >> of view. I just want to make it clear for me and everyone that there wil= l >> be no possibility of compile time evaluation. That=E2=80=99s all. >> > > right. > > Again, sorry to insist ;). >> > > no problem. > > Thaks. Dmitry. > > >> >> >> Fran=C3=A7ois >> >> >> >> I answer the last time. >> Annotations is just a key value storage, where value may be AST for php >> expression. >> >> Your may do with it whatever you like (traverse, evaluate, compile), but >> PHP core itself is not going to do anything. >> >> Thanks. Dmitry. >> > > --=20 Guilherme Blanco MSN: guilhermeblanco@hotmail.com GTalk: guilhermeblanco Toronto - ON/Canada --001a1134b56268b1f1050f60fd91--