Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:8296 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 27566 invoked by uid 1010); 2 Mar 2004 08:15:02 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 27016 invoked from network); 2 Mar 2004 08:14:58 -0000 Received: from unknown (HELO mail.zend.com) (192.117.235.230) by pb1.pair.com with SMTP; 2 Mar 2004 08:14:58 -0000 Received: (qmail 15396 invoked from network); 2 Mar 2004 08:14:52 -0000 Received: from guardian.zend.office (HELO AndiNotebook.zend.com) (10.1.1.4) by mail.zend.com with SMTP; 2 Mar 2004 08:14:52 -0000 Message-ID: <5.1.0.14.2.20040302101340.026a96c8@127.0.0.1> X-Sender: andi@127.0.0.1 X-Mailer: QUALCOMM Windows Eudora Version 5.1 Date: Tue, 02 Mar 2004 10:14:50 +0200 To: Piotr Klaban Cc: internals@lists.php.net In-Reply-To: <20040302074834.GA2894@oryl.man.torun.pl> References: <5.1.0.14.2.20040302000350.0272fc70@127.0.0.1> <5.1.0.14.2.20040302000350.0272fc70@127.0.0.1> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Subject: Re: [PHP-DEV] Perl extension From: andi@zend.com (Andi Gutmans) At 08:48 AM 3/2/2004 +0100, Piotr Klaban wrote: >On Tue, Mar 02, 2004 at 12:10:51AM +0200, Andi Gutmans wrote: > > $x = new Perl("Test"); > > $y = new PerlScalar($x); >The above could generate mistakes. >It is better to use perl_wantarray(something) >or perl_wantarray(); something;. > > > Any ideas or suggestions? It would also be cool if people could mess > around > > with it a bit and give us some feedback. > >Is this possible (?): > >$x = new Perl("Test"); >$y = $x->f(); // scalar context >$x->f(); // void context >$y = array( $x->f() ); // array context > >or maybe >$y = perl_array( $x->f() ); Nope, because that would require changes in the language which we wouldn't want to do just for Perl. The following could maybe be made to work: $x->void->f(); $x->scalar->f() $x->array->f() Andi Andi