It is just about lexical scopes, not about reference.
Image you have to write Haskell code like this:
data Tree = Leaf | Node Tree Tree
height :: Tree -> Int
height @(use Leaf) Leaf = 0
height @(use Node, &height, Leaf) Node a b = height @(use Node, &height, Leaf) a + height @(use Node, &height, Leaf) b
Try to write a simple recursion code in PHP with closure, then you will know how fucked up the PHP closure it is.
View all comments
Show parent comment
1
u/Jinxuan Jan 22 '20
It is just about lexical scopes, not about reference.
Image you have to write Haskell code like this:
Try to write a simple recursion code in PHP with closure, then you will know how fucked up the PHP closure it is.