Keywords: How to trick the compiler?

Chris wendlec at tcd.ie
Tue Jan 28 10:17:02 PST 2014


On Tuesday, 28 January 2014 at 17:18:44 UTC, Ary Borenszweig 
wrote:
> On 1/28/14, 11:30 AM, bearophile wrote:
>> Ary Borenszweig:
>>
>>> In Ruby you can do this:
>>>
>>> class Foo
>>>  def end
>>>    1
>>>  end
>>> end
>>>
>>> Foo.new.end
>>
>> Ruby is a different language from D, they define "code safety" 
>> in quite
>> different ways.
>>
>> Bye,
>> bearophile
>
> Having a method named "end" doesn't make the language less safe.

End is cumbersome and looks awkward. Sure there are other ways ;)


More information about the Digitalmars-d-learn mailing list