On 2020-09-19 04:45, tspike wrote:
I’ve been using D for personal projects for almost a year now and I
really love it. I recently ran across a linker error that I’m a little
confused by. Consider the following files:
platform.d:
module platform;
import app;
struct PlatformDat
On 2020-09-17 16:58, drathier wrote:
What's the proper way to exit with a specific exit code?
I found a bunch of old threads discussing this, making sure destructors
run and the runtime terminates properly, all of which seemingly
concluding that it's sad that there isn't a way to do this easil
On 2020-09-18 13:41, Russel Winder wrote:
Hi,
I am trying to get to grips with DDoc for documenting an application. Getting
the individual module HTML files seems to be the easy bit. The question is how
to get an index.html (or equivalent) so as to have an application level entry
point to the ge
On Wednesday, 2 September 2020 at 03:52:55 UTC, JG wrote:
Thank you all for the interesting suggestions.
Still thinking about this from time to time.
Other than the suggestions given, this is what I have
been playing around with.
-
import std.stdio;
import std.
I’ve been using D for personal projects for almost a year now and
I really love it. I recently ran across a linker error that I’m a
little confused by. Consider the following files:
platform.d:
module platform;
import app;
struct PlatformData
{
AppData a;
}
v
On 9/18/20 9:35 AM, Russel Winder wrote:
On Fri, 2020-09-18 at 09:02 -0400, Steven Schveighoffer via Digitalmars-d-
learn wrote:
[…]
it ddoc files, and compile those along with your
application.
https://dlang.org/spec/ddoc.html#using_ddoc_for_other_documentation
Any small project examples
On Thursday, 17 September 2020 at 09:53:57 UTC, Remi wrote:
My problem here is mostly understanding the __initZ symbol and
where it comes from.
The compiler generates that when it spits out something that uses
TypeInfo, which is a lot of things: ~= and ~ operators on built
in arrays, the new
On Friday, 18 September 2020 at 00:07:12 UTC, wjoe wrote:
Are there other frameworks besides vibe that can do what I want?
Just FYI, there is also:
https://code.dlang.org/packages/hunt-framework
I never used myself, you need to investigate.
On Friday, 18 September 2020 at 22:02:07 UTC, aberba wrote:
In this case you want to get the file(s) in memory...in the
form of bytes (or buffer) and probably set a file size limit.
Its all doable through a library but such a library doesn't
exist in D yet. At least not that I know of.
I actu
On Friday, 18 September 2020 at 00:07:12 UTC, wjoe wrote:
On Thursday, 17 September 2020 at 22:33:46 UTC, Steven
Schveighoffer wrote:
On 9/17/20 6:13 PM, aberba wrote:
On Thursday, 17 September 2020 at 21:57:37 UTC, Steven
Schveighoffer wrote:
On 9/17/20 1:08 PM, wjoe wrote:
[...]
the `file
On Wednesday, 16 September 2020 at 00:22:15 UTC, Steven
Schveighoffer wrote:
On 9/15/20 8:10 PM, James Blachly wrote:
On 9/15/20 10:59 AM, Steven Schveighoffer wrote:
[...]
Steve: It sounds as if the spec is correct but the glyph
(codepoint?) range is outdated. If this is the case, it would
On Friday, 18 September 2020 at 14:14:31 UTC, Andrey Zherikov
wrote:
It seems that dtor is called at exit from lazy delegate, not at
exit form create():
==
create()
.do_something()
.do_lazy()
.do_something();
==
Output:
==
-> void test.main()
-> test.do_lazy(lazy S s)
On Friday, 18 September 2020 at 18:20:41 UTC, Andrey Zherikov
wrote:
How can I rewrite foo() function as a free-function that won't
cause struct copying?
I found solution:
struct S
{
int i = -1;
this(int n) {i=n;writeln(&this," ",i,"
",__PRETTY_FUNCTION__);}
this(ref retur
On Friday, 18 September 2020 at 18:43:38 UTC, H. S. Teoh wrote:
Why can't you return by ref, which would also avoid the copying?
ref S foo(return ref S s) { return s; }
Compiler errors out:
onlineapp.d(9): Error: function onlineapp.foo(return ref S s) is
not callable using argument ty
On Fri, Sep 18, 2020 at 06:20:41PM +, Andrey Zherikov via
Digitalmars-d-learn wrote:
> How can I rewrite foo() function as a free-function that won't cause
> struct copying? My simplified code is:
>
> struct S
> {
> ref S foo() return
> {
> return this;
> }
> }
>
How can I rewrite foo() function as a free-function that won't
cause struct copying? My simplified code is:
struct S
{
ref S foo() return
{
return this;
}
}
void main()
{
S().foo().foo().foo();
}
If I write it like "auto foo(S s) { return s; }" then stat
On Tuesday, 15 September 2020 at 16:23:01 UTC, Jon Degenhardt
wrote:
# The 'Ш' and 'ä' characters are fine.
$ echo $'import std.stdio; void Шä() { writeln("Hello World!");
} void main() { Шä(); }' | dmd -run -
Hello World!
# But not '∂'
$ echo $'import std.stdio; void x∂() { writeln("Hello W
On Friday, 18 September 2020 at 14:15:27 UTC, Steven
Schveighoffer wrote:
On 9/18/20 7:38 AM, wjoe wrote:
[...]
There are other options.
for instance dub (the project) has a library and an
application. the config looks like this:
configuration "application" {
targetType "executable
On Friday, 18 September 2020 at 14:01:55 UTC, Mike Parker wrote:
On Friday, 18 September 2020 at 12:28:30 UTC, wjoe wrote:
2 issues though.
- It doesn't build the library automatically, and
You'll have to invoke dub once for each config. Just slap both
commands in a script.
- Linking fail
On Fri, Sep 18, 2020 at 08:20:59AM +, IGotD- via Digitalmars-d-learn wrote:
> On Friday, 18 September 2020 at 05:02:21 UTC, H. S. Teoh wrote:
> >
> > That's the obvious solution, except that actually implementing it is not
> > so simple. When you have multiple threads listening for each other
On 2020-09-17 05:16, Paul Backus wrote:
Worth knowing that the tuples you get from enumerate actually have named
members, so you can write:
s.enumerate.each!(x => writeln(x.index, ":", x.value));
It actually works out of the box for `each`:
s.each!((index, value) => writeln(index, ":",
On 9/18/20 7:38 AM, wjoe wrote:
Something like this:
configuration "lib" {
targetType "dynamicLibrary"
sourceDir "source/lib/"
}
configuration "app" {
targetType "executable"
sourceFiles "source/app.d"
linkWith "lib"
}
I found subConfiguration in the docs but that seems to be re
On Friday, 18 September 2020 at 13:28:39 UTC, Simen Kjærås wrote:
Indeed. As we can see from the output, first do_lazy() is
called from test.main, then create() is called (this happens
inside do_lazy, as s is lazy). When create() returns, the
scoped!S you created goes out of scope and is destro
On Friday, 18 September 2020 at 12:28:30 UTC, wjoe wrote:
2 issues though.
- It doesn't build the library automatically, and
You'll have to invoke dub once for each config. Just slap both
commands in a script.
- Linking fails because error: ld: cannot find -llib
Built it manually via dub
On 2020-09-16 21:04, Vladimirs Nordholm wrote:
Ah, I guess it boils down to this then. Doesn't really make it "neater",
but thank you for the tip!
You only need to declare the enums ones.
--
/Jacob Carlborg
On 9/18/20 4:30 PM, drug wrote:
Can't you put a var on the stack?
```
auto instance = create();
instance
.do_lazy()
.do_something();
```
Ah, I totally missed your point. Now I see you can't...
On Fri, 2020-09-18 at 09:02 -0400, Steven Schveighoffer via Digitalmars-d-
learn wrote:
[…]
>
> it ddoc files, and compile those along with your
> application.
>
> https://dlang.org/spec/ddoc.html#using_ddoc_for_other_documentation
>
Any small project examples anywhere?
--
Russel.
=
Can't you put a var on the stack?
```
auto instance = create();
instance
.do_lazy()
.do_something();
```
On Friday, 18 September 2020 at 12:32:49 UTC, Andrey Zherikov
wrote:
==
The output is:
==
-> void test.main()
-> test.do_lazy(lazy S s)
-> test.create()
1 S test.S.this(int n)
<- test.create()
1 void test.S.~this()
===-1 (2)
<- test.do_lazy(lazy S s)
-> 1703096 te
On Friday, 18 September 2020 at 12:58:29 UTC, Steven
Schveighoffer wrote:
On 9/18/20 8:39 AM, Steven Schveighoffer wrote:
But again, solved with an enhancement that allows you to
process the data in your code. I'll file the enhancement
request for you, as I think it's a nice addition.
https:/
On Friday, 18 September 2020 at 12:39:43 UTC, Steven
Schveighoffer wrote:
On 9/17/20 8:07 PM, wjoe wrote:
[...]
See the code here:
https://github.com/vibe-d/vibe.d/blob/ebebfa827f568cc9bced4bec2b66edc043a8adf7/inet/vibe/inet/webform.d#L311
[...]
No, not at the moment. Which is why I was
On 9/18/20 7:41 AM, Russel Winder wrote:
Hi,
I am trying to get to grips with DDoc for documenting an application. Getting
the individual module HTML files seems to be the easy bit. The question is how
to get an index.html (or equivalent) so as to have an application level entry
point to the gen
On 9/18/20 8:39 AM, Steven Schveighoffer wrote:
But again, solved with an enhancement that allows you to process the
data in your code. I'll file the enhancement request for you, as I think
it's a nice addition.
https://github.com/vibe-d/vibe.d/issues/2478
-Steve
On 9/17/20 8:07 PM, wjoe wrote:
Not a reply to this post in particular but to all the ones I've read so
far.
If I understand correctly. Vibe parses the form data and writes all
files to disk. Where to ?
See the code here:
https://github.com/vibe-d/vibe.d/blob/ebebfa827f568cc9bced4bec2b66e
On Friday, 18 September 2020 at 11:31:39 UTC, Simen Kjærås wrote:
On Friday, 18 September 2020 at 10:43:47 UTC, Andrey Zherikov
wrote:
Why is dtor called before returning from do_lazy function -
see (1)? It seems cause uninitialized parameter in
do_something call after it in (2)-(3).
As ikod
On Friday, 18 September 2020 at 12:03:45 UTC, Mike Parker wrote:
On Friday, 18 September 2020 at 11:38:14 UTC, wjoe wrote:
Something like this:
configuration "lib" {
targetType "dynamicLibrary"
sourceDir "source/lib/"
}
configuration "app" {
targetType "executable"
sourceFiles "source/
On Friday, 18 September 2020 at 10:54:41 UTC, ikod wrote:
On Friday, 18 September 2020 at 10:43:47 UTC, Andrey Zherikov
wrote:
I have this code:
==
class S
...
auto create()
{
writeln("-> ",__PRETTY_FUNCTION__);
scope(exit) writeln("<- ",__PRETTY_FUNCTION__);
return scop
On Friday, 18 September 2020 at 11:38:14 UTC, wjoe wrote:
Something like this:
configuration "lib" {
targetType "dynamicLibrary"
sourceDir "source/lib/"
}
configuration "app" {
targetType "executable"
sourceFiles "source/app.d"
linkWith "lib"
}
I found subConfiguration in the docs bu
On Friday, 18 September 2020 at 11:38:14 UTC, wjoe wrote:
Something like this:
configuration "lib" {
targetType "dynamicLibrary"
sourceDir "source/lib/"
}
configuration "app" {
targetType "executable"
sourceFiles "source/app.d"
linkWith "lib"
}
I found subConfiguration in the docs bu
On Friday, 18 September 2020 at 11:44:39 UTC, Atwork wrote:
On Friday, 18 September 2020 at 00:07:12 UTC, wjoe wrote:
And if not, how is data processed with a 10mb file upload
followed by a few number fields ?
It needs to read all of the file data to get to the other data
fields, doesn't it ?
On Friday, 18 September 2020 at 00:07:12 UTC, wjoe wrote:
And if not, how is data processed with a 10mb file upload
followed by a few number fields ?
It needs to read all of the file data to get to the other data
fields, doesn't it ?
Yes and no
configuration "app" {
versions "CLI"
target "executable"
...
}
configuration "guiapp" : "app" {
versions "GUI"
sourceFiles "source/gui.d"
}
The guiapp should basically inherit the "app" configuration and
extend/override whatever else is needed/different.
Hi,
I am trying to get to grips with DDoc for documenting an application. Getting
the individual module HTML files seems to be the easy bit. The question is how
to get an index.html (or equivalent) so as to have an application level entry
point to the generated documentation.
--
Russel.
===
Something like this:
configuration "lib" {
targetType "dynamicLibrary"
sourceDir "source/lib/"
}
configuration "app" {
targetType "executable"
sourceFiles "source/app.d"
linkWith "lib"
}
I found subConfiguration in the docs but that seems to be related
to external dependencies.
app
On Friday, 18 September 2020 at 10:43:47 UTC, Andrey Zherikov
wrote:
Why is dtor called before returning from do_lazy function - see
(1)? It seems cause uninitialized parameter in do_something
call after it in (2)-(3).
As ikod mentions, it's because of scoped!S. As for why it does
this, yeah,
I see that:
https://dlang.org/spec/ddoc.html
refers to:
https://docs.oracle.com/javase/7/docs/technotes/guides/javadoc/index.html
which is really rather ancient and definitely out of date. Should change this
to:
https://docs.oracle.com/en/java/javase/15/javadoc/index.html
--
Russel.
===
On Friday, 18 September 2020 at 10:43:47 UTC, Andrey Zherikov
wrote:
I have this code:
==
class S
...
auto create()
{
writeln("-> ",__PRETTY_FUNCTION__);
scope(exit) writeln("<- ",__PRETTY_FUNCTION__);
return scoped!S(1);
}
If you replace this line with "return new S(1)
I have this code:
==
class S
{
int i = -1;
this(int n) { i = n; writeln(i," ",__PRETTY_FUNCTION__); }
~this() { writeln(i," ",__PRETTY_FUNCTION__); }
}
auto create()
{
writeln("-> ",__PRETTY_FUNCTION__);
scope(exit) writeln("<- ",__PRETTY_FUNCTION__);
return sco
On Friday, 18 September 2020 at 06:43:12 UTC, Simen Kjærås wrote:
On Friday, 18 September 2020 at 05:43:56 UTC, data pulverizer
That's issue 1997: https://issues.dlang.org/show_bug.cgi?id=1997
D's templates are turing complete, and there may be arbitrary
amounts of logic obscuring the mapping
On Friday, 18 September 2020 at 05:02:21 UTC, H. S. Teoh wrote:
That's the obvious solution, except that actually implementing
it is not so simple. When you have multiple threads listening
for each other and/or doing work, there is no 100% guaranteed
way of cleanly shutting all of them down
On Friday, 18 September 2020 at 02:49:30 UTC, Mike Parker wrote:
On Thursday, 17 September 2020 at 22:25:47 UTC, claptrap wrote:
If enum means manifiest constant, or compile time constant,
then it makes more sense, as you allude to in a later post.
But 'enum' is a terrible name for that and I
On Monday, 7 September 2020 at 19:12:59 UTC, aberba wrote:
On Monday, 7 September 2020 at 16:18:00 UTC, IGotD- wrote:
On Monday, 7 September 2020 at 15:23:28 UTC, Severin Teona
wrote:
[...]
Use betterC, which is much better suited for microcontrollers
than the full D. The disadvantage is tha
On Thursday, 17 September 2020 at 19:27:41 UTC, Adam D. Ruppe
wrote:
fyi my baby was just born i'll come back to this but it might
be a day or two
Oh probably most unexpected answer! Congratulations!
Had 4 weeks myself, take care of your family, everything else can
wait ;)
53 matches
Mail list logo