-
Notifications
You must be signed in to change notification settings - Fork 34
Open
Labels
Milestone
Description
With the current design, calls have to be nested like this:
map (function (k) package.loaded[k] = nil end,
filter (function (k) return (k == "std") or (k:match "^std%.") end,
package.loaded))Which, aside from being ugly as hell, is not terribly functional. We should be able to write functional code like this:
Map (package.loaded).
filter (lambda 'return (_1 == "std") or (_1:match "^std%.")').
map (lambda 'package.loaded[_1] = nil')Here, Map is an arbitrary constructor to make a new object with functional methods that can be chained -- but these might be usefully integrated into the Object hierarchy relatively close to the root, maybe even to std.object itself.
(yes, I know it's a bad example with side effects, but it still illustrates the point of not being able to get the most out of std.functional when you have to nest or compose everything before you can use it readably)
Reactions are currently unavailable