Why would anyone code in #R ?
Conversation
Notices
-
Ekaitz Zárraga 👹 (ekaitz_zarraga@mastodon.social)'s status on Wednesday, 06-Mar-2019 10:22:49 CET Ekaitz Zárraga 👹 -
Ekaitz Zárraga 👹 (ekaitz_zarraga@mastodon.social)'s status on Wednesday, 06-Mar-2019 10:37:55 CET Ekaitz Zárraga 👹 I mean "<-"
WHAT THE FUCK IS THIS?
Go home R, you are drunk.
-
alan@mastodon.technology's status on Wednesday, 06-Mar-2019 11:52:12 CET alan @ekaitz_zarraga <- is used to distinguish name assignment from keyword arguments assignment in function calls. f(k = 1, z = y <- 3) will work as expected with the z argument having y as value that will be resolved to 3.
There are historical reasons for this and one of them is that R is lispy enough to have similar quirks. The issue is that most R users are not trained to code in a functional way, but you can do pretty powerful stuff with it.
With RStudio alt + - gives you <-
Ekaitz Zárraga 👹 and Ekaitz Zárraga 👹 repeated this. -
Ekaitz Zárraga 👹 (ekaitz_zarraga@mastodon.social)'s status on Wednesday, 06-Mar-2019 11:54:50 CET Ekaitz Zárraga 👹 @alan Thanks for the explanation. It's really cool.
It's quite a weird syntax isn't it?
I'm now very critic with all this because I discovered lisp and everything is worse.
Yes, the most logical syntax I know is lisp's. I'm that kind of person.
-