What does ! mean?

Eugene Wissner belka at caraus.de
Wed Sep 27 14:34:06 UTC 2017


On Wednesday, 27 September 2017 at 14:23:01 UTC, Ky-Anh Huynh 
wrote:
> Hi,
>
> I am from Ruby world where I can have `!` (or `?`) in method 
> names: `!` indicates that a method would modify its object 
> (`foo.upcase!` means `foo = foo.upcase`). ( I don't know if 
> there is any official Ruby documentation on this convention 
> though. )
>
> In D I see `!` quite a lot. I have read the first 50 chapters 
> in Ali's book but nowhere I see a note on `!`. It's about the 
> compile thing, isn't it? E.g,
>
> ```
> foo = formattedRead!"%s"(value);
> ```
>
> But I also see `!` for some map/filter invocations. It's quite 
> confusing me.
>
> Can you please explain and give any link where I can learn more 
> about these things?
>
> Thanks a lot.

See also the following chapter in Ali's book:
http://ddili.org/ders/d.en/templates.html


More information about the Digitalmars-d-learn mailing list