Replace all Module's and Block's with ModuleScope and Scope #460
Labels
refactor
Does not change functionality, but makes the code better organized or more readable
wolfram language
Requires Wolfram Language implementation
The problem
Benefits of using
ModuleScope
andScope
(instead ofModule
andBlock
):Module[{variables...}, ...]
(especially annoying in large functions).However, as @maxitg said:
Examples
You can use
MacroExpand
to see what these functions do:Comment
It is not simply a matter of replacing all
Module
's withModuleScope
's. See:You can use
ScopeVariable
to "cause particular variables to be localized":But it may not be worth replacing them in these cases.
The text was updated successfully, but these errors were encountered: