Re: Perl extension
| From: | Andi Gutmans | Date: | Tue, 02 Mar 2004 08:14:50 +0000 |
| Subject: | Re: Perl extension | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-8296@lists.php.net to get a copy of this message | ||
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");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$y = $x->f(); // scalar context $x->f(); // void context$y = array( $x->f() ); // array context or maybe $y = perl_array( $x->f() );