Re: What is the FreeBSD situation?

2017-11-04 Thread codephantom via Digitalmars-d
On Saturday, 4 November 2017 at 11:04:33 UTC, rjframe wrote: Many people seem to leave the module statement out of their main.d/app.d files; I think it's a way to say "this is the main thing - don't import it from somewhere else." Basically, it's easier to act like that code isn't in a module t

Re: What are the unused but useful feature you know in D?

2017-11-04 Thread rikki cattermole via Digitalmars-d
On 04/11/2017 6:13 PM, bauss wrote: On Saturday, 4 November 2017 at 13:27:29 UTC, rikki cattermole wrote: On 04/11/2017 2:14 PM, jmh530 wrote: [...] Okay so: A signature when it is initiated is aware of the implementation it is referencing. Allowing it to change how it behaves for compatibi

Re: Improve "Improve Contract Syntax" DIP 1009

2017-11-04 Thread Timon Gehr via Digitalmars-d
On 04.11.2017 10:12, Adam D. Ruppe wrote: On Saturday, 4 November 2017 at 13:59:39 UTC, Jonathan M Davis wrote: I'm very much of the opinion that proper unit tests pretty much eliminate the need for out contracts. I think that sqrt example is just bad. It is indeed bad, because it is buggy.

Re: Improve "Improve Contract Syntax" DIP 1009

2017-11-04 Thread Ola Fosheim Grøstad via Digitalmars-d
On Saturday, 4 November 2017 at 16:57:50 UTC, Adam D. Ruppe wrote: On Saturday, 4 November 2017 at 15:27:39 UTC, Ola Fosheim Grøstad wrote: No, Jonathan is correct. The postcondition should be able to access values as they were stated in the precondition. Yes, they should be able to access val

Re: What are the unused but useful feature you know in D?

2017-11-04 Thread Walter Bright via Digitalmars-d
On 6/25/2017 9:31 PM, H. S. Teoh via Digitalmars-d wrote: It happens for template functions, member functions of templated aggregates (structs/classes), and auto functions. And all function literals, and all functions generated by the compiler (such as lazy delegates and aggregate destructors).

Re: Improve "Improve Contract Syntax" DIP 1009

2017-11-04 Thread Mark via Digitalmars-d
On Saturday, 4 November 2017 at 15:38:42 UTC, Jonathan M Davis wrote: On Saturday, November 04, 2017 15:27:39 Ola Fosheim Grøstad via Digitalmars- d wrote: On Saturday, 4 November 2017 at 14:12:08 UTC, Adam D. Ruppe wrote: > On Saturday, 4 November 2017 at 13:59:39 UTC, Jonathan M > Davis > >

Re: Improve "Improve Contract Syntax" DIP 1009

