Re: [PHP-DEV] Generics proposal

2012-11-15 Thread Jan Dolecek
Hi Sara, any progress with your RFC? Can't wait to see it. Thanks Jan Dolecek juzna...@gmail.com On Wed, Nov 7, 2012 at 6:41 AM, Sara Golemon poll...@php.net wrote: Retrying this with reply-to-all. :) I think it's an awesome moment for PHP and HipHop to work together! :) I'll summarize

Re: [PHP-DEV] Generics proposal

2012-11-07 Thread Lars Strojny
Cool! Looking forward to it. Am 07.11.2012 um 06:41 schrieb Sara Golemon poll...@php.net: Retrying this with reply-to-all. :) I think it's an awesome moment for PHP and HipHop to work together! :) I'll summarize what we have so far into an RFC. -Sara On Tue, Nov 6, 2012 at 12:50 PM,

Re: [PHP-DEV] Generics proposal

2012-11-06 Thread Lars Strojny
Hey Sara, can you already show us how your take on Generics would look like? Maybe this is a good moment for HipHop and PHP to do something together. Am 06.11.2012 um 04:14 schrieb Sara Golemon poll...@php.net: Sorry to be late to the conversation, but fwiw, HipHop is adding Generics (and

Re: [PHP-DEV] Generics proposal

2012-11-06 Thread Sara Golemon
Retrying this with reply-to-all. :) I think it's an awesome moment for PHP and HipHop to work together! :) I'll summarize what we have so far into an RFC. -Sara On Tue, Nov 6, 2012 at 12:50 PM, Lars Strojny l...@strojny.net wrote: Hey Sara, can you already show us how your take on Generics

Re: [PHP-DEV] Generics proposal

2012-11-05 Thread Sara Golemon
Sorry to be late to the conversation, but fwiw, HipHop is adding Generics (and some other cool things) to our PHP implementation. We plan to provide a PHP equivalent implementation in the form of a pre-processor extension which can live in PECL. The implementation would of course be cleaner if

Re: [PHP-DEV] Generics proposal

2012-10-23 Thread Etienne Kneuss
Hi, On Tue, Oct 23, 2012 at 4:17 AM, Levi Morrison morrison.l...@gmail.com wrote: Especially if the ability was afforded to arrays as well (function foo(arrayBar $array){})... This would require O(n) runtime tests, I would definitely not go there. Actually, it does not require O(n) runtime

Re: [PHP-DEV] Generics proposal

2012-10-22 Thread Amaury Bouchard
Nobody wants to turn PHP into Java. But, even if I agree for generics (or templates), I would like to know where is the border line. Classes, exceptions, interfaces, traits, type hinting in parameters = OK Type hinting in object properties, type hinting of returned values, type templating = KO?

Re: [PHP-DEV] Generics proposal

2012-10-22 Thread jpauli
On Sat, Oct 20, 2012 at 10:59 PM, Nikita inefe...@gmail.com wrote: Hello, list. I want to propose generics. For those, who don't know what it is, here's example: say we have a Comment class, that has a method getBody. Also we have Collection class, that implements Traversable. Now, if I want

Re: [PHP-DEV] Generics proposal

2012-10-22 Thread Anthony Ferrara
Stas, On Sun, Oct 21, 2012 at 12:51 PM, Stas Malyshev smalys...@sugarcrm.comwrote: Hi! Hello, list. I want to propose generics. Please no. If you need Java, you know where to find it. Java has a set of great tools, great books, great community. And it's completely free. Anybody who needs

Re: [PHP-DEV] Generics proposal

2012-10-22 Thread Etienne Kneuss
Hi, On Mon, Oct 22, 2012 at 9:44 PM, Anthony Ferrara ircmax...@gmail.com wrote: Stas, On Sun, Oct 21, 2012 at 12:51 PM, Stas Malyshev smalys...@sugarcrm.comwrote: Hi! Hello, list. I want to propose generics. Please no. If you need Java, you know where to find it. Java has a set of

Re: [PHP-DEV] Generics proposal

2012-10-22 Thread Christian Schneider
Am 22.10.2012 um 21:44 schrieb Anthony Ferrara ircmax...@gmail.com: This is not about turning PHP into Java. Can we get over that old rhetoric already? Instead of bashing proposals like this, can we discuss them, instead of this hatred for all things strict? With that aside, I have mixed

Re: [PHP-DEV] Generics proposal

2012-10-22 Thread Johannes Schlüter
On Tue, 2012-10-23 at 00:57 +0200, Christian Schneider wrote: Basically it means that you type more (redundant) stuff to allow the compiler to check some errors. Which we can't do due to PHP's dynamic nature. For the engine to take benefit from it we'd have to change the language. All we

