Re: [PHP-DEV] Re: [Zend Engine 2] Re: [PHP-DEV] [patch]__string()method

2003-09-04 Thread Moriyoshi Koizumi
> > A default __toString() doesn't hinder an extension that interoperates with > > Java/COM or whatever external objects in anyway to handle their casting as > > they like. In fact the interface approach would deliver the ability to hide > > those internal differences so that the user can use the

Re: [PHP-DEV] Re: [Zend Engine 2] Re: [PHP-DEV] [patch]__string() method

2003-09-04 Thread Moriyoshi Koizumi
> >> It's just one of my trivial ideas, that why don't us make it capable of > >> arbitrary casting operation rather than limiting it just for string casts? Hmm, funny English.. I've got no idea why I wrote it this way. > > i agree here. this can be important for external integration e.g. Java an

Re: [PHP-DEV] Re: [Zend Engine 2] Re: [PHP-DEV] [patch] __string() method

2003-09-04 Thread Marcus Börger
Hello l0t3k, Thursday, September 4, 2003, 2:56:16 PM, you wrote: >> It's just one of my trivial ideas, that why don't us make it capable of >> arbitrary casting operation rather than limiting it just for string casts? > i agree here. this can be important for external integration e.g. Java and >

[PHP-DEV] Re: [Zend Engine 2] Re: [PHP-DEV] [patch] __string() method

2003-09-04 Thread l0t3k
> It's just one of my trivial ideas, that why don't us make it capable of > arbitrary casting operation rather than limiting it just for string casts? i agree here. this can be important for external integration e.g. Java and COM > Moriyoshi -- PHP Internals - PHP Runtime Development Mailing Li

[PHP-DEV] Re: [Zend Engine 2] Re: [PHP-DEV] [patch] __string() method

2003-09-04 Thread l0t3k
> It's just one of my trivial ideas, that why don't us make it capable of > arbitrary casting operation rather than limiting it just for string casts? i agree here. this can be important for external integration e.g. Java and COM > Moriyoshi -- PHP Internals - PHP Runtime Development Mailing Li

[PHP-DEV] Re: [Zend Engine 2] Re: [PHP-DEV] [patch] __string() method

2003-09-03 Thread Moriyoshi Koizumi
[EMAIL PROTECTED] (Marcus Börger) wrote: > Here's a strip down version which uses the function name "toString". > http://marcus-boerger.de/php/ext/ze2/ze2-tostring-20030902.diff.txt > > As you can see it would now require every object implementing that function. > However the idea behind is that

[PHP-DEV] Re: [Zend Engine 2] Re: [PHP-DEV] [patch] __string() method

2003-09-03 Thread Marcus Börger
Hello Moriyoshi, Wednesday, September 3, 2003, 8:51:45 PM, you wrote: > [EMAIL PROTECTED] (Marcus Börger) wrote: >> > BTW, how about allowing zend_object_cast() to return a boolean value and >> > decide whether to use the default casting behaviour or the modified >> > one, Marcus? This seems to

[PHP-DEV] Re: [Zend Engine 2] Re: [PHP-DEV] [patch] __string() method

2003-09-03 Thread Moriyoshi Koizumi
[EMAIL PROTECTED] (Marcus Börger) wrote: > > BTW, how about allowing zend_object_cast() to return a boolean value and > > decide whether to use the default casting behaviour or the modified > > one, Marcus? This seems to reduce such redundant effort. > > I did that in my patch so you can decide w

[PHP-DEV] Re: [Zend Engine 2] Re: [PHP-DEV] [patch] __string() method

2003-09-03 Thread Marcus Börger
Hello Moriyoshi, Wednesday, September 3, 2003, 7:05:26 PM, you wrote: > Hi, >> > First why not name it toString() since for now we have consensus on sudlyCaps. >> > But i didn't bother with names yet when i made this patch: >> > http://marcus-boerger.de/php/ext/ze2/ze2-iterators-20030902.diff.tx

[PHP-DEV] Re: [Zend Engine 2] Re: [PHP-DEV] [patch] __string() method

2003-09-03 Thread Moriyoshi Koizumi
Hi, > > First why not name it toString() since for now we have consensus on sudlyCaps. > > But i didn't bother with names yet when i made this patch: > > http://marcus-boerger.de/php/ext/ze2/ze2-iterators-20030902.diff.txt > > I chose '__string' to follow the existing convention for "special" > m

Re: [PHP-DEV] [patch] __string() method

2003-09-02 Thread Marcus Börger
Hello Jon, Tuesday, September 2, 2003, 5:45:29 PM, you wrote: > On Tue, Sep 02, 2003 at 11:59:29AM +0200, Marcus Brger wrote: >> JP> Attached is a fairly simple (and rough) patch that adds support for a >> JP> "special" __string() object method to ZE2. I wrote it for fun, but I >> JP> thought t

Re: [PHP-DEV] [patch] __string() method

2003-09-02 Thread Jon Parise
On Tue, Sep 02, 2003 at 11:45:29AM -0400, Jon Parise wrote: > I chose '__string' to follow the existing convention for "special" > method names (e.g. __construct, __clone, __call). Also, I suspect > that many developers are already using toString() methods in their > classes, and I'm not sure we

Re: [PHP-DEV] [patch] __string() method

2003-09-02 Thread Jon Parise
On Tue, Sep 02, 2003 at 11:59:29AM +0200, Marcus Brger wrote: > JP> Attached is a fairly simple (and rough) patch that adds support for a > JP> "special" __string() object method to ZE2. I wrote it for fun, but I > JP> thought there might be general interest in the idea, so I'm posting it > JP> h

Re: [PHP-DEV] [patch] __string() method

2003-09-02 Thread Marcus Börger
Hello Jon, Tuesday, September 2, 2003, 10:29:11 AM, you wrote: JP> Attached is a fairly simple (and rough) patch that adds support for a JP> "special" __string() object method to ZE2. I wrote it for fun, but I JP> thought there might be general interest in the idea, so I'm posting it JP> here.

[PHP-DEV] [patch] __string() method

2003-09-02 Thread Jon Parise
Attached is a fairly simple (and rough) patch that adds support for a "special" __string() object method to ZE2. I wrote it for fun, but I thought there might be general interest in the idea, so I'm posting it here. The idea is inspired by Python's __str__ method [1]. Here's how it works in prac