5 ms·
First, Ruby has no built-in way to accomplish dynamic scoping. Perl is Very Powerful. Second, refinements apply lexically. Consider a class A where refinemen
by gamache 14y ago
First, Ruby has no built-in way to accomplish dynamic scoping. Perl is Very Powerful.
Second, refinements apply lexically. Consider a class A where refinements have been declared, and a class B where they have not. Class A code calls Class B code. Class B code will not see class A's refinements. In the case of dynamic scope, the refinements in use by class A would be visible to class B code, when called from code within class A.
- draegtun 14y agoYes having dynamic scoping gives Perl a very powerful programming instrument. And the lack of dynamic scoping in Ruby can cause problems elsewhere: http://news.ycombinator.com/item?id=5072925 http://news.ycombinator.com/item?id=5072925 PS. I seem fond of dynamic scoping because I've posted lots of examples here on HN: http://www.hnsearch.com/search#request/all&q=draegtun+dynamic+local&start=0 http://www.hnsearch.com/search#request/all&q=draegtun+dy...