What does ! mean?

Ky-Anh Huynh saigon at example.net
Wed Sep 27 14:23:01 UTC 2017


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.



More information about the Digitalmars-d-learn mailing list