Skip to content
Prev 389132 / 398506 Next

Evaluating lazily 'f<-' ?

Hello Andrew,


this could work. I will think about it.


But I was thinking more generically. Suppose we have a series of functions:
padding(), border(), some_other_style();
Each of these functions has the parameter "right" (or the group of 
parameters c("right", ...)).


Then I could design a function right(FUN) that assigns the value to this 
parameter and evaluates the function FUN().


There are a few ways to do this:

1.) Other parameters as ...
right(FUN, value, ...) = value; and then pass "..." to FUN.
right(value, FUN, ...) = value; # or is this the syntax? (TODO: explore)

2.) Another way:
right(FUN(...other parameters already specified...)) = value;
I wanted to explore this 2nd option: but avoid evaluating FUN, unless 
the parameter "right" is injected into the call.

3.) Option 3:
The option you mentioned.


Independent of the method: there are still weird/unexplained behaviours 
when I try the initial code (see the latest mail with the improved code).


Sincerely,


Leonard
On 9/13/2021 6:45 PM, Andrew Simmons wrote: