Re: Complicated @property access only works when I write an extra parenthesis "()"

2023-05-27 Thread realhet via Digitalmars-d-learn
It seems like I managed to solve it. All the chain of properties now capturing a generic value type T. And finally the most inner associative array will handle the implicit cast. Maybe that extra implicit () got confused when the types are same, but the aliases to those types are different.

Re: Complicated @property access only works when I write an extra parenthesis "()"

2023-05-26 Thread realhet via Digitalmars-d-learn
a property it is just plain broken and has been the whole time. Don't expect it to ever be fixed. At least my 5 hour trying-and-failing session comes to a logical end here :D Thank You!

Re: Complicated @property access only works when I write an extra parenthesis "()"

2023-05-26 Thread realhet via Digitalmars-d-learn
it into a temp variable or inside a with(), then both form works ok. Bit when I try to write the whole thing in a single nice expression: No property `_size` for the type `void`. In the documentation I see this: - For the expression typeof(exp) where exp is an @property function, the type is the return

Re: Complicated @property access only works when I write an extra parenthesis "()"

2023-05-26 Thread Adam D Ruppe via Digitalmars-d-learn
On Friday, 26 May 2023 at 21:00:20 UTC, realhet wrote: Only the extra () let it compile successfuly. No way to fix it. If the function takes an extra argument you can kinda trick it but for zero arg function pointer return from a property it is just plain broken and has been the whole time

Complicated @property access only works when I write an extra parenthesis "()"

2023-05-26 Thread realhet via Digitalmars-d-learn
of this is BlobLoader 'lod0' is a mixin generated @property getter. It calls a template function in the karcSamples class: _getBlob!"lod0"(key) this also calls an internal struct called DataLoggerBlobAA which is acting like an associative array. That iternal struct overloads th

[Issue 10886] Typeof on @property function triggers 'wrong this' type error

2023-03-15 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=10886 --- Comment #6 from Dlang Bot --- dlang/dmd pull request #14992 "merge stable" was merged into master: - 141c5683f69d5a483d6f1647950249510a025961 by Razvan Nitu: Fix Issue 21288 & 10886 - incorrect this pointer (#14969)

[Issue 10886] Typeof on @property function triggers 'wrong this' type error

2023-03-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=10886 Dlang Bot changed: What|Removed |Added Status|NEW |RESOLVED Resolution|---

[Issue 10886] Typeof on @property function triggers 'wrong this' type error

2023-03-08 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=10886 Dlang Bot changed: What|Removed |Added Keywords||pull --- Comment #4 from Dlang Bot ---

[Issue 22939] bad error message: Error: no property `msg` for type `string`

2023-01-08 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=22939 Basile-z changed: What|Removed |Added Component|dmd |phobos --

[Issue 17474] non-property being treated as a property

2022-12-17 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17474 Iain Buclaw changed: What|Removed |Added Priority|P3 |P2 --

[Issue 11120] Compiler calls wrong property when using type tuple of length 1

2022-12-17 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=11120 Iain Buclaw changed: What|Removed |Added Priority|P2 |P3 --

[Issue 8814] Issues casting opDispatch property when a write property exists

2022-12-17 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=8814 Iain Buclaw changed: What|Removed |Added Priority|P2 |P3 --

[Issue 10886] Typeof on @property function triggers 'wrong this' type error

2022-12-17 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=10886 Iain Buclaw changed: What|Removed |Added Priority|P2 |P3 --

[Issue 10698] opDispatch called as property over struct field even when opDispatch requires runtime arguments

2022-12-17 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=10698 Iain Buclaw changed: What|Removed |Added Priority|P2 |P3 --

[Issue 8000] [UFCS] property in WithStatement

2022-12-17 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=8000 Iain Buclaw changed: What|Removed |Added Priority|P2 |P3 --

[Issue 8162] [TDPL] -property fails to give an error when a property function is called with parens

2022-12-17 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=8162 Iain Buclaw changed: What|Removed |Added Priority|P2 |P3 --

[Issue 6294] Function overrides not checking for @property

2022-12-17 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=6294 Iain Buclaw changed: What|Removed |Added Priority|P2 |P3 --

[Issue 5707] cannot overload both property and non-property functions

2022-12-17 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=5707 Iain Buclaw changed: What|Removed |Added Priority|P2 |P4 --

[Issue 7970] @property does not properly disambiguate delegate properties

2022-12-17 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=7970 Iain Buclaw changed: What|Removed |Added Priority|P2 |P4 --

[Issue 8161] give an error for invalid property functions

2022-12-17 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=8161 Iain Buclaw changed: What|Removed |Added Priority|P2 |P4 --

[Issue 10867] Allow variadic function parameter in a @property function

2022-12-17 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=10867 Iain Buclaw changed: What|Removed |Added Priority|P2 |P4 --

[Issue 9062] AddrExp should distinguish the existence of property resolution.

2022-12-17 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=9062 Iain Buclaw changed: What|Removed |Added Priority|P2 |P4 --

[Issue 17350] bitmanip checks min, while Ternary does not have this property

2022-12-17 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17350 Iain Buclaw changed: What|Removed |Added Priority|P1 |P3 --

[Issue 22769] `fun()` where fun is a property which returns an object with opCall should call opCall

2022-12-17 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=22769 Iain Buclaw changed: What|Removed |Added Priority|P1 |P3 --

[Issue 12595] dup/idup shouldn't be property functions

2022-12-17 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=12595 Iain Buclaw changed: What|Removed |Added Priority|P1 |P3 --

[Issue 18087] "no property 'value' for type 'void'" when properties split among mixins

2022-12-17 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18087 Iain Buclaw changed: What|Removed |Added Priority|P1 |P3 --

[Issue 17865] property/non-property overloads not detected until used

2022-12-17 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17865 Iain Buclaw changed: What|Removed |Added Priority|P1 |P3 --

[Issue 19588] Invalid @property opDispatch setter call inside the WithStatement

2022-12-17 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19588 Iain Buclaw changed: What|Removed |Added Priority|P1 |P3 --

[Issue 23451] Static function declared in with scope cannot access property on type alias in with expression type

2022-12-17 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=23451 Iain Buclaw changed: What|Removed |Added Priority|P1 |P3 --

[Issue 21466] Calling an enum value result in confusing error message "No property X for type Y"

2022-12-17 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=21466 Iain Buclaw changed: What|Removed |Added Priority|P1 |P3 --

[Issue 15038] Associative Array .get property const vs immutable

2022-12-17 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15038 Iain Buclaw changed: What|Removed |Added Priority|P1 |P4 --

[Issue 23507] Socket.blocking property incorrect on new Socket on Windows

2022-11-24 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=23507 Dlang Bot changed: What|Removed |Added Status|NEW |RESOLVED Resolution|---

[Issue 23507] Socket.blocking property incorrect on new Socket on Windows

2022-11-24 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=23507 Dlang Bot changed: What|Removed |Added Keywords||pull --- Comment #1 from Dlang Bot ---

[Issue 23507] New: Socket.blocking property incorrect on new Socket on Windows

2022-11-24 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=23507 Issue ID: 23507 Summary: Socket.blocking property incorrect on new Socket on Windows Product: D Version: D2 Hardware: All OS: Windows Status: NEW

[Issue 17240] mutable/shared @property both match in typeof

2022-11-18 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17240 RazvanN changed: What|Removed |Added Status|NEW |RESOLVED CC|

[Issue 23451] Static function declared in with scope cannot access property on type alias in with expression type

2022-11-02 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=23451 Mario Kroeplin changed: What|Removed |Added Keywords||industry CC|

[Issue 23451] New: Static function declared in with scope cannot access property on type alias in with expression type

2022-11-02 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=23451 Issue ID: 23451 Summary: Static function declared in with scope cannot access property on type alias in with expression type Product: D Version: D2 Hardware: x86_64

[Issue 15501] Missing parens for template argument in error message: Error: no property 'nsecs' for type 'MonoTimeImpl!cast(ClockType)0'

2022-10-28 Thread d-bugmail--- via Digitalmars-d-bugs
||razvan.nitu1...@gmail.com Resolution|--- |WORKSFORME --- Comment #3 from RazvanN --- This now yields: test.d(3): Error: no property `nsecs` for `currTime()` of type `core.time.MonoTimeImpl!ClockType.normal` Which is the correct error message. --

[Issue 14916] opDispatch: no property error for parameter type mismatch

2022-10-10 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14916 RazvanN changed: What|Removed |Added Status|NEW |RESOLVED Resolution|---

