On Friday, 7 December 2018 at 02:37:34 UTC, Arun Chandrasekaran
wrote:
I'm trying to get the current function name and apparently the
commented line errors out.
What am I doing wrong?
https://run.dlang.io/is/EGsRU2
```
#!/usr/bin/rdmd
void main()
{
import std.experimental.all;
void
On Friday, 7 December 2018 at 16:39:34 UTC, Ron Tarrant wrote:
import subfolder.ModuleName;
And in the module files, the first statement is:
module ModuleName;
That's wrong: the import name and the module name should always
match, in full, including all the dot parts.
So if you "import
Trying to wrap my brain around imports, etc.
In various places around the Internet, I've read that if I have
modules in a subfolder/subdirectory, my import statement would
look like this:
import subfolder.ModuleName;
And in the module files, the first statement is:
module ModuleName;
On 08/12/2018 6:41 AM, Ron Tarrant wrote:
Does D have the concept of makefiles? I haven't run across any reference
to such things so far.
Make isn't a D specification application (it doesn't really specialize
in any language) dmd, druntime and Phobos are all built using it.
Though for user
Hello. Is code-review requests welcome in this forum? If so I
would like some criticisms and feedback for my disjoint sets
implementation. The code is as follows:
module dsets;
/// dsets is an implementation of disjoint sets. It is implemented
/// with a simple class. To construct it, you
On Friday, 7 December 2018 at 16:43:02 UTC, Adam D. Ruppe wrote:
That's wrong: the import name and the module name should always
match, in full, including all the dot parts.
So if you "import app.modulename;", the other file must have
"module app.modulename;"
Okay. I guess the instructions
On Friday, 7 December 2018 at 19:12:31 UTC, Seb wrote:
On Friday, 7 December 2018 at 18:51:27 UTC, Arun Chandrasekaran
wrote:
I'm trying to find the needle in the hay that's an array of
strings. So the second assert fails for some reason. Is this
expected? https://run.dlang.io/is/7OrZTA
```
On Sat, Dec 08, 2018 at 06:48:46AM +1300, rikki cattermole via
Digitalmars-d-learn wrote:
> On 08/12/2018 6:41 AM, Ron Tarrant wrote:
> > Does D have the concept of makefiles? I haven't run across any
> > reference to such things so far.
>
> Make isn't a D specification application (it doesn't
On 12/7/18 1:57 PM, Dennis wrote:
On Friday, 7 December 2018 at 18:51:27 UTC, Arun Chandrasekaran wrote:
Why is there a difference in the behavior?
Your first assert expression is looking for a string in a larger string,
your second expression looks for hay which is not a string but a
On 12/7/18 2:38 PM, Arun Chandrasekaran wrote:
On Friday, 7 December 2018 at 19:12:31 UTC, Seb wrote:
On Friday, 7 December 2018 at 18:51:27 UTC, Arun Chandrasekaran wrote:
I'm trying to find the needle in the hay that's an array of strings.
So the second assert fails for some reason. Is this
On Friday, 7 December 2018 at 18:51:27 UTC, Arun Chandrasekaran
wrote:
Why is there a difference in the behavior?
Your first assert expression is looking for a string in a larger
string, your second expression looks for hay which is not a
string but a string[]. To flatten the array, use:
On Friday, 7 December 2018 at 19:38:29 UTC, Arun Chandrasekaran
wrote:
On Friday, 7 December 2018 at 19:12:31 UTC, Seb wrote:
On Friday, 7 December 2018 at 18:51:27 UTC, Arun
Chandrasekaran wrote:
[...]
Alternatively to the answers above you can also use a custom
lambda for canFind:
So, the upshot of it all seems to be that the -i's have it.
There is always a main function.
It doesn't matter in which module its in or language.
It just has to exist.
On Friday, 7 December 2018 at 19:12:31 UTC, Seb wrote:
On Friday, 7 December 2018 at 18:51:27 UTC, Arun Chandrasekaran
wrote:
I'm trying to find the needle in the hay that's an array of
strings. So the second assert fails for some reason. Is this
expected? https://run.dlang.io/is/7OrZTA
```
On Friday, 7 December 2018 at 18:51:27 UTC, Arun Chandrasekaran
wrote:
I'm trying to find the needle in the hay that's an array of
strings. So the second assert fails for some reason. Is this
expected? https://run.dlang.io/is/7OrZTA
```
#!/usr/bin/rdmd
void main()
{
import
On Friday, 7 December 2018 at 19:08:05 UTC, Arun Chandrasekaran
wrote:
On Friday, 7 December 2018 at 18:57:48 UTC, Dennis wrote:
On Friday, 7 December 2018 at 18:51:27 UTC, Arun
Chandrasekaran wrote:
Why is there a difference in the behavior?
Your first assert expression is looking for a
On Friday, 7 December 2018 at 17:41:47 UTC, Ron Tarrant wrote:
Are you talking about a list of import statements here or is
there another way/place I would list them?
On the dmd command line. So say your program has a.d and b.d, you
would compile with `dmd a.d b.d`.
Or as you had some
On Fri, Dec 07, 2018 at 07:01:18PM +, Adam D. Ruppe via Digitalmars-d-learn
wrote:
> On Friday, 7 December 2018 at 17:41:47 UTC, Ron Tarrant wrote:
[...]
> > when I compile rather than compiling modules over and over
> > needlessly.
>
> Oh, lots of us compile everything at once. It works
Is it possible to write and execute a D program without a main
function?
Most of my programs will start with some `import` statements,
followed by any functions and then ending with the `main`
function (e.g. `void main() {`).
As I am just a beginner to programming and still new to D, I have
I'm trying to find the needle in the hay that's an array of
strings. So the second assert fails for some reason. Is this
expected? https://run.dlang.io/is/7OrZTA
```
#!/usr/bin/rdmd
void main()
{
import std.experimental.all;
string s1 = "aaa111aaa";
string s2 = "aaa222aaa";
On Friday, 7 December 2018 at 18:57:48 UTC, Dennis wrote:
On Friday, 7 December 2018 at 18:51:27 UTC, Arun Chandrasekaran
wrote:
Why is there a difference in the behavior?
Your first assert expression is looking for a string in a
larger string, your second expression looks for hay which is
On Friday, December 7, 2018 2:02:59 PM MST Samir via Digitalmars-d-learn
wrote:
> Is it possible to write and execute a D program without a main
> function?
>
> Most of my programs will start with some `import` statements,
> followed by any functions and then ending with the `main`
> function
Ok. Upon further investigation, I think I see what is going on.
Most of the repos I am skimming are for this year's Advent of
Code. They structure their repo with an `app.d` file which does
contain a `main` function but this program is structured such
that it imports the files I was looking
On Friday, December 7, 2018 2:42:33 PM MST Samir via Digitalmars-d-learn
wrote:
> Ok. Upon further investigation, I think I see what is going on.
> Most of the repos I am skimming are for this year's Advent of
> Code. They structure their repo with an `app.d` file which does
> contain a `main`
On Saturday, 8 December 2018 at 03:46:11 UTC, Adam D. Ruppe wrote:
On Saturday, 8 December 2018 at 03:37:56 UTC, Murilo wrote:
Hi guys, I have created an array of strings with "string[12] ps
string[12] isn't a range, but string[] is.
Try passing `ps[]` to the function instead of plain `ps`
On Saturday, 8 December 2018 at 03:37:56 UTC, Murilo wrote:
Hi guys, I have created an array of strings with "string[12] ps
string[12] isn't a range, but string[] is.
Try passing `ps[]` to the function instead of plain `ps` and see
what happens.
On Saturday, 8 December 2018 at 03:48:10 UTC, Murilo wrote:
Try passing `ps[]` to the function instead of plain `ps` and
see what happens.
How do I transform an array into a range?
With the slicing operator, [].
On Friday, December 7, 2018 8:46:11 PM MST Adam D. Ruppe via Digitalmars-d-
learn wrote:
> On Saturday, 8 December 2018 at 03:37:56 UTC, Murilo wrote:
> > Hi guys, I have created an array of strings with "string[12] ps
>
> string[12] isn't a range, but string[] is.
>
> Try passing `ps[]` to the
On Saturday, 8 December 2018 at 03:51:02 UTC, Adam D. Ruppe wrote:
On Saturday, 8 December 2018 at 03:48:10 UTC, Murilo wrote:
Try passing `ps[]` to the function instead of plain `ps` and
see what happens.
How do I transform an array into a range?
With the slicing operator, [].
Thank you
On Saturday, 8 December 2018 at 04:16:25 UTC, Adam D. Ruppe wrote:
On Saturday, 8 December 2018 at 04:11:03 UTC, Murilo wrote:
What is the difference between declaring "int[3] a = [1,2,3];"
and declaring "int[] a = [1,2,3];"? Is the first an array and
the second a range?
They are both
On Friday, 7 December 2018 at 20:28:37 UTC, Seb wrote:
On Friday, 7 December 2018 at 19:38:29 UTC, Arun Chandrasekaran
wrote:
On Friday, 7 December 2018 at 19:12:31 UTC, Seb wrote:
On Friday, 7 December 2018 at 18:51:27 UTC, Arun
Chandrasekaran wrote:
[...]
Alternatively to the answers
On Saturday, 8 December 2018 at 04:11:03 UTC, Murilo wrote:
What is the difference between declaring "int[3] a = [1,2,3];"
and declaring "int[] a = [1,2,3];"? Is the first an array and
the second a range?
They are both arrays, just the former one has a fixed size and
the latter does not.
Hi guys, I have created an array of strings with "string[12] ps =
["cat", "dog", "lion", "wolf", "coin", "chest", "money", "gold",
"A", "B", "C", "D"];".
I want to use the array as a range and I want to randomize it,
like I want to transform that into several other ranges with the
same
On Sunday, 6 May 2018 at 11:18:17 UTC, drug wrote:
On 06.05.2018 06:10, Binghoo Dang wrote:
hi,
I'm a Chinese, and I just have done the test. I also copied
some Japanese text from Dlang twitter channel and added some
Chinese wide punctuation Char.
And It's all seems displayed correctly.
35 matches
Mail list logo