Alex Fedorov

Results 152 comments of Alex Fedorov

About `{{ .. }}` vs `{[ .. ]}`: I was thinking about something a bit more verbose, but less problems: ``` ruby Contract { self[num, maybe[num] => String] } #...

@sfcgeorge :+1: for `register_contracts`, but I would: 1. rename it to `register_contracts_shortcut` - it reveals intent better 2. don't pollute user class with this method, ie: ``` ruby class Greeting...

Yes, it obviously could, because `include` is just usual ruby method defined on all modules/classes, that you can just send to: ``` ruby def alias(target, name) define_shortcut(target, name) target.send(:include, Contracts::Core)...

But in that case, `alias` method would be strange.. How about: ``` ruby class Greeter Contracts.activate self, core: true, alias: :c end ``` ?

But this makes it kinda unusual and not that simple. And people probably still would want to use normal `include Contracts` (+ `::Core`) better than that.

@robnormal That is exactly what we want to do. Actually, overload `Contract` constructor. What we are trying to discuss here additionally - is a way to provide optional shortcut feature....

Actually, I don't see any problems to implement this without shortcut functionality and add shortcut functionality later (think: agile, mvp, etc). Rough plan: 1. 1st PR: Introduce `include Contracts::Core`, add...

The problem with `include Contracts` is that it will include the whole namespace unless you re-define `append_features`. But if you do so, and for example include contracts in a module,...

Usually when I use `contracts.ruby` I do `include Contracts` only at the target classes where I actually need it (instead of some namespace or even global namespace). This way you...