On Monday, 4 September 2023 at 07:39:21 UTC, confused wrote:
So then I guess I'd still like to know how I'm expected to
store and access an array of characters without the C runtime
as I tried in my original post.
You are going to allocate memory using the system call of your
operation syst
On Monday, 4 September 2023 at 07:39:21 UTC, confused wrote:
So then I guess I'd still like to know how I'm expected to
store and access an array of characters without the C runtime
as I tried in my original post.
Without C runtime functions such as malloc you can still have
fixed-length ar
On Saturday, 2 September 2023 at 07:59:31 UTC, Jonathan M Davis
wrote:
If you put it into a package, then you could have your own
object module that then isn't at the top level - e.g.
mypkg/object.d with
module mypkg.object;
but you can't have more than one module in your program with
the sa
On Saturday, September 2, 2023 4:38:41 AM BST confused via Digitalmars-d-learn
wrote:
> On Friday, 1 September 2023 at 13:45:05 UTC, evilrat wrote:
> > It is shadowing default implicit "import object;", here a
> > demonstration
> >
> > ```d
> > // this example shows default implicit import of "obj
On Saturday, 2 September 2023 at 03:27:51 UTC, confused wrote:
So I guess my next question is why, exactly, classes *can*, in
fact, be implemented in ``` betterC ```, but are not?
IIRC you can have extern(C++) classes in betterC, the real issue
is the plain extern(D) classes which has some ass
On Saturday, 2 September 2023 at 03:18:31 UTC, confused wrote:
On Friday, 1 September 2023 at 13:31:37 UTC, bachmeier wrote:
You can read the documentation for object.d
[here](https://dlang.org/phobos/object.html). It's kind of
important.
I'm not sure which specific part of the documentation
On Friday, 1 September 2023 at 13:45:05 UTC, evilrat wrote:
It is shadowing default implicit "import object;", here a
demonstration
```d
// this example shows default implicit import of "object" module
// compile this example:
// ldc2 -c test.d
// output:
// tuple("object", "core", "main",
On Saturday, 2 September 2023 at 01:05:39 UTC, ryuukk_ wrote:
If you are looking for a better C you are not looking for
classes
You contradict yourself
If you heard about betterC, then you heard about this:
https://dlang.org/spec/betterc.html
Read it again, and specially this part:
https:
On Friday, 1 September 2023 at 13:31:37 UTC, bachmeier wrote:
You can read the documentation for object.d
[here](https://dlang.org/phobos/object.html). It's kind of
important.
I'm not sure which specific part of the documentation was
supposed to illuminate the exact nature of that error.
On Friday, 1 September 2023 at 13:17:08 UTC, confused wrote:
On Friday, 1 September 2023 at 08:19:55 UTC, Richard (Rikki)
Andrew Cattermole wrote:
``size_t`` is defined in ``object.d`` which is implicitly
imported into all modules.
If it cannot be found, one of three things is happening:
1) Y
On Friday, 1 September 2023 at 13:17:08 UTC, confused wrote:
On Friday, 1 September 2023 at 08:19:55 UTC, Richard (Rikki)
Andrew Cattermole wrote:
``size_t`` is defined in ``object.d`` which is implicitly
imported into all modules.
If it cannot be found, one of three things is happening:
1) Y
On Friday, 1 September 2023 at 13:17:08 UTC, confused wrote:
On Friday, 1 September 2023 at 08:19:55 UTC, Richard (Rikki)
Andrew Cattermole wrote:
``size_t`` is defined in ``object.d`` which is implicitly
imported into all modules.
If it cannot be found, one of three things is happening:
1) Y
On Friday, 1 September 2023 at 08:19:55 UTC, Richard (Rikki)
Andrew Cattermole wrote:
``size_t`` is defined in ``object.d`` which is implicitly
imported into all modules.
If it cannot be found, one of three things is happening:
1) You have messed with some cli args related to picking
druntime
``size_t`` is defined in ``object.d`` which is implicitly imported into
all modules.
If it cannot be found, one of three things is happening:
1) You have messed with some cli args related to picking druntime/phobos
2) You have defined a module called object.
3) You have a broken compiler instal
On Thursday, 31 August 2023 at 18:42:57 UTC, Richard (Rikki)
Andrew Cattermole wrote:
```d
extern(C) int main()
{
import core.stdc.stdio;
string hello = "hello";
printf(hello.ptr);
return 0;
}
```
1) You forgot to import ``core.stdc.stdio``
2) String literal is of type string (
```d
extern(C) int main()
{
import core.stdc.stdio;
string hello = "hello";
printf(hello.ptr);
return 0;
}
```
1) You forgot to import ``core.stdc.stdio``
2) String literal is of type string (which is an alias to
``immutable(char)[]``).
3) A slice is a pointer + length, and C d
I decided to try out betterC with the most trivial example I
could think of, but why doesn't this work?
```d
extern(C) int main()
{
char[] hello = "hello";
printf(hello);
return 0;
}
```
17 matches
Mail list logo