Re: [PHP-DEV] FastArray, great addition

2008-06-18 Thread Etienne Kneuss
Hello,

On Wed, Jun 18, 2008 at 4:47 PM, Antony Dovgal <[EMAIL PROTECTED]> wrote:
> On 18.06.2008 16:40, Alexey Zakhlestin wrote:
>>
>> On 6/18/08, Antony Dovgal <[EMAIL PROTECTED]> wrote:
>>
>>>  Though I'd like to be able to cast these arrays to PHP's arrays and we
>>> need
>>> to implement get_properties() handler for that.
>>>  If there are no objections, I'll commit my patch when I get back home
>>> (30th
>>> of June).
>>
>> 2-way conversion would be perfect ;)
>
> There is no way to cast an array to an object of certain class, but it
> should not be a problem to add a function to convert array to fastarray.
>
> Want to make a patch yourself?
> Should be pretty easy to do, just don't forget to throw an exception on
> string key.

I'll take care of it (both "conversions" actually)

Regards

>
> --
> Wbr, Antony Dovgal
>
>



-- 
Etienne Kneuss
http://www.colder.ch

Men never do evil so completely and cheerfully as
when they do it from a religious conviction.
-- Pascal

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



Re: [PHP-DEV] FastArray, great addition

2008-06-18 Thread Alexey Zakhlestin
On 6/18/08, Antony Dovgal <[EMAIL PROTECTED]> wrote:

> > 2-way conversion would be perfect ;)
> >
>
>  There is no way to cast an array to an object of certain class, but it
> should not be a problem to add a function to convert array to fastarray.
>
>  Want to make a patch yourself?
>  Should be pretty easy to do, just don't forget to throw an exception on
> string key.

I will give it a try

-- 
Alexey Zakhlestin
http://blog.milkfarmsoft.com/

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



Re: [PHP-DEV] FastArray, great addition

2008-06-18 Thread Antony Dovgal

On 18.06.2008 16:40, Alexey Zakhlestin wrote:

On 6/18/08, Antony Dovgal <[EMAIL PROTECTED]> wrote:


 Though I'd like to be able to cast these arrays to PHP's arrays and we need
to implement get_properties() handler for that.
 If there are no objections, I'll commit my patch when I get back home (30th
of June).


2-way conversion would be perfect ;)


There is no way to cast an array to an object of certain class, 
but it should not be a problem to add a function to convert array to fastarray.


Want to make a patch yourself?
Should be pretty easy to do, just don't forget to throw an exception on string 
key.

--
Wbr, 
Antony Dovgal


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



Re: [PHP-DEV] FastArray, great addition

2008-06-18 Thread Alexey Zakhlestin
On 6/18/08, Antony Dovgal <[EMAIL PROTECTED]> wrote:

>  Though I'd like to be able to cast these arrays to PHP's arrays and we need
> to implement get_properties() handler for that.
>  If there are no objections, I'll commit my patch when I get back home (30th
> of June).

2-way conversion would be perfect ;)

-- 
Alexey Zakhlestin
http://blog.milkfarmsoft.com/

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



Re: [PHP-DEV] FastArray, great addition

2008-06-18 Thread Antony Dovgal

On 16.06.2008 14:28, Pierre Joye wrote:

My only wish is to actually respect the informal decision we took a
while back, to do not use "fast", "improved", "better" or similar
wording in function or extension names. What's about naming it CArray
or something similar? To reflect what it is, it is not a fast(er) hash
table like our current array, it is a C-like array.


I can live with any name, so feel free to choose whatever you like most.


Though I'd like to be able to cast these arrays to PHP's arrays 
and we need to implement get_properties() handler for that.
If there are no objections, I'll commit my patch when 
I get back home (30th of June).


--
Wbr, 
Antony Dovgal


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



Re: [PHP-DEV] FastArray, great addition

2008-06-16 Thread Alexey Zakhlestin
On 6/16/08, Lukas Kahwe Smith <[EMAIL PROTECTED]> wrote:
>  so the next tweak will lead to EvenFasterArray?

I can't imagine anything faster (current FastArray can be optimized to
use SIMD, if needed — that would just be "implementation detail")

well.. the proper name, for current "FastArray" would be just "Array",
but that name is already occupied by hash

I don't like how "CArray" refers to C, because similiar constructs
exist in many languages. maybe "FixedArray"?

-- 
Alexey Zakhlestin
http://blog.milkfarmsoft.com/


Re: [PHP-DEV] FastArray, great addition

2008-06-16 Thread Lukas Kahwe Smith


On 16.06.2008, at 13:27, Alexey Zakhlestin wrote:


On 6/16/08, Pierre Joye <[EMAIL PROTECTED]> wrote:

hi all,

As you noticed already PHP finally got simple C-like array, thanks to
Etienne and Tony for their great work!

My only wish is to actually respect the informal decision we took a
while back, to do not use "fast", "improved", "better" or similar
wording in function or extension names. What's about naming it CArray
or something similar? To reflect what it is, it is not a fast(er)  
hash

table like our current array, it is a C-like array.


and I like that name, because… well it is actually Array (unlike php's
hash/array-mixture) and… well… it is fast ;)


so the next tweak will lead to EvenFasterArray?

regards,
Lukas Kahwe Smith
[EMAIL PROTECTED]




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



Re: [PHP-DEV] FastArray, great addition

2008-06-16 Thread Alexey Zakhlestin
On 6/16/08, Pierre Joye <[EMAIL PROTECTED]> wrote:
> hi all,
>
>  As you noticed already PHP finally got simple C-like array, thanks to
>  Etienne and Tony for their great work!
>
>  My only wish is to actually respect the informal decision we took a
>  while back, to do not use "fast", "improved", "better" or similar
>  wording in function or extension names. What's about naming it CArray
>  or something similar? To reflect what it is, it is not a fast(er) hash
>  table like our current array, it is a C-like array.

and I like that name, because… well it is actually Array (unlike php's
hash/array-mixture) and… well… it is fast ;)

-- 
Alexey Zakhlestin
http://blog.milkfarmsoft.com/


[PHP-DEV] FastArray, great addition

2008-06-16 Thread Pierre Joye
hi all,

As you noticed already PHP finally got simple C-like array, thanks to
Etienne and Tony for their great work!

My only wish is to actually respect the informal decision we took a
while back, to do not use "fast", "improved", "better" or similar
wording in function or extension names. What's about naming it CArray
or something similar? To reflect what it is, it is not a fast(er) hash
table like our current array, it is a C-like array.


Cheers,
-- 
Pierre

http://blog.thepimp.net | http://www.libgd.org

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