Re: What Does @ Mean?

2019-04-12 Thread Ron Tarrant via Digitalmars-d-learn
On Friday, 12 April 2019 at 10:01:40 UTC, wjoe wrote: It's not entirely related but another use of the underscore is to make integers more readable. E.g.: int x = 1_000_000_000_000; And, I suspect, to make numbers easier to translate between English Canadian and French Canadian:

Re: What Does @ Mean?

2019-04-12 Thread wjoe via Digitalmars-d-learn
On Monday, 8 April 2019 at 12:16:13 UTC, Adam D. Ruppe wrote: On Monday, 8 April 2019 at 11:58:49 UTC, Ron Tarrant wrote: And while I'm asking, does an underscore have special meaning when used either at the beginning or end of a variable name? Nothing special there, you are allowed to use

Re: What Does @ Mean?

2019-04-08 Thread Ron Tarrant via Digitalmars-d-learn
On Monday, 8 April 2019 at 14:27:11 UTC, JN wrote: Java uses @ for annotations too. Pascal uses @ for "address of", like & in D. Just one of the many reasons I balked at Java... many MANY reasons. Thanks, JN.

Re: What Does @ Mean?

2019-04-08 Thread Ron Tarrant via Digitalmars-d-learn
On Monday, 8 April 2019 at 14:19:04 UTC, XavierAP wrote: On Monday, 8 April 2019 at 11:58:49 UTC, Ron Tarrant wrote: And while I'm asking, does an underscore have special meaning when used either at the beginning or end of a variable name? In D, @ is used as Adam has explained as a prefix

Re: What Does @ Mean?

2019-04-08 Thread JN via Digitalmars-d-learn
On Monday, 8 April 2019 at 14:19:04 UTC, XavierAP wrote: The only other example of language using @, in an almost but not quite completely different way, is C#. It's also a prefix that allows you to define names that would collide with reserved words, for example string @class = "menu"; Of

Re: What Does @ Mean?

2019-04-08 Thread XavierAP via Digitalmars-d-learn
On Monday, 8 April 2019 at 11:58:49 UTC, Ron Tarrant wrote: And while I'm asking, does an underscore have special meaning when used either at the beginning or end of a variable name? In D, @ is used as Adam has explained as a prefix indicating attributes (either user-defined ones or,

Re: What Does @ Mean?

2019-04-08 Thread Ron Tarrant via Digitalmars-d-learn
Well, that was quick! Thanks Adam, Kagamin, and Alex.

Re: What Does @ Mean?

2019-04-08 Thread Adam D. Ruppe via Digitalmars-d-learn
On Monday, 8 April 2019 at 11:58:49 UTC, Ron Tarrant wrote: Would someone please tell me what an at sign (@) means when it's used like this: bool isLeaf() @property In that case, it means nothing. We just defined the word to be `@property`, with the @ included. So it is just part of the

Re: What Does @ Mean?

2019-04-08 Thread Kagamin via Digitalmars-d-learn
https://dlang.org/spec/function.html#property-functions

Re: What Does @ Mean?

2019-04-08 Thread Alex via Digitalmars-d-learn
On Monday, 8 April 2019 at 11:58:49 UTC, Ron Tarrant wrote: This is frustrating and makes me feel like a complete newb. Worse, it's impossible to search for. Ever try Googling a single character? The D documentation also doesn't seem to explain the meaning of this or any other token. Sure,

What Does @ Mean?

2019-04-08 Thread Ron Tarrant via Digitalmars-d-learn
This is frustrating and makes me feel like a complete newb. Worse, it's impossible to search for. Ever try Googling a single character? The D documentation also doesn't seem to explain the meaning of this or any other token. Sure, most of them are obvious, but this one eludes me. All I can

Re: What does ! mean?

2017-09-27 Thread Arun Chandrasekaran via Digitalmars-d-learn
On Wednesday, 27 September 2017 at 14:34:06 UTC, Eugene Wissner wrote: On Wednesday, 27 September 2017 at 14:23:01 UTC, Ky-Anh Huynh wrote: See also the following chapter in Ali's book: http://ddili.org/ders/d.en/templates.html This chapter is what hooked me with D. Naming that chapter as

Re: What does ! mean?

2017-09-27 Thread Mengu via Digitalmars-d-learn
On Wednesday, 27 September 2017 at 17:58:27 UTC, Ali Çehreli wrote: On 09/27/2017 08:33 AM, Ky-Anh Huynh wrote: > [...] Wissner wrote: > [...] The fact that such an important operator is explained so late in the book is due to the book's strong desire to have a linear flow. [...] ustad,

Re: What does ! mean?

2017-09-27 Thread Ali Çehreli via Digitalmars-d-learn
On 09/27/2017 03:06 PM, Mengu wrote: ustad, guess you can still write the new ed. :-) Since you're still around, one of these days... :) Ali

Re: What does ! mean?

2017-09-27 Thread Ali Çehreli via Digitalmars-d-learn
On 09/27/2017 08:33 AM, Ky-Anh Huynh wrote: > On Wednesday, 27 September 2017 at 14:34:06 UTC, Eugene Wissner wrote: >> >> See also the following chapter in Ali's book: >> http://ddili.org/ders/d.en/templates.html > > Thanks a lot. I will keep reading :) The fact that such an important operator

Re: What does ! mean?

2017-09-27 Thread Gary Willoughby via Digitalmars-d-learn
On Wednesday, 27 September 2017 at 14:23:01 UTC, Ky-Anh Huynh wrote: Can you please explain and give any link where I can learn more about these things? Thanks a lot. http://nomad.so/2013/07/templates-in-d-explained/

Re: What does ! mean?

2017-09-27 Thread Ky-Anh Huynh via Digitalmars-d-learn
On Wednesday, 27 September 2017 at 14:34:06 UTC, Eugene Wissner wrote: See also the following chapter in Ali's book: http://ddili.org/ders/d.en/templates.html Thanks a lot. I will keep reading :)

Re: What does ! mean?

2017-09-27 Thread Eugene Wissner via Digitalmars-d-learn
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

Re: What does ! mean?

2017-09-27 Thread rikki cattermole via Digitalmars-d-learn
There are two types of arguments in D. The runtime one (which you are well aware of) and the compile time one. A compile time argument is a constant passed in during construction of a symbol. But here is the thing, it isn't just limited to functions, you can have it on classes as well. ---

What does ! mean?

2017-09-27 Thread Ky-Anh Huynh via Digitalmars-d-learn
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