Closed light-matters closed 3 days ago
Another example that came up (with no obvious solution):
(-> '(<-> (Cos x)
(..> (Cos (_))
(* (+ 1
(* -1
(**2 t)))
(**-1 (+ 1
(**2 t))))))
'(ReplaceAll (Rule t 5))
eval)
This fails with 'Wrong number of args (2) passed to quote', whereas
(eval '(ReplaceAll (<-> (Cos x)
(..> (Cos (_))
(* (+ 1
(* -1
(**2 t)))
(**-1 (+ 1
(**2 t))))))
(Rule t 5)))
returns -12/13, as expected.
Getting the threading macro to work as expected is important as being able to chain expressions is a really nice feature with respect to Wolfram.
This may be a duplicate of #45.
Only the third way works of the three. This is because quoting while using the loaded symbols doesn't work. Might be better to use a standard macro for templating expressions.