496 shaares
ClearAll[LetL];
SetAttributes[LetL, HoldAll];
SyntaxInformation[LetL] = {
"ArgumentsPattern" -> {, },
"LocalVariables" -> {"Solve", {1, Infinity}}
};
LetL /: (assign : SetDelayed | RuleDelayed)[
lhs_,rhs : HoldPattern[LetL[{_}, ]]
] :=
Block[{With},
Attributes[With] = {HoldAll};
assign[lhs, Evaluate[rhs]]
];
LetL[{}, expr] := expr;
LetL[{head}, expr] := With[{head}, expr];
LetL[{head, tail_}, expr] :=
Block[{With}, Attributes[With] = {HoldAll};
With[{head}, Evaluate[LetL[{tail}, expr]]]];