> On Nov 20, 2017, at 10:50 AM, Slava Pestov via swift-evolution 
> <swift-evolution@swift.org <mailto:swift-evolution@swift.org>> wrote:
> 
> What if you write ‘let fn = obj.method’?

Since Ruby doesn't distinguish between properties and methods, I would write 
the `subscript(dynamicProperty:)` getter to be equivalent to a zero-argument 
method call. This is a pragmatic tradeoff—property access is *way* more common 
than uncalled method access.

I assume that Swift would send `rubyObject.someMethod(_:_:)` through a 
method-related call, not a property-related one. Having a way to unambiguously 
specify a zero-argument method would allow the uncalled syntax to be used with 
Ruby methods which would otherwise be interpreted as properties.

(The setter on properties would handle the problem of Ruby's `=` methods. As 
for `?` and `!`, unless we extend the `identifier` syntax to allow 
non-identifier characters, I'd actually be tempted to bridge them with `is` and 
`unsafe` prefixes respectively. That might be a little too cute, though.)

-- 
Brent Royal-Gordon
Architechies

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to