-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pretty #28
pretty #28
Conversation
nice, maybe smt can be done about the duplication in pretty and dump |
You mean like this? https://gist.github.com/turanct/ff3ef81861b8c8acf3b5 |
Yeah, except that we lack the possibility to make private functions. For — On 4 March 2015 at 10:55, turanct [email protected] wrote:
|
In some functional programming languages, you have to explicitly "export" functions from within a namespace/module... i find it elegant & clear, but i suppose it will be difficult to accomplish in php? |
I think it's possible. return module(@MyModule, [@somedependency], function($somedependency) { The module function registers the exported functions somehow. It also finds A theoretically working example: // foo.php // bar.php We might even do the thing that node does, where each module has it's own — On 4 March 2015 at 14:24, turanct [email protected] wrote:
|
@mathiasverraes Please don't use my handle for your amusement :p |
@mathiasverraes maybe more like this return module(@foo, [@list->map], function($map) {
$halves = $map(divide(__,2), __);
return export([@halves=>$halves]);
}); where you only import the map function from the lists module |
@turanct looks great! I suppose you mean You can alias functions too: |
@mathiasverraes you mean this guys? https://github.com/foo |
@mathiasverraes yes, that was a typo 🐐 |
actually, there's a problem if you want to get two functions out of the same module that way...
|
|
👍 can we create an issue for the module system? PR has been hijacked by this overly superb module system 🚀 |
No need to ask. This project prefers action over consensus! — On 4 March 2015 at 20:30, turanct [email protected] wrote:
|
Use
pretty()
instead ofshow()