Re: [PHP-DEV] Generics proposal

2012-10-22 Thread Levi Morrison
Especially if the ability was afforded to arrays as well (function foo(arrayBar $array){})... This would require O(n) runtime tests, I would definitely not go there. Actually, it does not require O(n) runtime tests. The solution is simple: store the type when it is created. Whenever an

Re: [PHP-DEV] Generics proposal

2012-10-21 Thread Paul Dragoonis
Hi Nikita, What you're asking for is useful in other languages, but it doesn't match the style of PHP which is to be a quick and easy type-less scripting language. What you're proposing is clearly more suited to something like Java or C#, but doesn't really belong here. I'd also hate to see

Re: [PHP-DEV] Generics proposal

2012-10-21 Thread Nikita Nefedov
No, this is useful in any OOP-language where there is such thing as type, and people need to validate types. I unerstand what you are saying about PHP being an easy language, but in opinion if you don't want to use that feature you can not use it, as you can not use typehinting in functions

Re: [PHP-DEV] Generics proposal

2012-10-21 Thread Alexey Zakhlestin
On 21.10.2012, at 0:59, Nikita inefe...@gmail.com wrote: Hello, list. I want to propose generics. skip So, what you think? I'm against having this in PHP. For IDEs, the better solution is to use generics-like syntax in docblocks. -- PHP Internals - PHP Runtime Development Mailing List To

Re: [PHP-DEV] Generics proposal

2012-10-21 Thread Christian Schneider
Am 21.10.2012 um 13:33 schrieb Nikita Nefedov inefe...@gmail.com: No, this is useful in any OOP-language where there is such thing as type, and people need to validate types. I question the need to validate types part. I'd say you're better off using a completely different language if you

Re: [PHP-DEV] Generics proposal

2012-10-21 Thread Devis Lucato
I see what you are trying to achieve, but I hope this will never make into PHP mainly for impact on readability. I'd like to quote Eric Armstrong, a passionate Java/Ruby dev: I decry their very existence. They are the ultimate condemnation of static type checking--because their very addition

Re: [PHP-DEV] Generics proposal

2012-10-21 Thread Nikita Nefedov
I actually don't have much experience with generics, so won't argue about their readability, but this article is all about Java's implementation of generics, so I don't know how much sense this article gives in that context. But it's ok, I see just one person that supported proposal. I think

Re: [PHP-DEV] Generics proposal

2012-10-21 Thread Lars Strojny
Hi Rasmus, Am 20.10.2012 um 23:02 schrieb Rasmus Lerdorf ras...@lerdorf.com: [...] Personally I would hate to see this anywhere near PHP. Do you mind explaining the why? Isn’t it better than new Collection(TypeAsAString) and custom assertions in each and every method of that collection class?

Re: [PHP-DEV] Generics proposal

2012-10-21 Thread Stas Malyshev
Hi! Hello, list. I want to propose generics. Please no. If you need Java, you know where to find it. Java has a set of great tools, great books, great community. And it's completely free. Anybody who needs Java can just do it. I see no need to turn PHP into Java. -- Stanislav Malyshev,

[PHP-DEV] Generics proposal

2012-10-20 Thread Nikita
Hello, list. I want to propose generics. For those, who don't know what it is, here's example: say we have a Comment class, that has a method getBody. Also we have Collection class, that implements Traversable. Now, if I want to validate all insertions into collection of comments, I would need

Re: [PHP-DEV] Generics proposal

2012-10-20 Thread Rasmus Lerdorf
On 10/20/2012 01:59 PM, Nikita wrote: Hello, list. I want to propose generics. For those, who don't know what it is, here's example: say we have a Comment class, that has a method getBody. Also we have Collection class, that implements Traversable. Now, if I want to validate all insertions

Re: [PHP-DEV] Generics proposal

2012-10-20 Thread Michael Stowe
I see what you're trying to do but not a big fan of how it's being implemented in the example given. - Mike Sent from my iPhone On Oct 20, 2012, at 4:02 PM, Rasmus Lerdorf ras...@lerdorf.com wrote: On 10/20/2012 01:59 PM, Nikita wrote: Hello, list. I want to propose generics. For those,

Re: [PHP-DEV] Generics proposal

2012-10-20 Thread Marco Pivetta
On 20 October 2012 23:09, Michael Stowe mikegst...@gmail.com wrote: I see what you're trying to do but not a big fan of how it's being implemented in the example given. - Mike Sent from my iPhone On Oct 20, 2012, at 4:02 PM, Rasmus Lerdorf ras...@lerdorf.com wrote: On 10/20/2012 01:59