On Wednesday, 17 June 2020 at 16:01:29 UTC, Paul Backus wrote:
On Tuesday, 16 June 2020 at 13:31:49 UTC, Atila Neves wrote:
With a few changes, yes (added missing semicolons, changed
IGeometry to Geometry in `measure`, passed the current module
so tardy can find the UFCS functions, added
On 6/17/20 7:19 AM, Atila Neves wrote:
On Wednesday, 17 June 2020 at 10:43:35 UTC, Stanislav Blinov wrote:
On Saturday, 13 June 2020 at 15:11:49 UTC, Atila Neves wrote:
Tardy lets users have their cake and eat it too by not making them
have to use classes for runtime polymorphism.
I've got
On Wednesday, 17 June 2020 at 16:01:29 UTC, Paul Backus wrote:
A while ago, I collaborated briefly with Adam Kowalski from the
Dlang discord server on some code to emulate C++-style
argument-dependent lookup in D. Using that code, your example
above would be written:
On Wednesday, 17 June 2020 at 16:01:29 UTC, Paul Backus wrote:
[snip]
IMO this can be done more elegantly by separating out the code
that looks up methods in the current module from the code that
does the actual type erasure.
A while ago, I collaborated briefly with Adam Kowalski from the
On Tuesday, 16 June 2020 at 13:31:49 UTC, Atila Neves wrote:
With a few changes, yes (added missing semicolons, changed
IGeometry to Geometry in `measure`, passed the current module
so tardy can find the UFCS functions, added `@safe pure` to the
UFCS functions:
[...]
void main() {
On Wednesday, 17 June 2020 at 11:46:12 UTC, Atila Neves wrote:
[snip]
I think these questions are good motivators for making it
interface-only since then I don't have to check for data
definitions.
Makes sense.
On Wednesday, 17 June 2020 at 11:31:09 UTC, jmh530 wrote:
On Wednesday, 17 June 2020 at 10:04:59 UTC, Atila Neves wrote:
[...]
Cool.
[...]
If I'm understanding you correctly, you could modify
Polymorphic (and a similar change to VirtualTable) to
struct Polymorphic(Interface,
On Wednesday, 17 June 2020 at 10:04:59 UTC, Atila Neves wrote:
[snip]
I was going to say "it should work" but instead I wrote the
code and... it does. It all falls out of how UFCS works and
usual language rules.
On Wednesday, 17 June 2020 at 10:43:35 UTC, Stanislav Blinov
wrote:
On Saturday, 13 June 2020 at 15:11:49 UTC, Atila Neves wrote:
Tardy lets users have their cake and eat it too by not making
them have to use classes for runtime polymorphism.
I've got to ask though. Why "tardy"? Search
On Saturday, 13 June 2020 at 15:11:49 UTC, Atila Neves wrote:
Tardy lets users have their cake and eat it too by not making
them have to use classes for runtime polymorphism.
I've got to ask though. Why "tardy"? Search engines be damned? :)
On Tuesday, 16 June 2020 at 15:50:07 UTC, jmh530 wrote:
On Tuesday, 16 June 2020 at 13:31:49 UTC, Atila Neves wrote:
[snip]
Pretty cool, thanks for the fixups.
It may make for a good documentation example, in that it may
help make clear that you need to pass the module in somehow
when
On Tuesday, 16 June 2020 at 13:31:49 UTC, Atila Neves wrote:
[snip]
Pretty cool, thanks for the fixups.
It may make for a good documentation example, in that it may help
make clear that you need to pass the module in somehow when
dealing with non-member functions (AFAICT). You could include
On Tuesday, 16 June 2020 at 12:30:24 UTC, jmh530 wrote:
On Tuesday, 16 June 2020 at 11:31:14 UTC, Atila Neves wrote:
On Tuesday, 16 June 2020 at 11:24:05 UTC, jmh530 wrote:
On Tuesday, 16 June 2020 at 09:15:10 UTC, Atila Neves wrote:
[snip]
In the more longer-term, is the goal of the project
On Tuesday, 16 June 2020 at 12:30:24 UTC, jmh530 wrote:
[snip]
double area(Rect r) {
return r.width * r.height
}
double perim(Rect r) {
return 2 * r.width + 2 * r.height
}
double area(Circle c) {
import std.math: PI;
return PI * c.radius * c.radius
}
double perim(Circle c) {
On Tuesday, 16 June 2020 at 11:31:14 UTC, Atila Neves wrote:
On Tuesday, 16 June 2020 at 11:24:05 UTC, jmh530 wrote:
On Tuesday, 16 June 2020 at 09:15:10 UTC, Atila Neves wrote:
[snip]
In the more longer-term, is the goal of the project to
implement a Typescript / Go interfaces like
On Tuesday, 16 June 2020 at 11:24:05 UTC, jmh530 wrote:
On Tuesday, 16 June 2020 at 09:15:10 UTC, Atila Neves wrote:
[snip]
In the more longer-term, is the goal of the project to
implement a Typescript / Go interfaces like structural type
system in user space?
Yes. Other than allowing
On Tuesday, 16 June 2020 at 09:15:10 UTC, Atila Neves wrote:
[snip]
In the more longer-term, is the goal of the project to
implement a Typescript / Go interfaces like structural type
system in user space?
Yes. Other than allowing multiple interfaces, I think it's
already implemented.
I'm
On Tuesday, 16 June 2020 at 09:15:10 UTC, Atila Neves wrote:
On Tuesday, 16 June 2020 at 03:56:52 UTC, Petar Kirov
[ZombineDev] wrote:
On Saturday, 13 June 2020 at 15:11:49 UTC, Atila Neves wrote:
https://code.dlang.org/packages/tardy
https://github.com/atilaneves/tardy
Looks interesting,
On Tuesday, 16 June 2020 at 03:56:52 UTC, Petar Kirov
[ZombineDev] wrote:
On Saturday, 13 June 2020 at 15:11:49 UTC, Atila Neves wrote:
https://code.dlang.org/packages/tardy
https://github.com/atilaneves/tardy
Looks interesting, nice work!
How does it compare to:
On Monday, 15 June 2020 at 20:47:16 UTC, 12345swordy wrote:
On Saturday, 13 June 2020 at 15:11:49 UTC, Atila Neves wrote:
https://code.dlang.org/packages/tardy
https://github.com/atilaneves/tardy
[...]
Wouldn't a top type be a better way to achieve this?
-Alex
How?
On Saturday, 13 June 2020 at 15:11:49 UTC, Atila Neves wrote:
https://code.dlang.org/packages/tardy
https://github.com/atilaneves/tardy
Looks interesting, nice work!
How does it compare to:
https://dlang.org/phobos/std_experimental_typecons#.wrap ?
In the more longer-term, is the goal of
On Monday, 15 June 2020 at 20:54:27 UTC, 12345swordy wrote:
On Monday, 15 June 2020 at 20:51:38 UTC, Stefan Koch wrote:
On Monday, 15 June 2020 at 20:47:16 UTC, 12345swordy wrote:
On Saturday, 13 June 2020 at 15:11:49 UTC, Atila Neves wrote:
https://code.dlang.org/packages/tardy
On Monday, 15 June 2020 at 20:51:38 UTC, Stefan Koch wrote:
On Monday, 15 June 2020 at 20:47:16 UTC, 12345swordy wrote:
On Saturday, 13 June 2020 at 15:11:49 UTC, Atila Neves wrote:
https://code.dlang.org/packages/tardy
https://github.com/atilaneves/tardy
[...]
Wouldn't a top type be a
On Monday, 15 June 2020 at 20:47:16 UTC, 12345swordy wrote:
On Saturday, 13 June 2020 at 15:11:49 UTC, Atila Neves wrote:
https://code.dlang.org/packages/tardy
https://github.com/atilaneves/tardy
[...]
Wouldn't a top type be a better way to achieve this?
-Alex
the Talias in type functions
On Saturday, 13 June 2020 at 15:11:49 UTC, Atila Neves wrote:
https://code.dlang.org/packages/tardy
https://github.com/atilaneves/tardy
[...]
Wouldn't a top type be a better way to achieve this?
-Alex
On Monday, 15 June 2020 at 14:12:17 UTC, Atila Neves wrote:
[snip]
Yep:
https://github.com/atilaneves/tardy/blob/d5f1102a6a791e77e0a27ee1a7920166fba8fcc8/tests/ut/polymorphic.d#L222
Thanks, I missed that.
On Saturday, 13 June 2020 at 18:39:14 UTC, Paul Backus wrote:
On Saturday, 13 June 2020 at 15:11:49 UTC, Atila Neves wrote:
https://code.dlang.org/packages/tardy
https://github.com/atilaneves/tardy
Cool stuff!
What's the reasoning behind implementing your own vtables
instead of using D's
On Saturday, 13 June 2020 at 16:15:49 UTC, jmh530 wrote:
On Saturday, 13 June 2020 at 15:11:49 UTC, Atila Neves wrote:
https://code.dlang.org/packages/tardy
https://github.com/atilaneves/tardy
[snip]
This is pretty cool. Thanks for sharing.
I have a few questions/comments:
1) It might make
On Saturday, 13 June 2020 at 15:11:49 UTC, Atila Neves wrote:
https://code.dlang.org/packages/tardy
https://github.com/atilaneves/tardy
If this is what you say, it could be used for object-oriented
programing with types that are not designed as objects. Not only
that, in principle the design
On 6/13/20 2:39 PM, Paul Backus wrote:
On Saturday, 13 June 2020 at 15:11:49 UTC, Atila Neves wrote:
https://code.dlang.org/packages/tardy
https://github.com/atilaneves/tardy
Cool stuff!
What's the reasoning behind implementing your own vtables instead of
using D's built-in object system?
On Saturday, 13 June 2020 at 15:11:49 UTC, Atila Neves wrote:
https://code.dlang.org/packages/tardy
https://github.com/atilaneves/tardy
Cool stuff!
What's the reasoning behind implementing your own vtables instead
of using D's built-in object system? Don't want to be stuck
inheriting from
On Saturday, 13 June 2020 at 15:11:49 UTC, Atila Neves wrote:
Tardy lets users have their cake and eat it too by not making
them have to use classes for runtime polymorphism.
This is one of those things that is so obvious in hindsight.
Genius.
On Saturday, 13 June 2020 at 15:11:49 UTC, Atila Neves wrote:
https://code.dlang.org/packages/tardy
https://github.com/atilaneves/tardy
[snip]
This is pretty cool. Thanks for sharing.
I have a few questions/comments:
1) It might make a good blog post at some point to discuss this
and the
33 matches
Mail list logo