OpenD update - null pointer error shipped, among others
Adam D. Ruppe
destructionator at gmail.com
Wed Jun 11 16:03:10 UTC 2025
On Wednesday, 11 June 2025 at 13:17:26 UTC, Element Green wrote:
>> * `import("file")` will just work if file is located next to
>> the source file.
Here's my blog announcement about this:
https://dpldocs.info/this-week-in-d/Blog.Posted_2024_09_30.html#import-expressions-do-not-always-need--j
Note that it is different than `-J.`. Upstream -J. loads the
import("file") from the *build* directory, OpenD import("file"),
without requiring a cmd line switch, builds from the *source*
directory.
As a library author and distributor, I find this behavior a lot
more useful - compiled-in files are extensions of the source
code, so it makes sense to put them with the source code. And
when you use multiple libraries, they probably don't want to
overwrite and override each other, so encapsulating it to the lib
is sure to work better.
Of course, the same rules work for your own application code too,
you can import stuff from your source in your modules too, it all
just works out of the box. And then you can assign it to
immutable byte arrays or strings (if you use `auto` it is a
string for historical reasons - remember opend aims to be more
stable than upstream as well, unless there's a compelling benefit
to justify the change - but if you specify `immutable(ubyte)[]`,
it just works, no cast necessary. I think this is also true
upstream nowadays.)
I've been pretty happy with it.
> favorite and things I have encountered before that I thought
> should work, but didn't.
Yes, exactly. I've been writing D for about 19 years now, there's
some things I just got used to so I have my blind spots, but
there's also things that I still think ought to just work. OpenD
is getting closer and closer to plugging these holes though.
As you can see from the commits, most of these aren't terribly
complicated to implement.
(some things that are more complicated to implement is like
`if(auto x; tryGetFoo(x))`, we're still working on that,
hopefully some day. but in the mean time when pain hits, we're
open to fixing it)
More information about the Digitalmars-d-announce
mailing list