Re: byte array to string

2021-02-24 Thread Mike via Digitalmars-d-learn
On Thursday, 25 February 2021 at 06:58:51 UTC, FeepingCreature wrote: On Thursday, 25 February 2021 at 06:57:57 UTC, FeepingCreature wrote: On Thursday, 25 February 2021 at 06:47:11 UTC, Mike wrote: hi all, If i have an array: byte[3] = [1,2,3]; How to get string "123" from it? Thanks in

Re: string to type

2021-02-24 Thread Виталий Фадеев via Digitalmars-d-learn
On Thursday, 25 February 2021 at 06:53:28 UTC, Виталий Фадеев wrote: On Thursday, 25 February 2021 at 06:51:11 UTC, Виталий Фадеев wrote: Say, please, how to convert string to type ? [...] Simple version of this question is: string t = "X"; mixin t!(); // <-- HERE TROUBLE I was

Re: byte array to string

2021-02-24 Thread FeepingCreature via Digitalmars-d-learn
On Thursday, 25 February 2021 at 06:47:11 UTC, Mike wrote: hi all, If i have an array: byte[3] = [1,2,3]; How to get string "123" from it? Thanks in advance. string str = format!"%(%s)"(array);

Re: byte array to string

2021-02-24 Thread FeepingCreature via Digitalmars-d-learn
On Thursday, 25 February 2021 at 06:57:57 UTC, FeepingCreature wrote: On Thursday, 25 February 2021 at 06:47:11 UTC, Mike wrote: hi all, If i have an array: byte[3] = [1,2,3]; How to get string "123" from it? Thanks in advance. string str = format!"%(%s)"(array); Er sorry, typo, that

string to type

2021-02-24 Thread Виталий Фадеев via Digitalmars-d-learn
Say, please, how to convert string to type ? Is: interface IX { // } mixin template X() { // } // Mixin templates to class. // Scan class interfaces, then mix mixin template Members() { alias T = typeof( this ); static

Re: string to type

2021-02-24 Thread Виталий Фадеев via Digitalmars-d-learn
On Thursday, 25 February 2021 at 06:51:11 UTC, Виталий Фадеев wrote: Say, please, how to convert string to type ? [...] Simple version of this question is: string t = "X"; mixin t!(); // <-- HERE TROUBLE

byte array to string

2021-02-24 Thread Mike via Digitalmars-d-learn
hi all, If i have an array: byte[3] = [1,2,3]; How to get string "123" from it? Thanks in advance.

Re: DUB is not working correctly

2021-02-24 Thread Maxim via Digitalmars-d-learn
On Wednesday, 24 February 2021 at 20:28:45 UTC, Siemargl wrote: On Wednesday, 24 February 2021 at 20:10:29 UTC, Siemargl wrote: Works fine on void dub init project, but underscore problem whith dsfml still here I think, its a problem with dsfml project. You can see it in

Re: DUB is not working correctly

2021-02-24 Thread Maxim via Digitalmars-d-learn
On Wednesday, 24 February 2021 at 20:10:29 UTC, Siemargl wrote: On Wednesday, 24 February 2021 at 19:48:10 UTC, Siemargl wrote: On Wednesday, 24 February 2021 at 19:42:05 UTC, Maxim wrote: On Wednesday, 24 February 2021 at 19:35:46 UTC, Siemargl wrote: On Wednesday, 24 February 2021 at

Re: DUB is not working correctly

2021-02-24 Thread Siemargl via Digitalmars-d-learn
On Wednesday, 24 February 2021 at 20:10:29 UTC, Siemargl wrote: Works fine on void dub init project, but underscore problem whith dsfml still here I think, its a problem with dsfml project. You can see it in %userprofile%\AppData\Local\dub\packages\dsfml-2.1.1\dsfml There is a build.d

Re: Compile-Time Function Parameters That Aren't Types?

2021-02-24 Thread Ali Çehreli via Digitalmars-d-learn
On 2/23/21 7:52 PM, Kyle Ingraham wrote: Where would one find information on this There are Point and Polygon struct templates on the following page where one can pick e.g. the dimension (e.g. three dimensional space) by a size_t template parameter.

Re: DUB is not working correctly

2021-02-24 Thread Siemargl via Digitalmars-d-learn
On Wednesday, 24 February 2021 at 19:48:10 UTC, Siemargl wrote: On Wednesday, 24 February 2021 at 19:42:05 UTC, Maxim wrote: On Wednesday, 24 February 2021 at 19:35:46 UTC, Siemargl wrote: On Wednesday, 24 February 2021 at 19:18:32 UTC, Siemargl wrote: [...] Yes, i see th error. If in your

Re: Can Metaprogramming Help Here?

2021-02-24 Thread Mike Brown via Digitalmars-d-learn
On Tuesday, 23 February 2021 at 22:55:53 UTC, H. S. Teoh wrote: On Tue, Feb 23, 2021 at 10:24:50PM +, Mike Brown via Digitalmars-d-learn wrote: Hi all, Im porting some C++ code, which has a mess of a section that implements prime number type id's. I've had to smother it to death with

Re: DUB is not working correctly

2021-02-24 Thread Maxim via Digitalmars-d-learn
On Wednesday, 24 February 2021 at 19:48:10 UTC, Siemargl wrote: On Wednesday, 24 February 2021 at 19:42:05 UTC, Maxim wrote: On Wednesday, 24 February 2021 at 19:35:46 UTC, Siemargl wrote: On Wednesday, 24 February 2021 at 19:18:32 UTC, Siemargl wrote: [...] Yes, i see th error. If in your

Re: Introspection of exceptions that a function can throw

2021-02-24 Thread Dennis via Digitalmars-d-learn
On Wednesday, 24 February 2021 at 19:38:53 UTC, Mark wrote: Is there a way to obtain a list, at compile-time, of all the exception types that a function might throw (directly or through a call to another function)? No, since this is not known at compile-time. See:

Re: Introspection of exceptions that a function can throw

2021-02-24 Thread SealabJaster via Digitalmars-d-learn
On Wednesday, 24 February 2021 at 19:58:41 UTC, SealabJaster wrote: ... Just realised that can include duplicates, but there's std.meta.NoDuplicates to solve that.

Re: Introspection of exceptions that a function can throw

2021-02-24 Thread SealabJaster via Digitalmars-d-learn
On Wednesday, 24 February 2021 at 19:38:53 UTC, Mark wrote: Is there a way to obtain a list, at compile-time, of all the exception types that a function might throw (directly or through a call to another function)? Thanks. I don't believe that there's any built-in way, as that'd mean that

Re: DUB is not working correctly

2021-02-24 Thread Siemargl via Digitalmars-d-learn
On Wednesday, 24 February 2021 at 19:42:05 UTC, Maxim wrote: On Wednesday, 24 February 2021 at 19:35:46 UTC, Siemargl wrote: On Wednesday, 24 February 2021 at 19:18:32 UTC, Siemargl wrote: [...] Yes, i see th error. If in your dub.json change > "targetType": "executable", [...] Tried and

Re: DUB is not working correctly

2021-02-24 Thread Maxim via Digitalmars-d-learn
On Wednesday, 24 February 2021 at 19:35:46 UTC, Siemargl wrote: On Wednesday, 24 February 2021 at 19:18:32 UTC, Siemargl wrote: [...] Yes, i see th error. If in your dub.json change > "targetType": "executable", [...] Tried and everything seems to be okay with underscores but the error

Re: DUB is not working correctly

2021-02-24 Thread Maxim via Digitalmars-d-learn
On Wednesday, 24 February 2021 at 19:18:32 UTC, Siemargl wrote: On Wednesday, 24 February 2021 at 19:04:02 UTC, Maxim wrote: On Wednesday, 24 February 2021 at 18:52:12 UTC, H. S. Teoh I recently tried that. Even compiler was reinstalled. It didn't help. Just try remove dsfml and all

Re: DUB is not working correctly

2021-02-24 Thread Siemargl via Digitalmars-d-learn
On Wednesday, 24 February 2021 at 19:04:02 UTC, Maxim wrote: On Wednesday, 24 February 2021 at 18:52:12 UTC, H. S. Teoh I recently tried that. Even compiler was reinstalled. It didn't help. Just try remove dsfml and all depencies. My void "dub init"? which works { "authors": [

Re: DUB is not working correctly

2021-02-24 Thread Maxim via Digitalmars-d-learn
On Wednesday, 24 February 2021 at 18:52:12 UTC, H. S. Teoh wrote: On Wed, Feb 24, 2021 at 06:32:00PM +, Maxim via Digitalmars-d-learn wrote: On Wednesday, 24 February 2021 at 18:21:40 UTC, evilrat wrote: > On Wednesday, 24 February 2021 at 17:45:56 UTC, Maxim wrote: > > > > Unfortunately,

Re: DUB is not working correctly

2021-02-24 Thread H. S. Teoh via Digitalmars-d-learn
On Wed, Feb 24, 2021 at 06:32:00PM +, Maxim via Digitalmars-d-learn wrote: > On Wednesday, 24 February 2021 at 18:21:40 UTC, evilrat wrote: > > On Wednesday, 24 February 2021 at 17:45:56 UTC, Maxim wrote: > > > > > > Unfortunately, I tried bindbc-sfml package but the problem is > > > still

Re: Compile-Time Function Parameters That Aren't Types?

2021-02-24 Thread Kyle Ingraham via Digitalmars-d-learn
On Wednesday, 24 February 2021 at 06:18:02 UTC, H. S. Teoh wrote: Usually it's when there's a decision that needs to be made at compile-time (or desirable to be made at compile-time for whatever reason). For example, if there are two very different branches of code that should run depending

Re: DUB is not working correctly

2021-02-24 Thread Maxim via Digitalmars-d-learn
On Wednesday, 24 February 2021 at 18:21:40 UTC, evilrat wrote: On Wednesday, 24 February 2021 at 17:45:56 UTC, Maxim wrote: Unfortunately, I tried bindbc-sfml package but the problem is still existing. I also started a new project and without any changes ran it but the result was the same.

Re: DUB is not working correctly

2021-02-24 Thread evilrat via Digitalmars-d-learn
On Wednesday, 24 February 2021 at 17:45:56 UTC, Maxim wrote: Unfortunately, I tried bindbc-sfml package but the problem is still existing. I also started a new project and without any changes ran it but the result was the same. Anyway, thank you so much for your help! does it works for an

Re: DUB is not working correctly

2021-02-24 Thread Imperatorn via Digitalmars-d-learn
On Wednesday, 24 February 2021 at 16:13:48 UTC, Maxim wrote: Hello, I have problems with working in dub environment. If I try to init my project with 'dub init', all needed files will be created successfully. However, when I run 'dub run', the manager gives me an error: [...] Wierd, have

Re: DUB is not working correctly

2021-02-24 Thread Maxim via Digitalmars-d-learn
On Wednesday, 24 February 2021 at 17:27:19 UTC, evilrat wrote: On Wednesday, 24 February 2021 at 16:46:20 UTC, Maxim wrote: Sure, here are dub.json contents: { "authors": [ "Max" ], "copyright": "Copyright © 2021, Max", "description": "A minimal

Re: DUB is not working correctly

2021-02-24 Thread evilrat via Digitalmars-d-learn
On Wednesday, 24 February 2021 at 16:46:20 UTC, Maxim wrote: Sure, here are dub.json contents: { "authors": [ "Max" ], "copyright": "Copyright © 2021, Max", "description": "A minimal D application.", "license": "proprietary",

Re: DUB is not working correctly

2021-02-24 Thread Maxim via Digitalmars-d-learn
On Wednesday, 24 February 2021 at 16:27:49 UTC, evilrat wrote: On Wednesday, 24 February 2021 at 16:13:48 UTC, Maxim wrote: Hello, I have problems with working in dub environment. If I try to init my project with 'dub init', all needed files will be created successfully. However, when I run

Re: DUB is not working correctly

2021-02-24 Thread evilrat via Digitalmars-d-learn
On Wednesday, 24 February 2021 at 16:13:48 UTC, Maxim wrote: Hello, I have problems with working in dub environment. If I try to init my project with 'dub init', all needed files will be created successfully. However, when I run 'dub run', the manager gives me an error: 'Configuration

DUB is not working correctly

2021-02-24 Thread Maxim via Digitalmars-d-learn
Hello, I have problems with working in dub environment. If I try to init my project with 'dub init', all needed files will be created successfully. However, when I run 'dub run', the manager gives me an error: 'Configuration 'application' of package application contains no source files.