Re: [PHP-DEV] RFC: ZE2 and abstract

2002-11-20 Thread Stig S. Bakken
On Tue, 19 Nov 2002, Marcus Börger wrote:

> The link below contain a patch that allows abstract functions in ZE2.
> http://marcus-boerger.de/php/ext/ze2
> 
> abstract [static] function '(' parameters ')' ';'
> 
> it would be possible to make the ';' optional.
> 
> When an abstract method is called a fatal error is generated and
> execution stops. Another way of handling abstract would be to
> generate an E_WARNING or throw an exception. I experimented
> with the second one already but do not like it. I favor the first
> over the third but haven't tried that yet.
> 
> The thinks i did:
> introduce T_ABSTRACT = "abstract" and modified the parser.
> added is_abstract after is_static in zend_function (and such)
> emit an E_ERROR when is_abstract is set in 
> zend_init_static_method_call_handler & zend_init_method_call_handler
> 
> marcus

I like "abstract", it provides a good alternative to interfaces.  If we
make it interact right with aggregate and overloaded objects, we're
starting to have a very powerful OO platform, even for the Java buffs. :)

We need to figure out what happens with abstract methods if the object
aggregates a class that defines this method, and if/how __call should be
invoked if you try calling an abstract method (instead of just bailing out
with E_ERROR).

Andi and I agreed on how we wanted aggregate to work in Frankfurt, I'll 
write another followup tomorrow describing our conclusions on that and 
more in detail the problems we must solve related to "abstract" (too busy 
tonight).

 - Stig


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




Re: [PHP-DEV] RFC: ZE2 and abstract

2002-11-20 Thread Andi Gutmans
At 06:53 PM 11/20/2002 +0100, Sebastian Bergmann wrote:

Andi Gutmans wrote:
> A proxy object would do the trick!

  I know, and it wasn't meant as all that serious an argument :)


I know you weren't serious, neither was I :)

Andi


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




Re: [PHP-DEV] RFC: ZE2 and abstract

2002-11-20 Thread Sebastian Bergmann
Andi Gutmans wrote:
> A proxy object would do the trick!

  I know, and it wasn't meant as all that serious an argument :)

-- 
  Sebastian Bergmann
  http://sebastian-bergmann.de/ http://phpOpenTracker.de/

  Did I help you? Consider a gift: http://wishlist.sebastian-bergmann.de/

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




Re: [PHP-DEV] RFC: ZE2 and abstract

2002-11-20 Thread Andi Gutmans
At 06:43 PM 11/20/2002 +0100, Sebastian Bergmann wrote:

Andi Gutmans wrote:
> I don't see any need for final.

  A ZendEncoder customer could want to declare an encoded class "final"
  so that his users can't extend that class :-)


A proxy object would do the trick! Very quick hack :)

Andi


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




Re: [PHP-DEV] RFC: ZE2 and abstract

2002-11-20 Thread Sebastian Bergmann
Andi Gutmans wrote:
> I don't see any need for final.

  A ZendEncoder customer could want to declare an encoded class "final"
  so that his users can't extend that class :-)

-- 
  Sebastian Bergmann
  http://sebastian-bergmann.de/ http://phpOpenTracker.de/

  Did I help you? Consider a gift: http://wishlist.sebastian-bergmann.de/

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




Re: [PHP-DEV] RFC: ZE2 and abstract

2002-11-20 Thread Andi Gutmans
Hi,

The way you implemented it isn't what I meant *and* I never remember 
agreeing to final.
I don't see any need for final. If you really want Java then it already exists.

Andi

At 02:24 PM 11/20/2002 +0100, Marcus Börger wrote:
Added final now: http://marcus-boerger.de/php/ext/ze2

So we have:
abstract [static] function '(' parameters ')' ';'
[ final ] [ static ] function '(' parameters ')' '{' code '}'

There is a check that you cannot overwrite a final function of cause
and i also added a check that you cannot redeclare a function abstract.
See test files on this.

marcus


At 16:55 19.11.2002, Marcus Börger wrote:

The link below contain a patch that allows abstract functions in ZE2.
http://marcus-boerger.de/php/ext/ze2

abstract [static] function '(' parameters ')' ';'

it would be possible to make the ';' optional.

