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
Another one from me — I'm adding these because I think this library is superb and I'm exploring how far it can go — I realize the past few issues have been corner cases.
s ="dbaf fag bdfgea ecbgfa dgbfe fa edacg agcfdbe cefdbg fdgea | fgbaed cdegbf dacfbge gdcfbeabc acefbd gacedbf gbcde dgabf ca fgcedb cega dgbca cgeadb | ca bcged abgfd bca"functioninner(x)
(x ->split(x, "|"))(x)
end
input =@chain s begin
strip
split("\n")
@. inner
end
But if we replace inner with the function, it fails:
input =@chain s begin
strip
split("\n")
@. (x ->split(x, "|")) # (or with (_) at the end)end# You can only use the @. macro and automatic first argument insertion if what follows is of the form `[Module.SubModule.]func`
My understanding from the docs is that that should be syntactic sugar for this, which also works:
input =@chain s begin
strip
split("\n")
(x ->split(x, "|")).(_)
end
The text was updated successfully, but these errors were encountered:
You could just do split.("|")? I'm not sure if adding the overhead for recognizing anonymous functions makes so much sense given all the other options to write this.
For sure in this specific case there's no need, and I agree it's not important. It can be useful on the margin when debugging, or copying code from elsewhere. I was mostly surprised it wasn't consistent, rather than really needing it.
It's a corner case, and very reasonable to deprioritize. Thanks.
Another one from me — I'm adding these because I think this library is superb and I'm exploring how far it can go — I realize the past few issues have been corner cases.
Building on #42, this works:
But if we replace
inner
with the function, it fails:My understanding from the docs is that that should be syntactic sugar for this, which also works:
The text was updated successfully, but these errors were encountered: