On Wednesday, 29 December 2021 at 02:33:08 UTC, frame wrote:
On Wednesday, 29 December 2021 at 01:11:13 UTC, Stanislav
Blinov wrote:
Because opIndexAssign cannot distinguish at compile time
between initialization and assignment:
```d
Stuff[Key] aa;
aa[key] = Stuff(args); // ostensibly,
On Wednesday, 29 December 2021 at 01:11:13 UTC, Stanislav Blinov
wrote:
Because opIndexAssign cannot distinguish at compile time
between initialization and assignment:
```d
Stuff[Key] aa;
aa[key] = Stuff(args); // ostensibly, initialization
aa[key] = otherStuff; // assignment to existing
On Tuesday, 28 December 2021 at 22:30:30 UTC, Ali Çehreli wrote:
On 12/28/21 2:06 PM, Steven Schveighoffer wrote:
void print_num(int mul)(int num) {
Wasn't there a way of telling whether an 'auto ref' parameter
is copied or not?
void print_num()(int num, auto ref int mul) {
// ?
}
On Tuesday, 28 December 2021 at 22:46:16 UTC, frame wrote:
On Tuesday, 28 December 2021 at 10:02:13 UTC, tsbockman wrote:
// Should be a compile-time error, because it might reassign:
test[key] = S(value);
This might be a typo in your example but why should it be a
compile-time error,
On Tuesday, 28 December 2021 at 18:27:36 UTC, vit wrote:
Hi, why this code doesn't compile?
```d
struct Foo{
bool opCast(T : bool)()const{
assert(0);
}
~this(){}
}
struct Bar{
const Foo foo;
}
void main(){
}
```
Error: template instance `opCast!(Foo)` does not
On Tuesday, 28 December 2021 at 10:02:13 UTC, tsbockman wrote:
// Should be a compile-time error, because it might reassign:
test[key] = S(value);
This might be a typo in your example but why should it be a
compile-time error, it cannot know if the key already exists in
compile time on
On Tuesday, 28 December 2021 at 14:48:24 UTC, Era Scarecrow wrote:
Probably better to make data private vs making it const. I
tend to use const far more as input arguments to help denote it
won't change references and less for elements in a struct. That
or make it a class? I'm not sure.
On 12/28/21 2:06 PM, Steven Schveighoffer wrote:
void print_num(int mul)(int num) {
Wasn't there a way of telling whether an 'auto ref' parameter is copied
or not?
void print_num()(int num, auto ref int mul) {
// ?
}
And that would indicate that the argument was an rvalue?
I
On Tuesday, 28 December 2021 at 21:19:29 UTC, rempas wrote:
I would like to know if that's possible. Actually I would like
to do something like the following:
```
extern (C) void main() {
void print_num(int num, comp_time_type int mul) {
static if (is(mul == ten)) {
printf("%d\n",
On 12/28/21 4:19 PM, rempas wrote:
Here:
```
extern (C) void main() {
void print_num(int mul)(int num) {
static if (is(mul == ten)) {
printf("%d\n", num * 10);
} else static if (is(mul == three)) {
printf("%d\n", num * 3);
} else {
printf("%d\n", num);
On Tuesday, 28 December 2021 at 21:19:29 UTC, rempas wrote:
I would like to know if that's possible. Actually I would like
to do something like the following:
```
extern (C) void main() {
void print_num(int num, comp_time_type int mul) {
static if (is(mul == ten)) {
printf("%d\n",
I would like to know if that's possible. Actually I would like to
do something like the following:
```
extern (C) void main() {
void print_num(int num, comp_time_type int mul) {
static if (is(mul == ten)) {
printf("%d\n", num * 10);
} else static if (is(mul == three)) {
Thanks! It works.
Perhaps there will still be difficulties, I will write here.
Hi, why this code doesn't compile?
```d
struct Foo{
bool opCast(T : bool)()const{
assert(0);
}
~this(){}
}
struct Bar{
const Foo foo;
}
void main(){
}
```
Error: template instance `opCast!(Foo)` does not match template
declaration `opCast(T : bool)()`
On Tuesday, 28 December 2021 at 16:29:05 UTC, Bagomot wrote:
I can't do it according to your example, my Watcher list fills
up at runtime.
Yes, it's possible to do it at runtime as well(it already _was_
happening at runtime), although I'll be using a `cast` for
convenience now.
```d
On Tuesday, 28 December 2021 at 15:42:04 UTC, Tejas wrote:
On Tuesday, 28 December 2021 at 14:19:46 UTC, Bagomot wrote:
On Monday, 27 December 2021 at 10:59:07 UTC, Ali Çehreli wrote:
On 12/27/21 1:33 AM, Bagomot wrote:
> separate thread, without blocking the main one.
I think you can use
On Tuesday, 28 December 2021 at 14:19:46 UTC, Bagomot wrote:
On Monday, 27 December 2021 at 10:59:07 UTC, Ali Çehreli wrote:
On 12/27/21 1:33 AM, Bagomot wrote:
> separate thread, without blocking the main one.
I think you can use std.concurrency there. I have a chapter
here:
On Tuesday, 28 December 2021 at 14:53:57 UTC, rempas wrote:
On Tuesday, 28 December 2021 at 12:56:11 UTC, Adam D Ruppe
wrote:
https://invisible-island.net/xterm/ctlseqs/ctlseqs.html
and that's not quite full either. it really is a mess from
hell
Still less complicated and organized
On Tuesday, 28 December 2021 at 13:04:26 UTC, Adam D Ruppe wrote:
What is your library? You might be able to just use my
terminal.d too
My library will be "libd" it will be like "libc" but better and
cooler! And it will be native to D! And of course it will not
depend on "libc" and it
On Tuesday, 28 December 2021 at 12:56:11 UTC, Adam D Ruppe wrote:
https://invisible-island.net/xterm/ctlseqs/ctlseqs.html
and that's not quite full either. it really is a mess from
hell
Still less complicated and organized than my life...
On Tuesday, 28 December 2021 at 07:51:04 UTC, frame wrote:
On Tuesday, 28 December 2021 at 01:45:42 UTC, Era Scarecrow
wrote:
Success!
So i summarize, either work with a pointer, or drop the
const...
Of course casting the const away was the first thing I did but
I think this is not
On Monday, 27 December 2021 at 10:59:07 UTC, Ali Çehreli wrote:
On 12/27/21 1:33 AM, Bagomot wrote:
> separate thread, without blocking the main one.
I think you can use std.concurrency there. I have a chapter
here:
http://ddili.org/ders/d.en/concurrency.html
Look for 'struct Exit' to
On Tuesday, 28 December 2021 at 06:51:52 UTC, rempas wrote:
That's pretty nice. In this case is even better because at
least for now, I will not work on Windows by myself because
making the library work on Linux is a bit of a challenge itself.
What is your library? You might be able to just
On Tuesday, 28 December 2021 at 07:03:25 UTC, rempas wrote:
I already knew about some of this "escape codes" but I full
list of them will come in handy ;)
https://invisible-island.net/xterm/ctlseqs/ctlseqs.html
and that's not quite full either. it really is a mess from
hell
On Tuesday, 28 December 2021 at 06:46:57 UTC, ag0aep6g wrote:
It's actually just the first byte that tells you how many are
in the sequence. The continuation bytes don't have redundancies
for that.
Right, but they do have that high bit set and next bit clear so
you can tell you're in the
On Monday, 27 December 2021 at 07:12:24 UTC, rempas wrote:
I don't understand that. Based on your calculations, the
results should have been different. Also how are the numbers
fixed? Like you said the amount of bytes of each encoding is
not always standard for every character. Even if they
On Tuesday, 28 December 2021 at 07:54:56 UTC, frame wrote:
On Tuesday, 28 December 2021 at 06:38:03 UTC, Tejas wrote:
The workaround is okay, but I think we should file a bug
report for this.
This is very ~~stupid~~ undesirable behaviour
I agree. I'll just wait if somebody can explain why
27 matches
Mail list logo