[Issue 14916] opDispatch: no property error for parameter type mismatch

2022-10-10 Thread d-bugmail--- via Digitalmars-d-bugs
RazvanN --- The problem is that we now have 2 overloads and none match, therefore the compiler simply goes with a generic error message "no property foo for s". This is the correct behavior since the compiler does not have sufficient information to distinguish which overload is less wrong

[Issue 22141] Property .capacity is not listed in the array properties section

2022-09-28 Thread d-bugmail--- via Digitalmars-d-bugs
|--- |FIXED --- Comment #4 from Dlang Bot --- dlang/dlang.org pull request #3356 "Fix Issue 22141 - Property .capacity is not listed in the array prope…" was merged into master: - 4ab0ac795fb65a083e4de9f8b7b38c4385f20920 by RazvanN7: Fix Issue 22141 - Property .capacity is

[Issue 18087] "no property 'value' for type 'void'" when properties split among mixins

2022-09-05 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18087 Nick Treleaven changed: What|Removed |Added CC||n...@geany.org --- Comment #2 from Nick

Re: "Error: no property `offsetof` for type `char*`"

2022-08-19 Thread Tejas via Digitalmars-d-learn
On Friday, 19 August 2022 at 16:36:24 UTC, MyNameHere wrote: On Friday, 19 August 2022 at 14:30:50 UTC, kinke wrote: Oh and `DevicePath()` is a convenience member returning a pointer to the 'dynamic array' (as the array decays to a pointer in C too), so no need to fiddle with `.offsetof` and

Re: "Error: no property `offsetof` for type `char*`"

2022-08-19 Thread Steven Schveighoffer via Digitalmars-d-learn
On 8/19/22 12:36 PM, MyNameHere wrote: On Friday, 19 August 2022 at 14:30:50 UTC, kinke wrote: Oh and `DevicePath()` is a convenience member returning a pointer to the 'dynamic array' (as the array decays to a pointer in C too), so no need to fiddle with `.offsetof` and computing the pointer

Re: "Error: no property `offsetof` for type `char*`"

2022-08-19 Thread MyNameHere via Digitalmars-d-learn
On Friday, 19 August 2022 at 14:30:50 UTC, kinke wrote: Oh and `DevicePath()` is a convenience member returning a pointer to the 'dynamic array' (as the array decays to a pointer in C too), so no need to fiddle with `.offsetof` and computing the pointer manually. I am using ```-BetterC```,

Re: "Error: no property `offsetof` for type `char*`"

2022-08-19 Thread kinke via Digitalmars-d-learn
On Friday, 19 August 2022 at 13:49:08 UTC, MyNameHere wrote: Thank you, that seems to have resolved the issue, though I wish these sorts of problems would stop cropping up, they are souring the experience with the language. Oh and `DevicePath()` is a convenience member returning a pointer to

Re: "Error: no property `offsetof` for type `char*`"

2022-08-19 Thread kinke via Digitalmars-d-learn
On Friday, 19 August 2022 at 14:22:04 UTC, Steven Schveighoffer wrote: On 8/19/22 9:49 AM, MyNameHere wrote: Thank you, that seems to have resolved the issue, though I wish these sorts of problems would stop cropping up, they are souring the experience with the language. Most likely that

Re: "Error: no property `offsetof` for type `char*`"

2022-08-19 Thread Steven Schveighoffer via Digitalmars-d-learn
On 8/19/22 9:49 AM, MyNameHere wrote: Thank you, that seems to have resolved the issue, though I wish these sorts of problems would stop cropping up, they are souring the experience with the language. Most likely that "member" is a macro in C. D doesn't have macros, so it uses properties.

Re: "Error: no property `offsetof` for type `char*`"

2022-08-19 Thread MyNameHere via Digitalmars-d-learn
Thank you, that seems to have resolved the issue, though I wish these sorts of problems would stop cropping up, they are souring the experience with the language.

Re: "Error: no property `offsetof` for type `char*`"

2022-08-19 Thread kinke via Digitalmars-d-learn
It's a method returning a `CHAR*` - `_DevicePath` is the actual member. I guess it's a dynamically sized struct, which cannot be mapped directly to D, hence this representation.

"Error: no property `offsetof` for type `char*`"

