3 ms·
Nikita proposes methods on primitive types: http://nikic.github.io/2014/03/14/Methods-on-primitive-types-in-PHP.html http://nikic.github.io/2014/03/14/Methods-o
by TazeTSchnitzel 12y ago
Nikita proposes methods on primitive types: http://nikic.github.io/2014/03/14/Methods-on-primitive-types-in-PHP.html http://nikic.github.io/2014/03/14/Methods-on-primitive-types...
Myself, I like this proposal.
- agumonkey 12y agoSoon all dynamic languages will be one. Except for the method call syntax.
- Shorel 12y agoActually, that's Uniform Function Call Syntax http://www.drdobbs.com/cpp/uniform-function-call-syntax/232700394 http://www.drdobbs.com/cpp/uniform-function-call-syntax/2327... And it doesn't make a language 'dynamic'. The language I found with UFCS is both static and compiled.
- agumonkey 12y agoThat's not what I meant. PHP code was built around its SPL, if they accept nikic proposal, people will code using base types with similar operations set found in many dynamic languages. What's left is [1,2,3]->slice(1,2) versus [1,2,3].slice(1,2) ps: dynamic can be compiled and compiled can be interpreted, so I understand that it is unrelated.
- recursive 12y agoWalter notes two advantages of that scheme over extension methods. One of them is that extension methods can not be called with the standard prefix notation. This is not actually true, at least in the languages most known for extension methods, Visual Basic and C#.
- kenshaw 12y agoYou mean all dynamic languages are Lisp?
- agumonkey 12y agoHaving read Lisp in small pieces I can't hide that it was on my mind. But without parens smugness, right now php, python, es6 are getting closer and closer.
- wisty 12y agoSee https://github.com/devyn/unholy https://github.com/devyn/unholy (Ruby to Python bytecode, then Python bytecode to Python source). Used to run Ruby on Google App Engine, I think.
- dragonwriter 12y agoThe usual way to run Ruby on GAE is just to use JRuby on the App Engine Java runtime. Unholy has been dead for years, and from the commit messages seems to have never gotten to more than very basic functionality; I doubt very much that you could run meaningful code with it, on GAE or otherwise.
- korzun 12y agoI like it too, it's clean. But reality is that PHP will have to be backwards compatible. Which means you will see old function based implementations and new object based implementations. Image dealing with both implementations within the same code base? Eek.
- gmjosack 12y agoThis was how a lot of perl5 was when I used it in the early 2000s.