Post B4oZt6SrpyizseQnnk by civodul@toot.aquilenet.fr
(DIR) More posts by civodul@toot.aquilenet.fr
(DIR) Post #B4nCW2PqETQuYj5YfY by zwol@masto.hackers.town
0 likes, 0 repeats
more high level languages should adopt R's Algolesque call-by-unevaluated-expression semantics send toot
(DIR) Post #B4nCW2e1Nkm9Ghislt by civodul@toot.aquilenet.fr
0 likes, 0 repeats
@zwol That could be fun!(I was “amazed” when I saw that ggplot2 would use the variable name as the default caption!)
(DIR) Post #B4oZt6FkckEVDyIKMC by zwol@masto.hackers.town
0 likes, 0 repeats
@civodul It's one of those features that seems weird and uncomfy when you first notice it but makes more and more sense as you go on.Lispers might like to think about how it effectively erases the difference between a function and a macro.
(DIR) Post #B4oZt6SrpyizseQnnk by civodul@toot.aquilenet.fr
0 likes, 0 repeats
@zwol I still view it as a serious defect from a programming language design viewpoint. I’m no authority on the matter but the fact that variable *names* influence the computation being carried out, and thus break referential transparency, is terrible.As a Schemer, I would find other ways to achieve the level of convenience that this “feature” brings to ggplot2, for instance.
(DIR) Post #B4p1iYhzHhH70aGQdc by zwol@masto.hackers.town
0 likes, 0 repeats
@civodul I don't want to defend R's semantics specifically -- I only understand them at a "regular user of various things that rely on this" level -- but I really don't see it as any different from how Lisp macros have access to the exact names of all the symbols within their arguments. Do you see it as different? If so, how?
(DIR) Post #B4p1iZ7rjTyWIqN5yS by civodul@toot.aquilenet.fr
0 likes, 0 repeats
@zwol What a Scheme macro can see is an identifier and in that sense, yes, one could implement a ‘ggplot2’ macro that could do a similar trick (under some assumptions).But it’s very different from R, where the ggplot2 trick relies on a run-time introspection feature.One cannot in Scheme answer questions like “is my argument a variable?” (whatever that means) or “what’s the name of the variable passed as an argument?”.