Why can't I use this
Where[{iw, ih} = ImageDimensions[i], ...]
instead of this
Where[dim = ImageDimensions[i], iw = dim[[1]], ih = dim[[2]], ...]
Why can't I use this
Where[{iw, ih} = ImageDimensions[i], ...]
instead of this
Where[dim = ImageDimensions[i], iw = dim[[1]], ih = dim[[2]], ...]
Presumably you are referring to Where
from the "GeneralUtilities
"` package.
You can see the definition for yourself:
Attributes[Where] = {HoldAll}
Where[expr_] := expr
Where[x_List, expr_] := With[x, expr]
Where[x_, expr_] := With[{x}, expr]
Where[x_, rest__, expr_] := Where[x, Where[rest, expr]]
Where[s : Verbatim[Set][x_List, y_], rest___, expr_] :=
With[{x2 = Quiet[Replace[Hold[x], z_Symbol :> z_, {2}]]},
Replace[y, {HoldPattern @@ x2 :> Where[rest, expr], _ -> $Failed}]]
If it is not written as you would like use this for inspiration and write your own. :-)