Aditya Bhargava

Results 104 comments of Aditya Bhargava

I'm not sure I follow, could you show a longer example? Sent from my iPhone > On Mar 10, 2015, at 1:42 PM, Nathan Lilienthal [email protected] wrote: > > It...

That's a limitation of ruby. Maybe you can achieve something similar with inheritance? ``` ruby class Tree end class Node < Tree end class Val < Tree end Contract Tree...

Ah, I see what you're saying now. Yeah, that's a good idea...would just need a new Rec contract and maybe a way to tie a symbol to a type.

From chat by @waterlink: You can generate class out of the `Rec[:X]`, which will have method X and it will be available in the context of block provided to `Rec`...

This is a Ruby issue...you can't use a symbol that isn't defined yet. The following non-contracts code would fail too: ``` ruby class A B.new def foo B.new end end...

From chat: [this](http://www.contractsjs.org/doc/main/contracts.html#parametric-polymorphism) could be a good way to do it. In contracts: ``` ruby Contract Forall(String ...) { Type... => Type ... } ```

`Contract(:a, :b) ArrayOf[a], Func[a => b] => ArrayOf[b]`

Taken from this paper posted by @nixpulvis: http://www.andres-loeh.de/Contract.pdf Often we want to relate the argument to the result, expressing, for instance, that the result is greater than the argument. To...

Not really, and I don't see anything in the issues list either...