Re: ugly and/or useless features in the language.

2021-05-23 Thread Mike Parker via Digitalmars-d-learn
On Sunday, 23 May 2021 at 14:13:36 UTC, Alain De Vos wrote: This one compiles without any problem. Maybe someone can enlighten us on the status of scope(d)-variables and dip-1000. It is not fully clear for me. ``` import std.stdio; void main() @trusted { int *q=null; { int a;

Re: ugly and/or useless features in the language.

2021-05-23 Thread z via Digitalmars-d-learn
On Saturday, 15 May 2021 at 14:31:08 UTC, Alain De Vos wrote: Which parts in dlang don't you use and why ? Auto return types i find dangerous to use. I found `auto` and `ref`(yes just `ref`) return types very useful for bypassing the type system, eg.: ```D ///function requires lvalue and

Re: ugly and/or useless features in the language.

2021-05-23 Thread Dennis via Digitalmars-d-learn
On Sunday, 23 May 2021 at 14:13:36 UTC, Alain De Vos wrote: This one compiles without any problem. You annotated main `@trusted`, which means you want the compiler to assume it to be `@safe` without checking it. Mark it `@safe` and it reports: Error: address of variable `a` assigned to `q`

Re: ugly and/or useless features in the language.

2021-05-23 Thread Alain De Vos via Digitalmars-d-learn
This one compiles without any problem. Maybe someone can enlighten us on the status of scope(d)-variables and dip-1000. It is not fully clear for me. ``` import std.stdio; void main() @trusted { int *q=null; { int a; q= } *q=5; } ```

Re: ugly and/or useless features in the language.

2021-05-23 Thread Ola Fosheim Grostad via Digitalmars-d-learn
On Sunday, 23 May 2021 at 12:08:31 UTC, Alain De Vos wrote: It is sufficient to have a bit complex gui and database access and the @safe annotation can nowhere be used in your program. The compiler misses scopes checks without. I think you are supposed to use @trusted to tell the compiler

Re: ugly and/or useless features in the language.

2021-05-23 Thread Alain De Vos via Digitalmars-d-learn
It is sufficient to have a bit complex gui and database access and the @safe annotation can nowhere be used in your program. The compiler misses scopes checks without.

Re: ugly and/or useless features in the language.

2021-05-23 Thread Ola Fosheim Grostad via Digitalmars-d-learn
On Sunday, 23 May 2021 at 10:24:53 UTC, Ola Fosheim Grostad wrote: On Sunday, 23 May 2021 at 08:35:31 UTC, Tony wrote: On Saturday, 15 May 2021 at 21:15:01 UTC, Ola Fosheim Grostad wrote: Why is metaprogramming added features better than the same features added in the language? One is standard

Re: ugly and/or useless features in the language.

2021-05-23 Thread Ola Fosheim Grostad via Digitalmars-d-learn
On Sunday, 23 May 2021 at 08:35:31 UTC, Tony wrote: On Saturday, 15 May 2021 at 21:15:01 UTC, Ola Fosheim Grostad wrote: Why is metaprogramming added features better than the same features added in the language? One is standard between entities, the other is not. There are many reasons, one

Re: ugly and/or useless features in the language.

2021-05-23 Thread sighoya via Digitalmars-d-learn
On Sunday, 23 May 2021 at 08:35:31 UTC, Tony wrote: Why is metaprogramming added features better than the same features added in the language? One is standard between entities, the other is not. Some points: - Some features aren't general enough to be added as builtin but make sense to have

Re: ugly and/or useless features in the language.

2021-05-23 Thread Tony via Digitalmars-d-learn
On Saturday, 15 May 2021 at 21:15:01 UTC, Ola Fosheim Grostad wrote: On Saturday, 15 May 2021 at 14:31:08 UTC, Alain De Vos wrote: In general it is better to have fewer features and instead improve metaprogramming so that missing features can be done in a library. Why is

Re: ugly and/or useless features in the language.

2021-05-22 Thread Ola Fosheim Grostad via Digitalmars-d-learn
On Saturday, 22 May 2021 at 17:32:34 UTC, sighoya wrote: But I think providing an external ast tree mapped onto the changing internal one used by DMD would be a feasible approach. It is feasible, but if you want to do it well you should think in terms of rewrite engines with patternmatching,

Re: ugly and/or useless features in the language.

2021-05-22 Thread sighoya via Digitalmars-d-learn
On Saturday, 22 May 2021 at 13:31:45 UTC, Ola Fosheim Grøstad wrote: The D AST is not really suitable as it stands. D is a bit like C++ in this regard, there might be a minimal core language that could be distilled from it, but it would take a D3 full breaking change to get there, so it

Re: ugly and/or useless features in the language.

2021-05-22 Thread Ola Fosheim Grøstad via Digitalmars-d-learn
On Saturday, 22 May 2021 at 13:26:38 UTC, sighoya wrote: But the more general problem in D are not features per se, but how they are composed of. For instance: Why no AST macros instead of string mixins, templates, mixin templates and alias? All these forms could be special ast macros. I

Re: ugly and/or useless features in the language.

2021-05-22 Thread sighoya via Digitalmars-d-learn
On Saturday, 15 May 2021 at 14:31:08 UTC, Alain De Vos wrote: Which parts in dlang don't you use and why ? Well, I don't like magic constructs in the language like the type of AliasSeq you can't touch. But the more general problem in D are not features per se, but how they are composed of.

Re: ugly and/or useless features in the language.

2021-05-18 Thread Alain De Vos via Digitalmars-d-learn
For a number it's best to have something you know how many bytes it takes in memory.

Re: ugly and/or useless features in the language.

2021-05-18 Thread Alain De Vos via Digitalmars-d-learn
Knowing the number of bytes in memory is a good thing.

Re: ugly and/or useless features in the language.

2021-05-17 Thread Berni44 via Digitalmars-d-learn
On Saturday, 15 May 2021 at 14:31:08 UTC, Alain De Vos wrote: Which parts in dlang don't you use and why? There is one feature (actually a mix of features) I'd be happy not to use, but it is not possible: I call it autoreals, because it resembles somewhat the idea behind autodecoding - in

Re: ugly and/or useless features in the language.

2021-05-17 Thread Ola Fosheim Grostad via Digitalmars-d-learn
On Sunday, 16 May 2021 at 16:16:22 UTC, H. S. Teoh wrote: I cannot live without auto return types and Voldemort types. They are my bread and butter. Take them away, and I might as well go back to C/C++. C++ has both? What I find ugly: - shared, and all of its quirks and incomplete

Re: ugly and/or useless features in the language.

2021-05-16 Thread H. S. Teoh via Digitalmars-d-learn
On Sat, May 15, 2021 at 02:31:08PM +, Alain De Vos via Digitalmars-d-learn wrote: > Which parts in dlang don't you use and why ? > > Personally i have no need for enum types, immutable is doing fine. > Auto return types i find dangerous to use. > Voldermont types. > Named initialiser. >

Re: ugly and/or useless features in the language.

2021-05-15 Thread zjh via Digitalmars-d-learn
I want to be able to support CP936, not just UTF8. I can't use CP936. It's my pet peeve. Hopefully we can solve the coding problem just like Python with #encoding= GBK.

Re: ugly and/or useless features in the language.

2021-05-15 Thread Ola Fosheim Grostad via Digitalmars-d-learn
On Saturday, 15 May 2021 at 14:31:08 UTC, Alain De Vos wrote: Feature creep can make your own code unreadable. Having many ways to express the same concept makes code harder to read. This is an issue in C++, but you can combat it by creating coding norms. In general it is better to have