3 ms·
In the `logNow` example, the date argument will be eager evaluated, not lazzy evaluated. Am I right? So what was supposed to be a real use case doesn't seem use
by mjbrusso 5y ago
In the `logNow` example, the date argument will be eager evaluated, not lazzy evaluated. Am I right? So what was supposed to be a real use case doesn't seem useful to me.
- fendy3002 5y agoNice catch. Rather than date the author should've pass the DEBUG constant instead. Or a function that return new date, but it'll make things complicated.
- mjbrusso 5y agoHowever , to pass a constant I could use default parameter value.
- fendy3002 5y agoIt's the function definition that's responsible for defining default parameter. It's the function caller that's responsible for that parameter with partial application / currying / closure. It doesn't matter if you develop both, but if you use a library you'll need partial application to define default parameter.