You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
both fail. They return (Subtract 5 4) and (Minus 5), respectively, instead of (- 5 4) and (- 5). This is something due to the experimental-fn implementation.
Example where this works as expected:
(wl/->clj"Power[2,Rational[-1,2]]")
=> (**2-1/2)
This is, as suggested, most likely due to the fact that - has as alias a fn that maps either to Minus or Subtract and the code does not handle the reverse transformation.
The text was updated successfully, but these errors were encountered:
while you expected to get '(- 5 4) and (- 5) - but we currently do not support reverse alias application and I see no need for it. We could do it (walk the transformed clj data, replace anything that has an alias with the alias)...
holyjak
changed the title
Subtract and Minus are not converted to Clojure properly
Replace symbols with their aliases in ->clj, where available
Sep 13, 2024
holyjak
changed the title
Replace symbols with their aliases in ->clj, where available
Replace symbols with their aliases in ->clj also for -
Sep 14, 2024
I was adding tests to the custom-aliases branch when I noticed:
both fail. They return (Subtract 5 4) and (Minus 5), respectively, instead of (- 5 4) and (- 5). This is something due to the experimental-fn implementation.
Example where this works as expected:
This is, as suggested, most likely due to the fact that
-
has as alias a fn that maps either to Minus or Subtract and the code does not handle the reverse transformation.The text was updated successfully, but these errors were encountered: