On Thursday, 22 January 2015 at 05:56:40 UTC, tcak wrote:
I want to define alphanumeric characters in an easy way.
Something like that:
char[] arr = ['a'..'z', 'A'..'Z', '0'..'9'];
Though above example doesn't work. Is there any easy way to do
this?
I am trying to do something like EBNF def
On Thursday, 22 January 2015 at 05:56:40 UTC, tcak wrote:
I want to define alphanumeric characters in an easy way.
Something like that:
char[] arr = ['a'..'z', 'A'..'Z', '0'..'9'];
Though above example doesn't work. Is there any easy way to do
this?
I am trying to do something like EBNF def
I want to define alphanumeric characters in an easy way.
Something like that:
char[] arr = ['a'..'z', 'A'..'Z', '0'..'9'];
Though above example doesn't work. Is there any easy way to do
this?
I am trying to do something like EBNF definitions. So, I do not
want to use loops, or define every
On Wednesday, 21 January 2015 at 23:31:26 UTC, Nordlöw wrote:
This means that I need some kind of interface to extract all
the contents of each paragraph that is preceeded by a
heading with a specific id (say "H2_A") or content (say "More
important"). How do I accomplish that?
You can do th
On 1/18/15 11:22 PM, Jonathan M Davis via Digitalmars-d-learn wrote:
It suggests creating an empty masm386.bat file in a directory which is in
your path (e.g. C:\dm\bin), and then it'll just work, since masm386 will do
nothing. Still, I'm inclined to think that the makefile should be fixed so
tha
On 1/18/15 10:19 PM, Jonathan M Davis via Digitalmars-d-learn wrote:
On Sunday, January 18, 2015 23:21:43 jollie via Digitalmars-d-learn wrote:
Jonathan M Davis via Digitalmars-d-learn Wrote in message:
It's been a while since I did anything in Windows with D, and unfortunately,
I need to agai
anon:
It looks like what I need.
But what's the purpose of the last two empty arrays?
Bye,
bearophile
On Thursday, 22 January 2015 at 00:16:23 UTC, bearophile wrote:
anon:
I have the following C code, how can I do the same in D.
Info **info;
info = new Info*[hl + 2];
int r;
for(r = 0; r < hl; r++)
{
info[r] = new Info[vl + 2];
}
info[r] = NULL;
I suggest you to ignore ketmar, he's n
anon:
I have the following C code, how can I do the same in D.
Info **info;
info = new Info*[hl + 2];
int r;
for(r = 0; r < hl; r++)
{
info[r] = new Info[vl + 2];
}
info[r] = NULL;
I suggest you to ignore ketmar, he's not helping :-)
Is your code initializing info[r+1]?
This is rou
On Wednesday, 21 January 2015 at 23:44:52 UTC, anon wrote:
I have the following C code, how can I do the same in D.
Info **info;
info = new Info*[hl + 2];
int r;
for(r = 0; r < hl; r++)
{
info[r] = new Info[vl + 2];
}
info[r] = NULL;
anon
The super-literal translation:
Info** inf
anon:
I got it working with.
auto info = new Info[][](hl, vl);
and changing the logic so as not check for the NULL.
That's probably a better and simpler translation. I have tried to
translate your original code too much literally.
Bye,
bearophile
On Wednesday, 21 January 2015 at 23:59:34 UTC, ketmar via
Digitalmars-d-learn wrote:
On Wed, 21 Jan 2015 23:50:59 +
anon via Digitalmars-d-learn
wrote:
On Wednesday, 21 January 2015 at 23:47:46 UTC, ketmar via
Digitalmars-d-learn wrote:
> On Wed, 21 Jan 2015 23:44:49 +
> anon via Di
On Wed, 21 Jan 2015 23:50:59 +
anon via Digitalmars-d-learn wrote:
> On Wednesday, 21 January 2015 at 23:47:46 UTC, ketmar via
> Digitalmars-d-learn wrote:
> > On Wed, 21 Jan 2015 23:44:49 +
> > anon via Digitalmars-d-learn
> > wrote:
> >
> >> I have the following C code, how can I do
On Wednesday, 21 January 2015 at 23:47:46 UTC, ketmar via
Digitalmars-d-learn wrote:
On Wed, 21 Jan 2015 23:44:49 +
anon via Digitalmars-d-learn
wrote:
I have the following C code, how can I do the same in D.
Info **info;
info = new Info*[hl + 2];
int r;
for(r = 0; r < hl; r++)
{
On Wed, 21 Jan 2015 23:44:49 +
anon via Digitalmars-d-learn wrote:
> I have the following C code, how can I do the same in D.
>
> Info **info;
> info = new Info*[hl + 2];
>
> int r;
> for(r = 0; r < hl; r++)
> {
> info[r] = new Info[vl + 2];
> }
> info[r] = NULL;
>
> anon
this is not
I have the following C code, how can I do the same in D.
Info **info;
info = new Info*[hl + 2];
int r;
for(r = 0; r < hl; r++)
{
info[r] = new Info[vl + 2];
}
info[r] = NULL;
anon
I'm trying to figure out how to most easily extract structured
information using Adam D Ruppe's dom.d.
Typically I want the following HTML example
...
More important
This is important.
Less important
This is not important.
...
to be reduced to
This is important.
This means that I nee
On Wednesday, 21 January 2015 at 17:14:29 UTC, Meta wrote:
On Wednesday, 21 January 2015 at 08:23:44 UTC, Per Nordlöw
wrote:
On Wednesday, 21 January 2015 at 08:22:44 UTC, Per Nordlöw
wrote:
int x;
auto ref xr;
Correction: I, of course mean,
int x = 42;
auto ref xr = x;
Walter is
On Wednesday, 21 January 2015 at 17:14:29 UTC, Meta wrote:
Walter is strongly against adding references a la C++ to D, as
he believes they are too complicated and bug prone. He's made
several posts on this, but I can't find them now.
It would be interesting to read about how Walter thinks here
On Wednesday, 21 January 2015 at 13:07:11 UTC, Nordlöw wrote:
On Wednesday, 21 January 2015 at 12:10:20 UTC, Nordlöw wrote:
On Wednesday, 21 January 2015 at 12:00:47 UTC, Nordlöw wrote:
My executable throws as
core.exception.InvalidMemoryOperationError@(0)
I've tracked it down to being cau
On Wednesday, 21 January 2015 at 18:08:44 UTC, bearophile wrote:
The sizeof values aren't relevant for D array casts. What
matters are the array "contents".
See:
void main() {
int[5] m = cast(int[5])[1, 2, 3, 4, 5];
assert(m == [1, 2, 3, 4, 5]);
pragma(msg, m.sizeof); // 20u
pr
The sizeof values aren't relevant for D array casts. What
matters are the array "contents".
See:
void main() {
int[5] m = cast(int[5])[1, 2, 3, 4, 5];
assert(m == [1, 2, 3, 4, 5]);
pragma(msg, m.sizeof); // 20u
pragma(msg, [1, 2, 3, 4, 5].sizeof); // 8u
}
Bye,
bearophile
On Wednesday, 21 January 2015 at 08:23:44 UTC, Per Nordlöw wrote:
On Wednesday, 21 January 2015 at 08:22:44 UTC, Per Nordlöw
wrote:
int x;
auto ref xr;
Correction: I, of course mean,
int x = 42;
auto ref xr = x;
Walter is strongly against adding references a la C++ to D, as he
On Wednesday, 21 January 2015 at 15:34:35 UTC, Per Nordlöw wrote:
On Wednesday, 21 January 2015 at 14:50:06 UTC, Ali Çehreli
wrote:
Known bug with a pull request:
https://issues.dlang.org/show_bug.cgi?id=13856
Here is the duplicate of it, which I've opened recently:
https://issues.dlang.org
On Wednesday, 21 January 2015 at 14:59:15 UTC, John Colvin wrote:
Looks like a bug to me, for sure.
In the mean-time you may be able to use some pragma(mangle,
...) hacks to force the compiler to emit the right symbols.
Thx John,
extern(C++, A.B) {
struct Type {}
pragma(mangle,"_ZN1A1B3f
On Wednesday, 21 January 2015 at 14:50:06 UTC, Ali Çehreli wrote:
Known bug with a pull request:
https://issues.dlang.org/show_bug.cgi?id=13856
Here is the duplicate of it, which I've opened recently:
https://issues.dlang.org/show_bug.cgi?id=14005
Ali
How can this affect Mmfile plus spl
On Wednesday, 21 January 2015 at 14:31:15 UTC, bearophile wrote:
Currently this is accepted:
int[2] m = cast(int[2])[1, 2];
But Kenji suggests that the cast from int[] to int[2][1] should
not be accepted. Do you know why?
Reference:
https://issues.dlang.org/show_bug.cgi?id=7514
Bye and than
Baz:
int[3] m = cast(int[3])[1, 2, 3];
writeln(m.sizeof);
writeln([1, 2, 3].sizeof);
The sizeof values aren't relevant for D array casts. What matters
are the array "contents".
Bye,
bearophile
On Tuesday, 20 January 2015 at 21:10:59 UTC, Guillaume Chatelet
wrote:
Consider the following foo.cpp
namespace A {
namespace B {
struct Type {};
int foo(Type unused){ return 42; }
}
}
Compile it : g++ foo.cpp -c -o foo.o
Then the following main.d
extern(C++, A.B) {
struct Type {}
int
On 01/21/2015 04:10 AM, "Nordlöw" wrote:
On Wednesday, 21 January 2015 at 12:00:47 UTC, Nordlöw wrote:
My executable throws as
core.exception.InvalidMemoryOperationError@(0)
I've tracked it down to being caused by
foreach (line; File(path).byLine) {}
when path contains a very large
On Wednesday, 21 January 2015 at 14:41:48 UTC, Baz wrote:
On Wednesday, 21 January 2015 at 14:31:15 UTC, bearophile wrote:
Currently this is accepted:
int[2] m = cast(int[2])[1, 2];
But Kenji suggests that the cast from int[] to int[2][1]
should not be accepted. Do you know why?
Reference:
Currently this is accepted:
int[2] m = cast(int[2])[1, 2];
But Kenji suggests that the cast from int[] to int[2][1] should
not be accepted. Do you know why?
Reference:
https://issues.dlang.org/show_bug.cgi?id=7514
Bye and thank you,
bearophile
On Wednesday, 21 January 2015 at 12:10:20 UTC, Nordlöw wrote:
On Wednesday, 21 January 2015 at 12:00:47 UTC, Nordlöw wrote:
My executable throws as
core.exception.InvalidMemoryOperationError@(0)
I've tracked it down to being caused by
foreach (line; File(path).byLine) {}
when path co
On Wednesday, 21 January 2015 at 12:00:47 UTC, Nordlöw wrote:
My executable throws as
core.exception.InvalidMemoryOperationError@(0)
I've tracked it down to being caused by
foreach (line; File(path).byLine) {}
when path contains a very large text file (392 MB, 1658080 lines).
Do I h
My executable throws as
core.exception.InvalidMemoryOperationError@(0)
when compiled with DMD git master.
I get no stack trace in GDB.
What to do?
You can ask to add a keyword to bugzilla for C++ issues, this can
help to improve their visibility and searchability.
Why doesn't D allow declarations such as
int x;
auto ref xr;
?
What is so fundamentally bad about this compared to foreach
variables and function arguments passed by reference?
Will Walters latest commits regarding
http://wiki.dlang.org/DIP25
change this matter?
On Wednesday, 21 January 2015 at 08:22:44 UTC, Per Nordlöw wrote:
int x;
auto ref xr;
Correction: I, of course mean,
int x = 42;
auto ref xr = x;
38 matches
Mail list logo