2022-08-19 Thread MyNameHere via Digitalmars-d-learn
I am receiving this error: ``` Error: no property `offsetof` for type `char*` ``` from this snippet: ```d import core.sys.windows.setupapi; void main() { SP_DEVICE_INTERFACE_DETAIL_DATA_A DeviceInterfaceDetail; uint Offset = DeviceInterfaceDetail.DevicePath.offsetof; } ``` You may

[Issue 22141] Property .capacity is not listed in the array properties section

2022-08-12 Thread d-bugmail--- via Digitalmars-d-bugs
--- @RazvanN7 updated dlang/dlang.org pull request #3356 "Fix Issue 22141 - Property .capacity is not listed in the array prope…" fixing this issue: - Fix Issue 22141 - Property .capacity is not listed in the array properties https://github.com/dlang/dlang.org/pull/3356 --

[Issue 22141] Property .capacity is not listed in the array properties section

2022-07-29 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=22141 RazvanN changed: What|Removed |Added CC||razvan.nitu1...@gmail.com --- Comment #2 from

[Issue 22141] Property .capacity is not listed in the array properties section

2022-07-25 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=22141 Don Allen changed: What|Removed |Added CC||donaldcallen1...@icloud.com --- Comment #1 from

[Issue 17865] property/non-property overloads not detected until used

2022-06-05 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17865 bitwise changed: What|Removed |Added CC|nicolas.jincher...@gmail.co | |m |

[Issue 22939] bad error message: Error: no property `msg` for type `string`

2022-04-01 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=22939 --- Comment #4 from Dlang Bot --- dlang/phobos pull request #8425 "merge stable" was merged into master: - ba92563a0d69d07f182ea7305bb6def1791a7bd8 by Dennis Korpel: Fix issue 22939 - bad error message: Error: no property `msg` for ty

[Issue 22939] bad error message: Error: no property `msg` for type `string`

2022-03-29 Thread d-bugmail--- via Digitalmars-d-bugs
|--- |FIXED --- Comment #3 from Dlang Bot --- dlang/phobos pull request #8424 "Fix issue 22939 - bad error message: Error: no property `msg` for typ…" was merged into stable: - 2f7ec47051201fe7f0111d559e993860c56585db by Dennis Korpel: Fix issue 22939 - bad error message: Error: n

[Issue 22939] bad error message: Error: no property `msg` for type `string`

2022-03-29 Thread d-bugmail--- via Digitalmars-d-bugs
--- @dkorpel created dlang/phobos pull request #8424 "Fix issue 22939 - bad error message: Error: no property `msg` for typ…" fixing this issue: - Fix issue 22939 - bad error message: Error: no property `msg` for type `string` https://github.com/dlang/phobos/pull/8424 --

[Issue 22939] bad error message: Error: no property `msg` for type `string`

2022-03-29 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=22939 Dennis changed: What|Removed |Added CC||dkor...@live.nl --- Comment #1 from Dennis ---

[Issue 22940] New: defect: Error: no property `_0L` for type `int`

2022-03-26 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=22940 Issue ID: 22940 Summary: defect: Error: no property `_0L` for type `int` Product: D Version: D2 Hardware: x86_64 OS: Linux Status: NEW Severity: normal

[Issue 22939] New: bad error message: Error: no property `msg` for type `string`

2022-03-26 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=22939 Issue ID: 22939 Summary: bad error message: Error: no property `msg` for type `string` Product: D Version: D2 Hardware: x86_64 OS: Linux Status: NEW

[Issue 22769] `fun()` where fun is a property which returns an object with opCall should call opCall

2022-02-14 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=22769 --- Comment #8 from anonymous4 --- If deprecation goes successfully, it may open possibility for implementation of strict properties. --

[Issue 22769] `fun()` where fun is a property which returns an object with opCall should call opCall

2022-02-14 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=22769 --- Comment #7 from anonymous4 --- But, yeah, presumably it should deprecate a bunch of stuff first. --

[Issue 22769] `fun()` where fun is a property which returns an object with opCall should call opCall

2022-02-14 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=22769 --- Comment #6 from anonymous4 --- Currently it works according to optional parentheses, which is not ambiguous, since strict properties obviously aren't implemented. If you want to introduce strict properties gradually, it's a DIP too, what to

[Issue 22769] `fun()` where fun is a property which returns an object with opCall should call opCall

