On Tue, Mar 02, 2004 at 06:11:04PM +0100, Kai Schröder wrote:
> Simple example:
> In Perl ('a' => 'b', 'c' => 'd') could be an assoc array with 2 elements 
> (hash) or a list with 4 elements (array, elements on odd positions are the 
> old keys).

IMHO this is done by Perl converting HASH to ARRAY internally. In the same
way Perl converts array to scalar with scalar(@a), that is equal to number
of records in @a (equal to $#a-$[+1) and synonym of PHP's count($a).
With scalar(%a) you get number of used/allocated hash buckets, in Perl6
it would get a reference to %a (as stated in Exegesis 2).
IMHO all the perl complications should be passed over in first version of PHP
perl module.

In Polish there is a proverb "The Krakow (old Polish capital city)
has not been build at one". I.e. start from the simple extension
and .. extend it.

> Other problems I see:
> - Perl scalars could be references to anything (for instance on variables 
> inside a sub/function)

That is why PHP variable could be one from the two:
- a perl object
- a PHP variable independent from the Perl variable, mapped to scalar,
  or array/hash array during the copying phase.

> - Perl have an good working own Garbage Collection, do you really want to 
> manage memory manually?

IMHO when object is destroyed on the PHP side, the Perl GC is used on the Perl side.

> - In Perl $var, @var and %var are different things (same name, but different 
> prefix and variable type)

> PHP doesn't need Perl support really, it is only nice to have. The other (and 

In 2001 I thought that Perl6 would be ready for use in Aug 2002 ...
IMHO PHP is similar to Perl5, and I have heard of PHP/Perl module
a few years ago. It is just a matter of time ... the module need to exists.

> imho better) way is to motivate PEAR developer more, than you don't need to 
> assimilate CPAN code. And again: take some minutes to think about PHP for 
> Parrot.

+1000 for PHP for Parrot (AFAIK PHP it would run faster (?)).

-- 
Piotr Klaban

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to