----- Original Message -----
From: "Stanislav Malyshev" <[EMAIL PROTECTED]>
To: "Daniel Beckham" <[EMAIL PROTECTED]>
Cc: "Brian Moon" <[EMAIL PROTECTED]>; "PHP Development"
<[EMAIL PROTECTED]>
Sent: Friday, October 19, 2001 2:45 AM
Subject: Re: [PHP-DEV] New zend_compile.c to solve all of the duplicate
function problems


> A lot of languages don't have ifdefs (actually, most of them). A lot of
> languages do not allow to redefine functions. Still each of these
> languages allows to create code libraries. Obviously, your implied
> argument that this is needed to implement libraries is wrong.

My argument is that some functionality similar to a C #ifdef and #ifndef is
needed.  Neither the include_once() nor the if/endif solutions provide that.
If you want to do that Perl style with packages or C style with macros or
whatever style, it's fine with me.  My issue is that there is no PHP way to
do this other than include_once() or an if/endif statement.

> Actually, even now it can be done properly, given:
> 1. Reusable code (variables) and definition code (function) reside in
> different files, just like you would do it in C
> 2. include and include_once is used properly

I already pointed out why include_once() is bad.  You place the
responsiblity of knowing the inner workings of function libraries on the
user themselves and not the library.  This is poor programming.


> It would be much better if PHP could have a concept of a library package,
> which would solve a lot of "did I already have this package, and if not,
> how I import it properly?" questions. Making quick hacks to bend the
> language into compliance with some hacky way to solve the problem won't do
> any good in the long run, only bring more problems.

I agree with you totally.  But, if you truly believe that it needs to be
more than a hacky solution, then drop this include_once() nonsense and let's
think of a better way to do this.   Unless of course, I'm mistaken and you
are more worried about doing something hacky in the PHP source and don't
care if the PHP developers themselves have to write hacky code?

Daniel




-- 
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]

Reply via email to