3 ms·
Perl6 doesn't do this. A function doesn't know if it's being called in scalar or list context. (I think there might be some movement towards letting a function
by philh 11y ago
Perl6 doesn't do this. A function doesn't know if it's being called in scalar or list context.
(I think there might be some movement towards letting a function detect sink (void) context. Then functions with both side effects and return values don't need to calculate the return values when they aren't needed.)