When an abstract method is called a fatal error is generated and
execution stops. Another way of handling abstract would be to
generate an E_WARNING or throw an exception. I experimented
with the second one already but do not like it. I favor the first
over the third but haven't tried that yet.

The thinks i did:
introduce T_ABSTRACT = "abstract" and modified the parser.
added is_abstract after is_static in zend_function (and such)
emit an E_ERROR when is_abstract is set in 
zend_init_static_method_call_handler & zend_init_method_call_handler

marcus



--->>> mailto:[EMAIL PROTECTED] <<<--
"We are animals among animals, all children of matter,
save that we are the more disarmed. But since, unlike animals,
we know that we must die, let us prepare for that moment
by enjoying the life that has been given us by chance and for chance."
   Umberto Eco, The island of the day before
->>> http://marcus-boerger.de <<<-


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



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




Re: [PHP-DEV] RFC: ZE2 and abstract

2002-11-20 Thread Marcus Börger
Yes your're right. I mixed it up while writing the error messages
which use the word function since we have no 'method' in the parser.

At 14:54 20.11.2002, Andrei Zmievski wrote:

On Wed, 20 Nov 2002, Marcus Börger wrote:
> Added final now: http://marcus-boerger.de/php/ext/ze2
>
> So we have:
> abstract [static] function '(' parameters ')' ';'
> [ final ] [ static ] function '(' parameters ')' '{' code '}'
>
> There is a check that you cannot overwrite a final function of cause
> and i also added a check that you cannot redeclare a function abstract.
> See test files on this.

Please, please, please, please... please! Use the word 'method', not
'function', when referring to class methods. It will help avoid further
confusion. Please.

-Andrei   http://www.gravitonic.com/

"In My Egotistical Opinion, most people's C programs should be indented
six feet downward and covered with dirt." -- Blair P. Houghton



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




Re: [PHP-DEV] RFC: ZE2 and abstract

2002-11-20 Thread Andrei Zmievski
On Wed, 20 Nov 2002, Marcus Börger wrote:
> Added final now: http://marcus-boerger.de/php/ext/ze2
> 
> So we have:
> abstract [static] function '(' parameters ')' ';'
> [ final ] [ static ] function '(' parameters ')' '{' code '}'
> 
> There is a check that you cannot overwrite a final function of cause
> and i also added a check that you cannot redeclare a function abstract.
> See test files on this.

Please, please, please, please... please! Use the word 'method', not
'function', when referring to class methods. It will help avoid further
confusion. Please.

-Andrei   http://www.gravitonic.com/

"In My Egotistical Opinion, most people's C programs should be indented
six feet downward and covered with dirt." -- Blair P. Houghton

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




Re: [PHP-DEV] RFC: ZE2 and abstract

2002-11-20 Thread Marcus Börger
Added final now: http://marcus-boerger.de/php/ext/ze2

So we have:
abstract [static] function '(' parameters ')' ';'
[ final ] [ static ] function '(' parameters ')' '{' code '}'

There is a check that you cannot overwrite a final function of cause
and i also added a check that you cannot redeclare a function abstract.
See test files on this.

marcus


At 16:55 19.11.2002, Marcus Börger wrote:

The link below contain a patch that allows abstract functions in ZE2.
http://marcus-boerger.de/php/ext/ze2

abstract [static] function '(' parameters ')' ';'

it would be possible to make the ';' optional.

When an abstract method is called a fatal error is generated and
execution stops. Another way of handling abstract would be to
generate an E_WARNING or throw an exception. I experimented
with the second one already but do not like it. I favor the first
over the third but haven't tried that yet.

The thinks i did:
introduce T_ABSTRACT = "abstract" and modified the parser.
added is_abstract after is_static in zend_function (and such)
emit an E_ERROR when is_abstract is set in 
zend_init_static_method_call_handler & zend_init_method_call_handler

marcus



--->>> mailto:[EMAIL PROTECTED] <<<--
"We are animals among animals, all children of matter,
save that we are the more disarmed. But since, unlike animals,
we know that we must die, let us prepare for that moment
by enjoying the life that has been given us by chance and for chance."
   Umberto Eco, The island of the day before
->>> http://marcus-boerger.de <<<-


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




Re: [PHP-DEV] RFC: ZE2 and abstract

