GeneralUtilities #402
Labels
help wanted
Extra attention is needed
refactor
Does not change functionality, but makes the code better organized or more readable
wolfram language
Requires Wolfram Language implementation
The problem
The build-in
GeneralUtilities
package seems to have a lot of useful functionality, and we don't currently use it in SetReplace. If we can be reasonably sure that it's not going to break in the future Wolfram Language version, we should start using it.GeneralUtilities
dependency.Examples
Some examples where it can be useful (feel free to add more):
Scope
(andModuleScope
)Scope
allows one to have local variables (likeBlock
orModule
). However, it detects them automatically (at definition time), so that they don't have to be manually tracked. This will reduce potential mistakes due to the mismatch of lists ofModule
variables, and will make the code simpler. This will eliminate the need for a linter to do that.Module
s in the WL code withScope
orModuleScope
. (Replace all Module's and Block's with ModuleScope and Scope #460)KeyAddTo
(andKeyUnionTo
,KeyPrependTo
,KeyAppendTo
,KeyJoinTo
)KeyAddTo
assumes a default value of 0 for non-existing keys, and will also return the new value.It is useful, for example, in
deleteFromVertexIndex
insetSubstitutionSystem$wl.m
, where theScan
function can simply be replaced withKeyAddTo
where relevant.SetUsage
SetUsage
has significantly more features thanusageString
, see? SetUsage
.SetUsage
, and get rid ofusageString
entirely. Replace usageString with SetUsage from GeneralUtilities #532The text was updated successfully, but these errors were encountered: