Francis George

Results 99 comments of Francis George

It seems we're coming up with the same kind of syntax suggestions for 3 problems, this one plus: Namespacing: https://github.com/egonSchiele/contracts.ruby/issues/157#issuecomment-111726998 ``` ruby Contract {[ num, maybe[num] => String ]} ```...

I keep forgetting about invariants but it just occurred to me that they use a block syntax already, so my vote is on the bracebox syntax for any fancy functional...

The idea is kinda nice, isolating namespace, being able to have a contract with the same name as the class you're validating, etc. I don't like using a string at...

Yeah I can't see any way of making a Block without curly brackets. So then either a hash or array inside that. ``` ruby Contract { [A, B => C]...

No strings please, there are several other similar libraries that use parsed strings so there's no point stepping on their toes. There's currently choice which is good, Contracts using native...

I've seen something that crazy with changing the binding of a proc but it only works for variables and methods—not constants—because you can't really change the binding, only the value...

The problem with using a symbol to look up constants is that then you can't use a symbol as a contract, and it's useful being able to use any Ruby...

@alem0lars Yep speed problem is almost entirely in `call_with` which we've rewritten a few times and it's tough to make any faster. It's actually calling the method that is slow,...

It sounds like we're agreed that all contracts should be defined under the `Contracts` module. So the least magic way of writing contracts would be: ``` ruby Contract Contracts::Num =>...

@waterlink You're right. Perhaps `Contracts.alias(:c)` to be consistent with the ruby `alias_method`. I'm also wondering if that method could do the `include Contracts::Core` bit to save a line in user...