hi tami,
hi tami,
Weißt Du denn, warum Facebook da seinen ganzen Code auf Hack umstellt?
"Collections provide a clean, type-safe alternative to PHP arrays. We designed them specifically to work well with static typing and generics. The Collections API offers many classic higher-order functions such as map() and filter() to facilitate functional programming styles.
Lambda expressions give a concise syntax for creating closures. While PHP has closures, it requires the programmer to explicitly name the variables they need to use from enclosing scopes. With Hack's lambda expressions, we automatically infer these uses, saving you needless work. Lambda expressions make it more convenient to take full advantage of the Collections API."
https://code.facebook.com/posts/264544830379293/hack-a-new-programming-language-for-hhvm/
http://docs.hhvm.com/manual/en/hack.collections.php ...
"Currently, Hack implements the following concrete collection types:
Vector: An ordered, index-based list collection.
ImmVector: An immutable, ordered, index-based list collection.
Map: An ordered dictionary-style collection.
ImmMap: An immutable, ordered dictionary-style collection.
Set: A list-based collection that stores unique values.
ImmSet: An immutable, list-based collection that stores unique values.
Pair: An index-based collection that can hold exactly two elements."
Warum hat das Zend-Framework zB. nicht "sowas"?
filter() und map() sind bei der Map-Klasse ja vorhanden http://docs.hhvm.com/manual/en/class.hack.maptktv.php.
mfg
tami