2002-11-20 Thread Marcus Börger
At 06:32 20.11.2002, Andi Gutmans wrote:

Hi,

I'm a bit behind my Email but I'll give you a quick answer.
I think we can do abstract method's but I wouldn't want to do it the way 
you did because it adds an additional check in the method calling.
It should create a function which will bailout.

Yes that was my first attempt and yes it is a bit complicated (more than 
the rest of the patch)

This might be a bit complicated to do so I'll put it on my TODO.
Andi

At 04:55 PM 11/19/2002 +0100, Marcus Börger wrote:

The link below contain a patch that allows abstract functions in ZE2.
http://marcus-boerger.de/php/ext/ze2

abstract [static] function '(' parameters ')' ';'

it would be possible to make the ';' optional.

When an abstract method is called a fatal error is generated and
execution stops. Another way of handling abstract would be to
generate an E_WARNING or throw an exception. I experimented
with the second one already but do not like it. I favor the first
over the third but haven't tried that yet.

The thinks i did:
introduce T_ABSTRACT = "abstract" and modified the parser.
added is_abstract after is_static in zend_function (and such)
emit an E_ERROR when is_abstract is set in 
zend_init_static_method_call_handler & zend_init_method_call_handler

marcus



--->>> mailto:[EMAIL PROTECTED] <<<--
"We are animals among animals, all children of matter,
save that we are the more disarmed. But since, unlike animals,
we know that we must die, let us prepare for that moment
by enjoying the life that has been given us by chance and for chance."
   Umberto Eco, The island of the day before
->>> http://marcus-boerger.de <<<-




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




Re: [PHP-DEV] RFC: ZE2 and abstract

2002-11-19 Thread Andi Gutmans
Hi,

I'm a bit behind my Email but I'll give you a quick answer.
I think we can do abstract method's but I wouldn't want to do it the way 
you did because it adds an additional check in the method calling.
It should create a function which will bailout.
This might be a bit complicated to do so I'll put it on my TODO.
Andi

At 04:55 PM 11/19/2002 +0100, Marcus Börger wrote:
The link below contain a patch that allows abstract functions in ZE2.
http://marcus-boerger.de/php/ext/ze2

abstract [static] function '(' parameters ')' ';'

it would be possible to make the ';' optional.

When an abstract method is called a fatal error is generated and
execution stops. Another way of handling abstract would be to
generate an E_WARNING or throw an exception. I experimented
with the second one already but do not like it. I favor the first
over the third but haven't tried that yet.

The thinks i did:
introduce T_ABSTRACT = "abstract" and modified the parser.
added is_abstract after is_static in zend_function (and such)
emit an E_ERROR when is_abstract is set in 
zend_init_static_method_call_handler & zend_init_method_call_handler

marcus



--->>> mailto:[EMAIL PROTECTED] <<<--
"We are animals among animals, all children of matter,
save that we are the more disarmed. But since, unlike animals,
we know that we must die, let us prepare for that moment
by enjoying the life that has been given us by chance and for chance."
   Umberto Eco, The island of the day before
->>> http://marcus-boerger.de <<<-


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




[PHP-DEV] RFC: ZE2 and abstract

2002-11-19 Thread Marcus Börger
The link below contain a patch that allows abstract functions in ZE2.
http://marcus-boerger.de/php/ext/ze2

abstract [static] function '(' parameters ')' ';'

it would be possible to make the ';' optional.

When an abstract method is called a fatal error is generated and
execution stops. Another way of handling abstract would be to
generate an E_WARNING or throw an exception. I experimented
with the second one already but do not like it. I favor the first
over the third but haven't tried that yet.

The thinks i did:
introduce T_ABSTRACT = "abstract" and modified the parser.
added is_abstract after is_static in zend_function (and such)
emit an E_ERROR when is_abstract is set in 
zend_init_static_method_call_handler & zend_init_method_call_handler

marcus



--->>> mailto:[EMAIL PROTECTED] <<<--
"We are animals among animals, all children of matter,
save that we are the more disarmed. But since, unlike animals,
we know that we must die, let us prepare for that moment
by enjoying the life that has been given us by chance and for chance."
   Umberto Eco, The island of the day before
->>> http://marcus-boerger.de <<<-