Came here to make a similar feature suggestion. Ideally `class` would be aliased as something such as `klass` which has become somewhat of a ruby idiom to avoid collision with the `class` keyword. Though I'd also be interested to discuss...wardrop (Tom Wardrop)
jeremyevans0 (Jeremy Evans) wrote: > You probably want to read the very long issue that introduced refinements (#4085), which contains the reasoning. I thought there'd be one of these long discussions floating around, thanks for the ...wardrop (Tom Wardrop)
Refinements are currently lexically scoped, which makes their use burdensome when one wants to apply a refinement to an entire project, requiring boiler plate at the top of every project file. I propose that there ought to be a method of...wardrop (Tom Wardrop)
Indeed, I'm still hanging out for this. Seems like such a common thing I run into, and I'm always surprised this functionality isn't built in. `Hash#select { |k,v| {...}.include?(k) }` is very verbose.wardrop (Tom Wardrop)
Indeed limiting it to method calls on the argument object (e.g `arg.to_i`) would make it much easier to parse and more readable, but greatly limits the potential application. It seems the inferencing in the initial proposal is the cause ...wardrop (Tom Wardrop)
> I do not see why the person or machine that reads the first line of method's definition needs to know how the arguments will be post-processed before being further post-processed Semantically, it just seems more appropriate to defin...wardrop (Tom Wardrop)
> "First encountered" in regular left-to-right parsing order? It would be first identifier encountered as per the order of execution. In the following example, the variable in the if statement would be the name of the argument. ...wardrop (Tom Wardrop)
1. I know you said you're not a fan of allowing expression when assigning default values to optional parameters, but the point about aesthetics applies equally to them also. 1. The rule is relatively simple. The first identifier (lvar...wardrop (Tom Wardrop)
Without syntax highlighting, it isn't super obvious, but in simple cases (which are the main use case), like `fetch(id.to_i)`, it is obvious enough without the aid of syntax highlighting. Remember though, while there are aspects to t...wardrop (Tom Wardrop)
Haha. I don't think any programming language exists that does anything even similar to this. Whether it's a good idea or not, it's going to provoke all the feelings that come with unfamiliarity. Everything is confusing until you learn it...wardrop (Tom Wardrop)