I am writing a function that constructs a rule which has Unique[]
in the RHS. Here is a simplified segment of code
$userInt = 3;
With[{x = Table[Unique[], {i, 1, 3}]},
rules = {patt :> x}
]
Here, rules
should be look like a list of Unique[]
, as in
patt :> {Unique[], Unique[], ...}
But the problem is that Unique[]
is already evaluated by the With
:
rules
(* {patt :> {$48, $48, $48}} *)
How can I generate a list of Unique[]
that is not evaluated, but evaluated when it is time to pattern match?
Table
iterator should be$userInt
, not harded-coded3
. $\endgroup$