Re: [PHP-DEV] nested functions

2001-02-03 Thread Boian Bonev

hi,

> Andrei Zmievski wrote:
> > > i'm not sure about it, is this a usefull feature (although it
> > > behaves very different to, say, PASCAL or gcc with nested
> > > functions enabled where the inner function is 'local' to the
> > > namespace of the outer one) or should the engine prevent
> > > nested function declarations in the first place?
> >
> > How about a simple check:
> >
> > function outer()
> > {
> > if (!function_exists('inner')) {
> > function inner() {
> > }
> > }
> > }
>
> sure, this fixes the symptoms,
> bit if noone can think of a reason or situation where nesting
> functions would make sense i'd like to have this 'feature'
> removed
> it's confusing, unseless IMHO and leaving it possible will
> block any chance to implement it the way Pascal or gcc in
> extended mode handle it with the inner function only
> visible within the scope of the outer one ...

we might have both. now all functions are global and this is ok (if people
knew about it). in the future when scope comes in - a modifier before the
function keyword will solve the problem with scoping and more - everything
will be kept backward compatible.
say that the modifier is local or static or...

b.


-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-DEV] nested functions

2001-02-02 Thread Chris Newbill

Ditto, poor design IMHO.

-Original Message-
From: Marten Gustafsson [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 02, 2001 7:40 AM
To: PHP DEV
Subject: RE: [PHP-DEV] nested functions


Is there a need for nested funcitons? I don?t think so.


-Marten.
Icq# 38863127 



-Original Message-
From: Andrei Zmievski [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 02, 2001 3:22 PM
To: Hartmut Holzgraefe
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP-DEV] nested functions


On Fri, 02 Feb 2001, Hartmut Holzgraefe wrote:
>  
> it is right now possible to declare functions within functions
> (see bug#9064)
> 
> this will lead to redeclaration errors if you call the outer
> function more then once
> 
> i'm not sure about it, is this a usefull feature (although it
> behaves very different to, say, PASCAL or gcc with nested 
> functions enabled where the inner function is 'local' to the
> namespace of the outer one) or should the engine prevent
> nested function declarations in the first place?

How about a simple check:

function outer()
{
if (!function_exists('inner')) {
function inner() {
}
}
}

-Andrei
* Entropy isn't what it used to be. *

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] nested functions

2001-02-02 Thread Hartmut Holzgraefe

Andrei Zmievski wrote:
> > i'm not sure about it, is this a usefull feature (although it
> > behaves very different to, say, PASCAL or gcc with nested
> > functions enabled where the inner function is 'local' to the
> > namespace of the outer one) or should the engine prevent
> > nested function declarations in the first place?
> 
> How about a simple check:
> 
> function outer()
> {
> if (!function_exists('inner')) {
> function inner() {
> }
> }
> }

sure, this fixes the symptoms, 
bit if noone can think of a reason or situation where nesting
functions would make sense i'd like to have this 'feature' 
removed 
it's confusing, unseless IMHO and leaving it possible will
block any chance to implement it the way Pascal or gcc in 
extended mode handle it with the inner function only
visible within the scope of the outer one ...


-- 
Hartmut Holzgraefe  [EMAIL PROTECTED]  http://www.six.de  +49-711-99091-77 

Besuchen Sie uns auf der CeBIT 2001 - in Halle 6 Stand F62/4

-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-DEV] nested functions

2001-02-02 Thread Marten Gustafsson

Is there a need for nested funcitons? I don?t think so.


-Marten.
Icq# 38863127 



-Original Message-
From: Andrei Zmievski [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 02, 2001 3:22 PM
To: Hartmut Holzgraefe
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP-DEV] nested functions


On Fri, 02 Feb 2001, Hartmut Holzgraefe wrote:
>  
> it is right now possible to declare functions within functions
> (see bug#9064)
> 
> this will lead to redeclaration errors if you call the outer
> function more then once
> 
> i'm not sure about it, is this a usefull feature (although it
> behaves very different to, say, PASCAL or gcc with nested 
> functions enabled where the inner function is 'local' to the
> namespace of the outer one) or should the engine prevent
> nested function declarations in the first place?

How about a simple check:

function outer()
{
if (!function_exists('inner')) {
function inner() {
}
}
}

-Andrei
* Entropy isn't what it used to be. *

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] nested functions

2001-02-02 Thread Andrei Zmievski

On Fri, 02 Feb 2001, Hartmut Holzgraefe wrote:
>  
> it is right now possible to declare functions within functions
> (see bug#9064)
> 
> this will lead to redeclaration errors if you call the outer
> function more then once
> 
> i'm not sure about it, is this a usefull feature (although it
> behaves very different to, say, PASCAL or gcc with nested 
> functions enabled where the inner function is 'local' to the
> namespace of the outer one) or should the engine prevent
> nested function declarations in the first place?

How about a simple check:

function outer()
{
if (!function_exists('inner')) {
function inner() {
}
}
}

-Andrei
* Entropy isn't what it used to be. *

-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]