3 ms·
In languages without infix function calls, that should be possible, but I'm not sure how readable it would be. var initial factory = abstract configuration
by xmcqdpt2 2y ago
In languages without infix function calls, that should be possible, but I'm not sure how readable it would be.
var initial factory = abstract configuration factory factory. configure new factory()
- ivan_gammel 2y agovar search result = users. find all by name (name); if (search result. is present()) { return ok(search result. get()); } else return not found(); It’s weird and syntax highlighting is absolutely necessary to read this.
- ReleaseCandidat 2y agoUsing something else than a dot is better, same as using a slightly different syntax: search result := users @ find all by name (name) if search result @ is present() { return ok(search result @ get()) } else { return not found() }
- navane 2y agoI still think the space adds more readability than the dot dectracts. If you don't like the dot though, I would use a comma. We have been writing for a couple centuries now, and the comma is well known and used. search result := users, find all by name (name) if search result, is present() { return ok(search result, get()) } else { return not found() }
- ReleaseCandidat 2y agoI have to confess I rather like that comma!
- navane 2y agoThen we could use . instead of ; for line endings, and we're almost writing prose :)
- ivan_gammel 2y agoFew more improvements: // comma is optional, used for disambiguation search result := users, find all by name. // omitted parameters match words if search result is present, // empty brackets can be omitted return ok(search result value); // API change for better readability else return: not found. // colon is another optional delimiter I actually like it so much, I would try to write a transpiler to Java…