Open dhh1128 opened 9 years ago
VB used to have a "with" statement (not to be confused with python's "with" statement) that made it unnecessary to repeatedly type the same object deref/scope walking text. Consider the following exceedingly redundant code:
pSettings->bIgnoreDirectoryForLinks = a; pSettings->bIncludeSelectionLists = b; pSettings->iMinCJKnGramLength = c; pSettings->iMaxCJKnGramLength = d; pSettings->bUsePrefixForMeta = e; pSettings->bUsePrefixForTitle = f; pSettings->bUsePrefixForLinks = g; pSettings->bUsePrefixForForm = h; pSettings->bUsePrefixForAlt = i; pSettings->bUsePrefixForLinkText = j;
Wouldn't it be better to do something like this:
with pSettings: bIgnoreDirectoryForLinks = a; bIncludeSelectionLists = b; iMinCJKnGramLength = c; iMaxCJKnGramLength = d; bUsePrefixForMeta = e; bUsePrefixForTitle = f; bUsePrefixForLinks = g; bUsePrefixForForm = h; bUsePrefixForAlt = i; bUsePrefixForLinkText = j;
We'd have to deal with the semantics being different from python's "with" statement. An alternative keyword might be "inside" or "in scope of".
VB used to have a "with" statement (not to be confused with python's "with" statement) that made it unnecessary to repeatedly type the same object deref/scope walking text. Consider the following exceedingly redundant code:
Wouldn't it be better to do something like this:
We'd have to deal with the semantics being different from python's "with" statement. An alternative keyword might be "inside" or "in scope of".