scicloj / wolframite

An interface between Clojure and Wolfram Language (the language of Mathematica)
Eclipse Public License 2.0
46 stars 2 forks source link

Broken: `(WL @(a b c d))` #21

Closed holyjak closed 4 days ago

holyjak commented 7 months ago

See https://github.com/scicloj/wolframite/pull/14#discussion_r1403363309

Note: From the code of the convert fn it seems that we are converting such expression "from prefix form" (the opposite of meta 🤷 which converts "from postfix form"). So @(a b c) becomes a[b[c]] and '(clojure.core/meta (a b c)) becomes c[b[a]].

As commented below,

Coming from clojure-land, it just seems like unnecessary extra syntax.

so may be not worth fixing.

holyjak commented 5 months ago

Closing, no idea what that code was supposed to do.

qazwsxpawel commented 5 months ago

I think @ in WL is some kind of function composition or application operator, but I’m not sure

--------------------- Pawel Ceranka Nette: Research OS for the Web https://www.nette.io/ London, UK

On Sun, Jan 28 2024 at 12:12 am, Jakub Holý @.***> wrote:

Closing, no idea what that code was supposed to do.

— Reply to this email directly, view it on GitHub https://github.com/scicloj/wolframite/issues/21#issuecomment-1913380142, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAKYF5TXNLJWWMYXDZP7NHTYQWJYTAVCNFSM6AAAAABAINOLZKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMJTGM4DAMJUGI . You are receiving this because you are subscribed to this thread.Message ID: @.***>

holyjak commented 4 months ago

@light-matters do you have some insight into this, pls?

light-matters commented 4 months ago

Usually functions are called using "f[x]" notation but it's possible to call them using "f@x". The main use of this is for function composition (https://reference.wolfram.com/language/ref/Composition.html), so I'm guessing that the intention was to replace a@b@c@d .

Crazily, I used to use it simply because mathematica didn't have an easy way of inserting brackets!

Coming from clojure-land, it just seems like unnecessary extra syntax.

holyjak commented 4 months ago

Are you saying that Clojure devs can do whatever they need without @ because they can simply do (f (g (h ...)))? Or could there be a case where they would need the function composition for some reason?

holyjak commented 4 days ago

Closing - as discussed, it may not be useful enough to be worth supporting. Will reopen if users actually need this.