2022-02-14 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=22769 --- Comment #5 from Vladimir Panteleev --- It has been a while, and I think the strict properties DIPs were about entirely forbidding "someProperty()"; whereas in this case, it may make more sense for incremental improvement in the form of fixing

[Issue 22769] `fun()` where fun is a property which returns an object with opCall should call opCall

2022-02-14 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=22769 --- Comment #4 from anonymous4 --- This is called "strict properties" and requires a DIP, especially since previous DIPs about this went nowhere and people in general gave up on sorting this out. But maybe it's a good time for a new DIP. Among other

[Issue 22769] `fun()` where fun is a property which returns an object with opCall should call opCall

2022-02-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=22769 --- Comment #3 from Basile-z --- Thanks for the explanations, I see the issue now, that is that opCall is not tried. --

[Issue 22769] `fun()` where fun is a property which returns an object with opCall should call opCall

2022-02-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=22769 --- Comment #2 from Vladimir Panteleev --- (In reply to Basile-z from comment #1) > what is the background idea ? Making @property do its job > Is this proposal a way to have opCall called without explicit CallExp ? No. () is the C

[Issue 22769] `fun()` where fun is a property which returns an object with opCall should call opCall

2022-02-13 Thread d-bugmail--- via Digitalmars-d-bugs
--- what is the background idea ? Is this proposal a way to have opCall called without explicit CallExp ? --- struct S { void opCall() @property { } } S s; @property S fun() { return s; } void main() { s(); // ok s; // using @property of opCall, that cannot work fun

[Issue 22769] New: `fun()` where fun is a property which returns an object with opCall should call opCall

2022-02-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=22769 Issue ID: 22769 Summary: `fun()` where fun is a property which returns an object with opCall should call opCall Product: D Version: D2 Hardware: All OS: All

[Issue 12595] dup/idup shouldn't be property functions

2022-01-25 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=12595 Dennis changed: What|Removed |Added CC||dkor...@live.nl --- Comment #3 from Dennis ---

Re: How to define property type to Array!struct?

2021-12-15 Thread Steven Schveighoffer via Digitalmars-d-learn
On 12/15/21 9:41 AM, Stanislav Blinov wrote: On Wednesday, 15 December 2021 at 11:36:41 UTC, Manfred Nowak wrote: On Tuesday, 14 December 2021 at 08:28:01 UTC, WebFreak001 wrote: [...] Alternatively, remove the template `()` from your `struct Header` What is the semantic sense of a template

Re: How to define property type to Array!struct?

2021-12-15 Thread Stanislav Blinov via Digitalmars-d-learn
On Wednesday, 15 December 2021 at 11:36:41 UTC, Manfred Nowak wrote: On Tuesday, 14 December 2021 at 08:28:01 UTC, WebFreak001 wrote: [...] Alternatively, remove the template `()` from your `struct Header` What is the semantic sense of a template having no parameters? Although the

Re: How to define property type to Array!struct?

2021-12-15 Thread Steven Schveighoffer via Digitalmars-d-learn
On 12/15/21 6:36 AM, Manfred Nowak wrote: On Tuesday, 14 December 2021 at 08:28:01 UTC, WebFreak001 wrote: [...] Alternatively, remove the template `()` from your `struct Header` What is the semantic sense of a template having no parameters? Although the documentation declares such a

Re: How to define property type to Array!struct?

2021-12-15 Thread bauss via Digitalmars-d-learn
On Wednesday, 15 December 2021 at 11:36:41 UTC, Manfred Nowak wrote: On Tuesday, 14 December 2021 at 08:28:01 UTC, WebFreak001 wrote: [...] Alternatively, remove the template `()` from your `struct Header` What is the semantic sense of a template having no parameters? Although the

Re: How to define property type to Array!struct?

2021-12-15 Thread WebFreak001 via Digitalmars-d-learn
On Wednesday, 15 December 2021 at 11:36:41 UTC, Manfred Nowak wrote: On Tuesday, 14 December 2021 at 08:28:01 UTC, WebFreak001 wrote: [...] Alternatively, remove the template `()` from your `struct Header` What is the semantic sense of a template having no parameters? Although the

Re: How to define property type to Array!struct?

2021-12-15 Thread Manfred Nowak via Digitalmars-d-learn
On Tuesday, 14 December 2021 at 08:28:01 UTC, WebFreak001 wrote: [...] Alternatively, remove the template `()` from your `struct Header` What is the semantic sense of a template having no parameters? Although the documentation declares such a template to be syntactically correct, not a

[Issue 21073] Rebindable does not work when class has alias this to inout property

2021-12-14 Thread d-bugmail--- via Digitalmars-d-bugs
s to inout property (#13291) The cast expression was trying an 'alias this' but without error gagging. https://github.com/dlang/dmd/pull/13421 --

Re: How to define property type to Array!struct?

2021-12-14 Thread WebFreak001 via Digitalmars-d-learn
On Tuesday, 14 December 2021 at 08:12:04 UTC, zoujiaqing wrote: My code: ```D module http.HttpRequest; import std.container; import std.array : Appender; struct HttpRequest { struct Header() { Appender!string name; Appender!string value; } string method;

How to define property type to Array!struct?

2021-12-14 Thread zoujiaqing via Digitalmars-d-learn
My code: ```D module http.HttpRequest; import std.container; import std.array : Appender; struct HttpRequest { struct Header() { Appender!string name; Appender!string value; } string method; string uri; int versionMajor = 0; int versionMinor = 0;

[Issue 21073] Rebindable does not work when class has alias this to inout property

2021-11-12 Thread d-bugmail--- via Digitalmars-d-bugs
|--- |FIXED --- Comment #3 from Dlang Bot --- dlang/dmd pull request #13291 "Fix Issue 21073 - Rebindable does not work when class has alias this to inout property" was merged into stable: - a7ce6929f6708debfae3e3854bed5f1c02cdf1a0 by Boris Carvajal: Fix Issue 21073 - Rebin

[Issue 21073] Rebindable does not work when class has alias this to inout property

2021-11-11 Thread d-bugmail--- via Digitalmars-d-bugs
--- @BorisCarvajal created dlang/dmd pull request #13291 "Fix Issue 21073 - Rebindable does not work when class has alias this to inout property" fixing this issue: - Fix Issue 21073 - Rebindable does not work when class has alias this to inout property The cast expression was trying

[Issue 11509] AA.dup @property

2021-09-08 Thread d-bugmail--- via Digitalmars-d-bugs
||dkor...@live.nl Resolution|--- |WONTFIX --- Comment #4 from Dennis --- -property was deprecated in 2.069.2 and removed in 2.082.1, the example compiles today. --

Re: why is it a class property cannot be used like a.b ~= c; ?

2021-09-04 Thread someone via Digitalmars-d-learn
On Saturday, 4 September 2021 at 23:57:09 UTC, jfondren wrote: You're returning a copy of a slice, so if this compiled nothing useful would happen anyway. This works if `whatever()` returns `ref dstring` instead, with no other changes. Search https://dlang.org/spec/function.html for 'lvalue'

Re: why is it a class property cannot be used like a.b ~= c; ?

2021-09-04 Thread jfondren via Digitalmars-d-learn
On Saturday, 4 September 2021 at 23:33:39 UTC, someone wrote: ```d public class cSomething { private: dstring pstrWhatever = null; public: @safe dstring whatever() { return pstrWhatever; } @safe void whatever(const dstring lstrWhatever) { pstrWhatever = lstrWhatever; } }

why is it a class property cannot be used like a.b ~= c; ?

2021-09-04 Thread someone via Digitalmars-d-learn
```d public class cSomething { private: dstring pstrWhatever = null; public: @safe dstring whatever() { return pstrWhatever; } @safe void whatever(const dstring lstrWhatever) { pstrWhatever = lstrWhatever; } } void main() { cSomething lobjSomething = new cSomething();

[Issue 21073] Rebindable does not work when class has alias this to inout property

2021-08-09 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=21073 ajiesk...@gmail.com changed: What|Removed |Added CC||ajiesk...@gmail.com

Re: seeking advice: possible new @attribute to mark class' default property to avoid alias this ?

2021-08-07 Thread someone via Digitalmars-d-learn
. No. A default property can be another object altogether. The best use case I can think of is a default collection for a class such as lobjComputers.computers in my example. That really isn't what alias this is used for commonly. I.e. I didn't know alias this even existed a month ago so I cannot

Re: seeking advice: possible new @attribute to mark class' default property to avoid alias this ?

2021-08-07 Thread jfondren via Digitalmars-d-learn
On Sunday, 8 August 2021 at 04:51:48 UTC, someone wrote: On Sunday, 8 August 2021 at 04:30:12 UTC, rikki cattermole wrote: So a field that will automatically be resolved to as part of the behavior of generated toString methods. No. A default property can be another object altogether

Re: seeking advice: possible new @attribute to mark class' default property to avoid alias this ?

2021-08-07 Thread someone via Digitalmars-d-learn
On Sunday, 8 August 2021 at 04:30:12 UTC, rikki cattermole wrote: So a field that will automatically be resolved to as part of the behavior of generated toString methods. No. A default property can be another object altogether. The best use case I can think of is a default collection

Re: seeking advice: possible new @attribute to mark class' default property to avoid alias this ?

2021-08-07 Thread rikki cattermole via Digitalmars-d-learn
So a field that will automatically be resolved to as part of the behavior of generated toString methods. That really isn't what alias this is used for commonly. I.e. struct ValueReference { private { SomethingElse* impl; } bool isNull() { return impl is

Re: seeking advice: possible new @attribute to mark class' default property to avoid alias this ?

2021-08-07 Thread someone via Digitalmars-d-learn
ou, I mean the community, think is it a good idea to file a DIP to eventually get a new attribute to unambiguously label a class' default property ? Can you please explain what a "default property" is? I have never encountered such a thing in any other programming language. ```d pu

Re: seeking advice: possible new @attribute to mark class' default property to avoid alias this ?

2021-08-07 Thread Paul Backus via Digitalmars-d-learn
eventually get a new attribute to unambiguously label a class' default property ? Can you please explain what a "default property" is? I have never encountered such a thing in any other programming language.

seeking advice: possible new @attribute to mark class' default property to avoid alias this ?

2021-08-07 Thread someone via Digitalmars-d-learn
el a class' default property ? eg: @default string whatever(...); eg: @default @property string whatever(...); /// if @property survives; that is ... or whatever you consider it should be named ? Besides, alias this was not implemented to handle default properties albeit it seems it is commo

[Issue 22141] New: Property .capacity is not listed in the array properties section

2021-07-24 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=22141 Issue ID: 22141 Summary: Property .capacity is not listed in the array properties section Product: D Version: D2 Hardware: x86 OS: Windows Status

Re: assign to property 2 values

2021-07-09 Thread Виталий Фадеев via Digitalmars-d-learn
On Friday, 9 July 2021 at 11:04:23 UTC, Dennis wrote: On Friday, 9 July 2021 at 10:19:59 UTC, Виталий Фадеев wrote: It possible in current version 2.097 ? If you `import std.typecons` you can do: ```D element.border = tuple(1, solid).expand; ``` But it's not pretty. I suggest either calling

Re: assign to property 2 values

2021-07-09 Thread Dennis via Digitalmars-d-learn
On Friday, 9 July 2021 at 10:19:59 UTC, Виталий Фадеев wrote: It possible in current version 2.097 ? If you `import std.typecons` you can do: ```D element.border = tuple(1, solid).expand; ``` But it's not pretty. I suggest either calling the function regularly, or combing all settings in a

Re: assign to property 2 values

2021-07-09 Thread Виталий Фадеев via Digitalmars-d-learn
On Friday, 9 July 2021 at 10:19:59 UTC, Виталий Фадеев wrote: I want this feature in D: ``` element.border = 1, solid; struct Element { @property void border( int width, BorderStyle style ) { this.borderWidth = width; this.borderStyle = style; } } ``` Description

assign to property 2 values

2021-07-09 Thread Виталий Фадеев via Digitalmars-d-learn
I want this feature in D: ``` element.border = 1, solid; struct Element { @property void border( int width, BorderStyle style ) { this.borderWidth = width; this.borderStyle = style; } } ``` Description: ``` element.border = 1, solid; ``` will rewriten

Re: How to disable assigning a value to a property?

2021-07-06 Thread Tejas via Digitalmars-d-learn
On Tuesday, 6 July 2021 at 10:06:11 UTC, Jack Applegame wrote: Here's another way using ``` std.typecons ``` ```d import std.stdio; import std.typecons; alias input = Typedef!int; //new code struct Field { void opAssign(int a) { writefln("Field.opAssign(%s)", a); } } struct

  1   2   3   4   5   6   7   8   9   10   >