Re: Real simple question... for good programmers

2022-10-22 Thread Steven Schveighoffer via Digitalmars-d-learn
On 10/22/22 5:53 PM, WhatMeWorry wrote: string[] tokens = userSID.output.split!isWhite; writeln("tokens = ", tokens); tokens = ["SID", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",

Re: Real simple question... for good programmers

2022-10-22 Thread Paul Backus via Digitalmars-d-learn
On Saturday, 22 October 2022 at 21:53:05 UTC, WhatMeWorry wrote: string[] tokens = userSID.output.split!isWhite; writeln("tokens = ", tokens); [...] Is there a clever way that I can discard all the extra null strings in the resultant string array? Easiest way is to use [`filter`][1].

Re: Real simple question... for good programmers

2022-10-22 Thread Daniel via Digitalmars-d-learn
On Saturday, 22 October 2022 at 22:01:09 UTC, Enjoys Math wrote: On Saturday, 22 October 2022 at 21:53:05 UTC, WhatMeWorry wrote: string[] tokens = userSID.output.split!isWhite; writeln("tokens = ", tokens); tokens = ["SID", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",

Re: Real simple question... for good programmers

2022-10-22 Thread Enjoys Math via Digitalmars-d-learn
__MWE Code:__ ``` module DlangForumsMWE; import std.stdio; import std.algorithm.mutation; int main() { //string[] tokens = userSID.output.split!isWhite; //writeln("tokens = ", tokens); auto tokens = ["SID", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",

Re: Real simple question... for good programmers

2022-10-22 Thread Ali Çehreli via Digitalmars-d-learn
On 10/22/22 14:53, WhatMeWorry wrote: > > > string[] tokens = userSID.output.split!isWhite; > writeln("tokens = ", tokens); Could you please show minimal compilable code that demonstrates the issue. I spent some time with some guesses but failed (to get my code to compile with

Re: Real simple question... for good programmers

2022-10-22 Thread Enjoys Math via Digitalmars-d-learn
On Saturday, 22 October 2022 at 21:53:05 UTC, WhatMeWorry wrote: string[] tokens = userSID.output.split!isWhite; writeln("tokens = ", tokens); tokens = ["SID", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",

Real simple question... for good programmers

2022-10-22 Thread WhatMeWorry via Digitalmars-d-learn
string[] tokens = userSID.output.split!isWhite; writeln("tokens = ", tokens); tokens = ["SID", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",

Re: DMD -i option, simple question...

2020-11-19 Thread Adam D. Ruppe via Digitalmars-d-learn
On Friday, 20 November 2020 at 03:06:37 UTC, WhatMeWorry wrote: The "..when this option is enabled..." is exactly the behavior I want, but how is it enabled? Is there an "all inclusive pattern" that I'm missing. dmd -i yourfile.d that's the default it is describing when you don't specify

DMD -i option, simple question...

2020-11-19 Thread WhatMeWorry via Digitalmars-d-learn
The DMD forum mentions internal design. This is more of a beginner usage question. - from Compiler Switches - -I=directory Look for imports also in directory -i[=pattern ] Enables "include imports" mode, where the compiler will

Re: Hopefully a simple question...

2017-01-13 Thread Nicholas Wilson via Digitalmars-d-learn
On Friday, 13 January 2017 at 16:56:43 UTC, WhatMeWorry wrote: I'm converting some C++ and glm code to D and gl3n. And I'm stumped at the following line. GLboolean CheckCollision(BallObject , GameObject ) // AABB - Circle collision { // Get center point circle first glm::vec2

Re: Hopefully a simple question...

2017-01-13 Thread kinke via Digitalmars-d-learn
On Friday, 13 January 2017 at 16:56:43 UTC, WhatMeWorry wrote: A vec and scalar can't be added together. So why (or how) is the glm code working? The C++ source disagrees: https://github.com/g-truc/glm/blob/master/glm/detail/type_vec2.hpp#L219 It works via operator overloading, and adding a

Re: Real Simple Question?

2016-10-25 Thread Steven Schveighoffer via Digitalmars-d-learn
On 10/22/16 5:34 PM, WhatMeWorry wrote: On Saturday, 22 October 2016 at 20:51:14 UTC, Jonathan M Davis wrote: On Saturday, October 22, 2016 20:35:27 WhatMeWorry via Digitalmars-d-learn wrote: [...] Just put it in a separate module and then import it. e.g. file: mypackage/constants.d

Re: Real Simple Question?

2016-10-25 Thread tcak via Digitalmars-d-learn
On Saturday, 22 October 2016 at 21:34:36 UTC, WhatMeWorry wrote: On Saturday, 22 October 2016 at 20:51:14 UTC, Jonathan M Davis wrote: [...] Ok, but now I'm getting these error in my new mypackage/constants.d ..\common\vertex_data.d(5,15): Error: undefined identifier 'GLfloat'

Re: Real Simple Question?

2016-10-22 Thread Jonathan M Davis via Digitalmars-d-learn
On Saturday, October 22, 2016 21:34:36 WhatMeWorry via Digitalmars-d-learn wrote: > Ok, but now I'm getting these error in my new > mypackage/constants.d > > ..\common\vertex_data.d(5,15): Error: undefined identifier > 'GLfloat' > ..\common\vertex_data.d(53,12): Error: undefined identifier 'vec3'

Re: Real Simple Question?

2016-10-22 Thread WhatMeWorry via Digitalmars-d-learn
On Saturday, 22 October 2016 at 20:51:14 UTC, Jonathan M Davis wrote: On Saturday, October 22, 2016 20:35:27 WhatMeWorry via Digitalmars-d-learn wrote: [...] Just put it in a separate module and then import it. e.g. file: mypackage/constants.d == module mypackage.constants;

Re: Real Simple Question?

2016-10-22 Thread Jonathan M Davis via Digitalmars-d-learn
On Saturday, October 22, 2016 20:35:27 WhatMeWorry via Digitalmars-d-learn wrote: > This is probably so simple that there's no example anywhere. > > Basically, I've got a huge array definition (see below) which I > reuse over and over again in different projects. > > GLfloat[] vertices = > [ >

Real Simple Question?

2016-10-22 Thread WhatMeWorry via Digitalmars-d-learn
This is probably so simple that there's no example anywhere. Basically, I've got a huge array definition (see below) which I reuse over and over again in different projects. GLfloat[] vertices = [ // Positions // Texture Coords -0.5f, -0.5f, -0.5f, 0.0f, 0.0f, 0.5f,

Re: simple question about using dub to import CyberShadow's aeutils

2015-01-03 Thread Laeeth Isharc via Digitalmars-d-learn
On Saturday, 3 January 2015 at 12:08:16 UTC, Vladimir Panteleev wrote: On Saturday, 3 January 2015 at 11:58:48 UTC, Laeeth Isharc wrote: import ae.utils; ae.utils is a package, perhaps you meant to import ae.utils.xml? aha. schoolboy error on my part. thank you for your help, and

Re: simple question about using dub to import CyberShadow's aeutils

2015-01-03 Thread Vladimir Panteleev via Digitalmars-d-learn
On Saturday, 3 January 2015 at 11:58:48 UTC, Laeeth Isharc wrote: import ae.utils; ae.utils is a package, perhaps you meant to import ae.utils.xml?

Re: simple question about function call syntax

2014-08-18 Thread Dominikus Dittes Scherkl via Digitalmars-d-learn
On Monday, 18 August 2014 at 16:30:13 UTC, Nikolay wrote: I found this code sample in vibe: void connect(NetworkAddress addr) { enforce(.connect(m_ctx.socketfd, addr.sockAddr, addr.sockAddrLen) == 0, Failed to connect UDP socket.~to!string(getLastSocketError())); } What

Re: simple question about function call syntax

2014-08-18 Thread ketmar via Digitalmars-d-learn
On Mon, 18 Aug 2014 16:30:12 + Nikolay via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: What does mean .connect? Where I can find description of this syntax (dot + function name)? right here: http://dlang.org/expression.html#PrimaryExpression language documentation rulez!

Re: simple question about function call syntax

2014-08-18 Thread Nikolay via Digitalmars-d-learn
right here: http://dlang.org/expression.html#PrimaryExpression language documentation rulez! ;-) Yes I found it. Correct link: Module Scope Operator http://dlang.org/module.html

Re: simple question about function call syntax

2014-08-18 Thread ketmar via Digitalmars-d-learn
On Tue, 19 Aug 2014 03:36:26 + Nikolay via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: right here: http://dlang.org/expression.html#PrimaryExpression language documentation rulez! ;-) Yes I found it. Correct link: Module Scope Operator http://dlang.org/module.html

Re: A simple question

2012-11-18 Thread Bernard Helyer
On Friday, 16 November 2012 at 01:00:58 UTC, Walter Bright wrote: On 11/15/2012 4:11 PM, Stugol wrote: am I likely to be told to fuck off again? I haven't seen Bernard lately, so probably not. I'm still about. Bernard was certainly out of line with that remark Absolutely. I let the NG

Re: A simple question

2012-11-17 Thread Rainer Schuetze
On 11/16/2012 4:08 AM, Nick Sabalausky wrote: On Fri, 16 Nov 2012 01:11:18 +0100 As for your specific issue, there's a few different factors: 1. Like other have already said, all the files need to be sent to DMD together (possibly by using RDMD) or, if not that, then at least their objects

Re: A simple question

2012-11-16 Thread Don Clugston
On 16/11/12 05:15, Rob T wrote: On Friday, 16 November 2012 at 03:41:45 UTC, Stugol wrote: Event_t e2;// Will compile! Yeah but that kinda blows, doesn't it? I found it surprising or unintuitive that the !() is required, and I do want to know what is the reasoning behind it, One

Re: A simple question

2012-11-16 Thread kenji hara
Now I'm working that. Kenji Hara 2012/11/16 Don Clugston d...@nospam.com On 16/11/12 05:15, Rob T wrote: On Friday, 16 November 2012 at 03:41:45 UTC, Stugol wrote: Event_t e2;// Will compile! Yeah but that kinda blows, doesn't it? I found it surprising or unintuitive that the

Re: A simple question

2012-11-16 Thread kenji hara
Done. https://github.com/D-Programming-Language/dmd/pull/1295 Kenji Hara 2012/11/16 kenji hara k.hara...@gmail.com Now I'm working that. Kenji Hara 2012/11/16 Don Clugston d...@nospam.com One of the oldest open enhancement requests is on this topic:

Re: A simple question

2012-11-16 Thread Andrej Mitrovic
On 11/16/12, kenji hara k.hara...@gmail.com wrote: Done. https://github.com/D-Programming-Language/dmd/pull/1295 Have you seen this comment: On 11/16/12, jerro a...@a.com wrote: doing that certainly would introduce some ambiguities. For example, consider this line: alias Foo Bar; Should

Re: A simple question

2012-11-16 Thread Jacob Carlborg
On 2012-11-16 11:16, Andrej Mitrovic wrote: Have you seen this comment: On 11/16/12, jerro a...@a.com wrote: doing that certainly would introduce some ambiguities. For example, consider this line: alias Foo Bar; Should Bar be a template or an instance of a template here? And my reply to

A simple question

2012-11-15 Thread Stugol
When I post on these forums to ask for new features (e.g. iterators), you say that you won't be adding any new features at the moment, and that you are instead concentrating on making the language stable and usable. However, when I post on these forums to ask for bugs to be fixed (e.g. the

Re: A simple question

2012-11-15 Thread Jesse Phillips
On Thursday, 15 November 2012 at 21:25:03 UTC, Stugol wrote: When I post on these forums to ask for new features (e.g. iterators), you say that you won't be adding any new features at the moment, and that you are instead concentrating on making the language stable and usable. However, when I

Re: A simple question

2012-11-15 Thread Stugol
On Thursday, 15 November 2012 at 22:43:22 UTC, Jesse Phillips wrote: To say that being told you won't see it any times soon is flaming is exaggeration. If you have a real example of flames then please do bring that forward, but there isn't much the community will be able to do about it. I

Re: A simple question

2012-11-15 Thread David Nadlinger
On Thursday, 15 November 2012 at 21:25:03 UTC, Stugol wrote: However, when I post on these forums to ask for bugs to be fixed (e.g. the defective MODULE keyword, or the linker not supporting spaces in paths), you say that's not going to happen anytime soon. Please provide links to that

Re: A simple question

2012-11-15 Thread David Nadlinger
On Thursday, 15 November 2012 at 23:56:49 UTC, David Nadlinger wrote: On Thursday, 15 November 2012 at 21:25:03 UTC, Stugol wrote: However, when I post on these forums to ask for bugs to be fixed (e.g. the defective MODULE keyword, or the linker not supporting spaces in paths), you say that's

Re: A simple question

2012-11-15 Thread Stugol
On Thursday, 15 November 2012 at 23:56:49 UTC, David Nadlinger wrote: On Thursday, 15 November 2012 at 21:25:03 UTC, Stugol wrote: However, when I post on these forums to ask for bugs to be fixed (e.g. the defective MODULE keyword, or the linker not supporting spaces in paths), you say that's

Re: A simple question

2012-11-15 Thread Adam D. Ruppe
On Friday, 16 November 2012 at 00:11:19 UTC, Stugol wrote: As to the module bug, I refer you to this error I just received after trying to use D again after a long absence: Error 42: Symbol Undefined _D8infinity8standard3api7windows12__ModuleInfoZ

Re: A simple question

2012-11-15 Thread David Nadlinger
On Friday, 16 November 2012 at 00:11:19 UTC, Stugol wrote: Are these bugs likely to be addressed, or am I likely to be told to fuck off again? Ah, now things become clearer. The issue here is that what you are describing is not an actual bug, but the consequence of you not specifying one of

Re: A simple question

2012-11-15 Thread Adam D. Ruppe
On Friday, 16 November 2012 at 00:29:24 UTC, David Nadlinger wrote: Granted, the diagnostics for it are terrible, you just get to see the raw linker error message. This is potentially very easy to fix... $ cat demangle.d import core.demangle; import std.stdio; import std.regex; string

Re: A simple question

2012-11-15 Thread Stugol
On Friday, 16 November 2012 at 00:20:00 UTC, Adam D. Ruppe wrote: On Friday, 16 November 2012 at 00:11:19 UTC, Stugol wrote: As to the module bug, I refer you to this error I just received after trying to use D again after a long absence: Error 42: Symbol Undefined

Re: A simple question

2012-11-15 Thread Stugol
On Friday, 16 November 2012 at 00:39:48 UTC, bearophile wrote: Stugol: Huh? This usually happens if I omit the module statement at the top of EVERY DAMN FILE (why???) but in this case I haven't omitted it, yet I'm still getting the error. ... What the HELL is this ModuleInfo, why is it

Re: A simple question

2012-11-15 Thread Stugol
On Friday, 16 November 2012 at 00:29:24 UTC, David Nadlinger wrote: On Friday, 16 November 2012 at 00:11:19 UTC, Stugol wrote: Are these bugs likely to be addressed, or am I likely to be told to fuck off again? Ah, now things become clearer. The issue here is that what you are describing is

Re: A simple question

2012-11-15 Thread Walter Bright
On 11/15/2012 4:11 PM, Stugol wrote: am I likely to be told to fuck off again? I haven't seen Bernard lately, so probably not. Bernard was certainly out of line with that remark, but we try not to censor people here. Peoples' comments are their own responsibility.

Re: A simple question

2012-11-15 Thread Adam D. Ruppe
On Friday, 16 November 2012 at 00:55:36 UTC, Stugol wrote: The point is, it says that kind of crap all the time. Even when it doesn't, if I take the MODULE statement out, it comes back. The module keyword is supposed to be optional. Oh, I see what's going on now. The module thing is only

Re: A simple question

2012-11-15 Thread jerro
I believe this post occurred *after* I had already been met with hostility. That post was actually the very first post in the thread.

Re: A simple question

2012-11-15 Thread Stugol
On Friday, 16 November 2012 at 01:14:18 UTC, Adam D. Ruppe wrote: The module thing is only optional in simple cases, where the name has no dots and matches the filename. If you are using packages, the module line is required to get that full name registered in the file. Hmm, that makes a

Re: A simple question

2012-11-15 Thread Adam D. Ruppe
On Friday, 16 November 2012 at 02:00:05 UTC, Stugol wrote: Hmm, that makes a bit more sense now I guess. Funny, I don't remember seeing that rule when I read the documentation. It might not be clear, but it is there: http://dlang.org/module.html The ModuleDeclaration sets the name of the

Re: A simple question

2012-11-15 Thread Stugol
On Friday, 16 November 2012 at 02:22:32 UTC, Adam D. Ruppe wrote: On Friday, 16 November 2012 at 02:00:05 UTC, Stugol wrote: Hmm, that makes a bit more sense now I guess. Funny, I don't remember seeing that rule when I read the documentation. It might not be clear, but it is there:

Re: A simple question

2012-11-15 Thread Nick Sabalausky
On Fri, 16 Nov 2012 01:11:18 +0100 Stugol stu...@gmx.com wrote: On Thursday, 15 November 2012 at 23:56:49 UTC, David Nadlinger wrote: On Thursday, 15 November 2012 at 21:25:03 UTC, Stugol wrote: However, when I post on these forums to ask for bugs to be fixed (e.g. the defective MODULE

Re: A simple question

2012-11-15 Thread Nick Sabalausky
On Fri, 16 Nov 2012 03:55:53 +0100 Stugol stu...@gmx.com wrote: On Friday, 16 November 2012 at 02:22:32 UTC, Adam D. Ruppe wrote: On Friday, 16 November 2012 at 02:00:05 UTC, Stugol wrote: Hmm, that makes a bit more sense now I guess. Funny, I don't remember seeing that rule when I read

Re: A simple question

2012-11-15 Thread Adam D. Ruppe
On Friday, 16 November 2012 at 02:55:54 UTC, Stugol wrote: I'm not quite sure what purpose the MODULE keyword serves in any case. I have a file Include.D\Infinity\Standard\Mixins\Event.d, but if I give it a module name of infinity.standard.event it doesn't work. I have to include the .mixins

Re: A simple question

2012-11-15 Thread Rob T
On Friday, 16 November 2012 at 02:55:54 UTC, Stugol wrote: Also, I'm having difficulty specifying a default specialisation for a template class: class Event(TEventArgs : EventArgs = EventArgs) { } Usage: Event!() e1; // Works Event e2;// Won't compile How can I have

Re: A simple question

2012-11-15 Thread Rob T
On Friday, 16 November 2012 at 02:55:54 UTC, Stugol wrote: Also, I'm having difficulty specifying a default specialisation for a template class: class Event(TEventArgs : EventArgs = EventArgs) { } Usage: Event!() e1; // Works Event e2;// Won't compile How can I have

Re: A simple question

2012-11-15 Thread Stugol
On Friday, 16 November 2012 at 03:24:28 UTC, Nick Sabalausky wrote: Unless you really are requiring that TEventArgs must be either EventArgs or something derived from EventArgs. (Maybe you are?) I am. You may be able to do this: alias Event!() Event; But I don't know if that would

Re: A simple question

2012-11-15 Thread Stugol
On Friday, 16 November 2012 at 03:32:06 UTC, Rob T wrote: I encountered this same wtf??? today. Apparently, even with a default type specified, you still have to put in a !(). I don't know what the reasoning was behind making this seeming redundancy a requirement, and it partially defeats

Re: A simple question

2012-11-15 Thread Jesse Phillips
On Friday, 16 November 2012 at 00:55:36 UTC, Stugol wrote: On Friday, 16 November 2012 at 00:20:00 UTC, Adam D. Ruppe wrote: On Friday, 16 November 2012 at 00:11:19 UTC, Stugol wrote: As to the module bug, I refer you to this error I just received after trying to use D again after a long

Re: A simple question

2012-11-15 Thread Rob T
On Friday, 16 November 2012 at 03:41:45 UTC, Stugol wrote: Event_t e2;// Will compile! Yeah but that kinda blows, doesn't it? I found it surprising or unintuitive that the !() is required, and I do want to know what is the reasoning behind it, but it's not that big of a deal

Re: A simple question

2012-11-15 Thread jerro
I found it surprising or unintuitive that the !() is required, and I do want to know what is the reasoning behind it I don't know whether the language could be changed to support code like: struct Foo(){} Foo foo; but doing that certainly would introduce some ambiguities. For example,

Re: A simple question

2012-11-15 Thread Rob T
On Friday, 16 November 2012 at 04:26:31 UTC, jerro wrote: I found it surprising or unintuitive that the !() is required, and I do want to know what is the reasoning behind it I don't know whether the language could be changed to support code like: struct Foo(){} Foo foo; but doing that

Re: A simple question

2012-11-15 Thread Jacob Carlborg
On 2012-11-16 05:26, jerro wrote: I don't know whether the language could be changed to support code like: struct Foo(){} Foo foo; but doing that certainly would introduce some ambiguities. For example, consider this line: alias Foo Bar; Should Bar be a template or an instance of a template