Alex Fedorov

Results 152 comments of Alex Fedorov

@egonSchiele We can totally do that, I don't mind `contract` at all. It is not so pretty, but what can you do about it :)

If you examine the a rough callstack of `Sub.new(11)` call: ``` markdown - `main` - `Contract String => Any - validator` - `Sub.initialize` - `super` - `Contract Num => Any...

Another thing is to try making some helper, like `contracts_super` for usage instead of `super`. But that will change your code too much (you will have to provide all arguments...

Can you provide minimal example (push out small example class to repo or gist) with list of actions of how to reproduce the problem?

Just like that (normal OO way): ``` ruby class Underaged include Contracts::Core Contract Drink => String def sell(drink) "Sorry, come back in #{18 - person.age} years." end end class Person...

Unfortunately, this is not a valid ruby. To make it valid we will have to send some message after calling `Contract(x)`: ``` ruby Contract(Underaged).with Drink => String ```

Another example would be to return a lambda and call it: ``` ruby Contract(Underaged).(Drink => String) # or Contract(Underaged)[Drink => String] # or Contract[Underaged].(Drink => String) # or Contract[Underaged][Drink =>...

Some interesting syntax still can be used: ``` ruby Contract[Underaged].>> Drink => String ```

Last one resembles Haskell-like version the most.