2017-11-04 Thread Mark via Digitalmars-d
On Saturday, 4 November 2017 at 06:08:22 UTC, Jonathan M Davis wrote: And even if you did have access to the input, some functions consume their input without any way to save it (e.g. an input range that isn't a forward range) [...] - Jonathan M Davis True. I had (strongly) pure functions i

Re: What are the unused but useful feature you know in D?

2017-11-04 Thread bauss via Digitalmars-d
On Saturday, 4 November 2017 at 13:27:29 UTC, rikki cattermole wrote: On 04/11/2017 2:14 PM, jmh530 wrote: [...] Okay so: A signature when it is initiated is aware of the implementation it is referencing. Allowing it to change how it behaves for compatibility reasons. An interface is desi

Re: Improve "Improve Contract Syntax" DIP 1009

2017-11-04 Thread Adam D. Ruppe via Digitalmars-d
On Saturday, 4 November 2017 at 15:27:39 UTC, Ola Fosheim Grøstad wrote: No, Jonathan is correct. The postcondition should be able to access values as they were stated in the precondition. Yes, they should be able to access values, but D's limitations on this doesn't make them useless or repla

Re: Improve "Improve Contract Syntax" DIP 1009

2017-11-04 Thread H. S. Teoh via Digitalmars-d
On Sat, Nov 04, 2017 at 09:38:42AM -0600, Jonathan M Davis via Digitalmars-d wrote: > On Saturday, November 04, 2017 15:27:39 Ola Fosheim Grøstad via Digitalmars- > d wrote: > > On Saturday, 4 November 2017 at 14:12:08 UTC, Adam D. Ruppe wrote: > > > On Saturday, 4 November 2017 at 13:59:39 UTC, J

Re: Improve "Improve Contract Syntax" DIP 1009

2017-11-04 Thread Ola Fosheim Grøstad via Digitalmars-d
On Saturday, 4 November 2017 at 15:38:42 UTC, Jonathan M Davis wrote: In principle, that would be nice, but in practice, it's not really feasible. In the general case, there's no way to save the state of the parameter at the beginning of the function call (you could with some types, but for man

Re: Improve "Improve Contract Syntax" DIP 1009

2017-11-04 Thread Jonathan M Davis via Digitalmars-d
On Saturday, November 04, 2017 15:27:39 Ola Fosheim Grøstad via Digitalmars- d wrote: > On Saturday, 4 November 2017 at 14:12:08 UTC, Adam D. Ruppe wrote: > > On Saturday, 4 November 2017 at 13:59:39 UTC, Jonathan M Davis > > > > wrote: > >> I'm very much of the opinion that proper unit tests prett

Re: Improve "Improve Contract Syntax" DIP 1009

2017-11-04 Thread Ola Fosheim Grøstad via Digitalmars-d
On Saturday, 4 November 2017 at 14:12:08 UTC, Adam D. Ruppe wrote: On Saturday, 4 November 2017 at 13:59:39 UTC, Jonathan M Davis wrote: I'm very much of the opinion that proper unit tests pretty much eliminate the need for out contracts. I think that sqrt example is just bad. Out contracts sh

Re: Improve "Improve Contract Syntax" DIP 1009

2017-11-04 Thread Adam D. Ruppe via Digitalmars-d
On Saturday, 4 November 2017 at 13:59:39 UTC, Jonathan M Davis wrote: I'm very much of the opinion that proper unit tests pretty much eliminate the need for out contracts. I think that sqrt example is just bad. Out contracts shouldn't be testing specific values, but rather ranges or nullness o

Re: Improve "Improve Contract Syntax" DIP 1009

2017-11-04 Thread Jonathan M Davis via Digitalmars-d
On Saturday, November 04, 2017 13:02:45 Nick Treleaven via Digitalmars-d wrote: > On Saturday, 4 November 2017 at 06:08:22 UTC, Jonathan M Davis > > wrote: > > Heck, take a really simply one like sqrt. All you have to check > > in the out contract is the return value. You have no idea what > > was

Re: What are the unused but useful feature you know in D?

2017-11-04 Thread rikki cattermole via Digitalmars-d
On 04/11/2017 2:14 PM, jmh530 wrote: On Saturday, 4 November 2017 at 12:20:37 UTC, rikki cattermole wrote: Like signatures which I'm working on! https://github.com/rikkimax/DIPs/blob/master/DIPs/DIP1xxx-RC.md The first example kind of reminds me of what I was trying to do with isSubTypeOf [

Re: What are the unused but useful feature you know in D?

2017-11-04 Thread jmh530 via Digitalmars-d
On Saturday, 4 November 2017 at 12:20:37 UTC, rikki cattermole wrote: Like signatures which I'm working on! https://github.com/rikkimax/DIPs/blob/master/DIPs/DIP1xxx-RC.md The first example kind of reminds me of what I was trying to do with isSubTypeOf [1]. If you know that any function you

Re: Improve "Improve Contract Syntax" DIP 1009

2017-11-04 Thread Nick Treleaven via Digitalmars-d
On Saturday, 4 November 2017 at 06:08:22 UTC, Jonathan M Davis wrote: Heck, take a really simply one like sqrt. All you have to check in the out contract is the return value. You have no idea what was passed in. So, how would you write an out contract verifying that you got the correct number?

Re: What are the unused but useful feature you know in D?

2017-11-04 Thread rikki cattermole via Digitalmars-d
On 04/11/2017 1:16 PM, Eljay wrote: On Monday, 26 June 2017 at 00:38:21 UTC, Mike wrote: IMO, part of the problem is that D has the wrong defaults (e.g. `immutable` by default, `@safe` by default, `final` by default, etc...), so users have to opt in to these things when they should really only

Re: What are the unused but useful feature you know in D?

2017-11-04 Thread Eljay via Digitalmars-d
On Monday, 26 June 2017 at 00:38:21 UTC, Mike wrote: IMO, part of the problem is that D has the wrong defaults (e.g. `immutable` by default, `@safe` by default, `final` by default, etc...), so users have to opt in to these things when they should really only be opting out of them. Unfortunatel

Re: Anticipate the usage of Visual Studio 2017 Developer Command Prompt?

2017-11-04 Thread Rainer Schuetze via Digitalmars-d
On 04.11.2017 12:16, Andre Pany wrote: On Saturday, 4 November 2017 at 09:39:02 UTC, Rainer Schuetze wrote: On 03.11.2017 21:51, Andre Pany wrote: On Friday, 3 November 2017 at 11:52:10 UTC, Andre Pany wrote: [...] I have an idea which solves several problems. Current state: The dmd win

Re: Anticipate the usage of Visual Studio 2017 Developer Command Prompt?

2017-11-04 Thread Andre Pany via Digitalmars-d
On Saturday, 4 November 2017 at 09:39:02 UTC, Rainer Schuetze wrote: On 03.11.2017 21:51, Andre Pany wrote: On Friday, 3 November 2017 at 11:52:10 UTC, Andre Pany wrote: [...] I have an idea which solves several problems. Current state: The dmd windows archive has a folder "bin" with a 32

Re: What is the FreeBSD situation?

2017-11-04 Thread rjframe via Digitalmars-d
On Sat, 04 Nov 2017 09:51:12 +, codephantom wrote: >> It might also make sense, that if a source code file does not contain a >> module statement, then it should not be treated as a module, and the >> compiler should look to the import statements instead of implicitly >> making in a module. >>

Re: What is the FreeBSD situation?

2017-11-04 Thread codephantom via Digitalmars-d
On Saturday, 4 November 2017 at 08:46:37 UTC, Jonathan M Davis wrote: Well, the modules need names. So, either, the compiler is going to have to pick a name for you, or you're going to have to give it one. ok..just one more ... I can't help myself.. I know that D does not have a 'global names

Re: What is the FreeBSD situation?

2017-11-04 Thread Jonathan M Davis via Digitalmars-d
On Saturday, November 04, 2017 09:34:05 codephantom via Digitalmars-d wrote: > On Saturday, 4 November 2017 at 08:46:37 UTC, Jonathan M Davis > > wrote: > > Well, the modules need names. So, either, the compiler is going > > to have to pick a name for you, or you're going to have to give > > it one

Re: What is the FreeBSD situation?

2017-11-04 Thread codephantom via Digitalmars-d
On Saturday, 4 November 2017 at 09:34:05 UTC, codephantom wrote: Yes. All that makes complete sense I guess. It might also make sense, that if a source code file does not contain a module statement, then it should not be treated as a module, and the compiler should look to the import statement

Re: Anticipate the usage of Visual Studio 2017 Developer Command Prompt?

2017-11-04 Thread Rainer Schuetze via Digitalmars-d
On 03.11.2017 21:51, Andre Pany wrote: On Friday, 3 November 2017 at 11:52:10 UTC, Andre Pany wrote: Hi, Visual Studio has a batch file which sets all needed environment variables for the Microsoft linker (LIB environment variables points to all necessary folders). Even the folder containin

Re: What is the FreeBSD situation?

2017-11-04 Thread codephantom via Digitalmars-d
On Saturday, 4 November 2017 at 08:46:37 UTC, Jonathan M Davis wrote: Well, the modules need names. So, either, the compiler is going to have to pick a name for you, or you're going to have to give it one. In general though, D was designed with the idea that modules would match files and packag

Re: What is the FreeBSD situation?

2017-11-04 Thread Rainer Schuetze via Digitalmars-d
On 04.11.2017 09:30, Walter Bright wrote: On 11/3/2017 5:29 AM, Rainer Schuetze wrote: Note that dmd still runs on Windows XP, though it is not officially supported. You just need to be careful about using TLS variables on it :-( to avoid spreading this false information: TLS in D works in d

Re: What is the FreeBSD situation?

2017-11-04 Thread Jonathan M Davis via Digitalmars-d
On Saturday, November 04, 2017 01:30:12 Walter Bright via Digitalmars-d wrote: > On 11/3/2017 5:29 AM, Rainer Schuetze wrote: > >> Note that dmd still runs on Windows XP, though it is not officially > >> supported. You just need to be careful about using TLS variables on it > >> :-( > > > > to avo

Re: What is the FreeBSD situation?

2017-11-04 Thread Jonathan M Davis via Digitalmars-d
On Saturday, November 04, 2017 08:38:58 codephantom via Digitalmars-d wrote: > On Saturday, 4 November 2017 at 08:17:44 UTC, Jonathan M Davis > > wrote: > > Per the spec, if you don't give a module declaration, the name > > of the module is the name of the file (minus the extension). > > So, if you

Re: What is the FreeBSD situation?

2017-11-04 Thread codephantom via Digitalmars-d
On Saturday, 4 November 2017 at 08:17:44 UTC, Jonathan M Davis wrote: Per the spec, if you don't give a module declaration, the name of the module is the name of the file (minus the extension). So, if you just give a module name (which you generally would in any real program rather than a quick

Re: Proposal: Support for objects in switch statements

2017-11-04 Thread angel via Digitalmars-d
On Wednesday, 1 November 2017 at 01:16:32 UTC, solidstate1991 wrote: After I started to alter my graphics engine to use the multiple kinds of bitmaps (now using multiple language features, like templates and aliases) on one layer, I noticed that type detection of bitmap objects would be easier

Re: What is the FreeBSD situation?

2017-11-04 Thread Walter Bright via Digitalmars-d
On 11/3/2017 5:29 AM, Rainer Schuetze wrote: Note that dmd still runs on Windows XP, though it is not officially supported. You just need to be careful about using TLS variables on it :-( to avoid spreading this false information: TLS in D works in dynamically loaded DLLs on WinXP since 2010.

Re: Note from a donor

2017-11-04 Thread Joakim via Digitalmars-d
On Saturday, 4 November 2017 at 02:33:35 UTC, Computermatronic wrote: On Friday, 3 November 2017 at 18:26:54 UTC, Joakim wrote: On Friday, 3 November 2017 at 18:08:54 UTC, 12345swordy wrote: On Friday, 3 November 2017 at 17:25:26 UTC, Joakim wrote: Most programmers will one day be coding on m

Re: What is the FreeBSD situation?

2017-11-04 Thread Jonathan M Davis via Digitalmars-d
On Saturday, November 04, 2017 08:02:38 codephantom via Digitalmars-d wrote: > On Saturday, 4 November 2017 at 03:19:00 UTC, Jonathan M Davis > > wrote: > > So, that implies that you're doing something funny, but if > > you're installing dmd with an installer or package manager, > > then I would th

Re: What is the FreeBSD situation?

2017-11-04 Thread codephantom via Digitalmars-d
On Saturday, 4 November 2017 at 03:19:00 UTC, Jonathan M Davis wrote: So, that implies that you're doing something funny, but if you're installing dmd with an installer or package manager, then I would think that it would at least be set up correctly. ok. I worked it out. my file was named: t