Thoughts about Class proposal #250
Replies: 8 comments 32 replies
-
Field-less classes, right? Yes. They can have method implementations as well as unimplemented methods, though, and they support multiple inheritance (because a class can implement any number of interfaces, and an interface can any number of superinterfaces).
Yes, this is one of the main issues. More in the meeting summary... |
Beta Was this translation helpful? Give feedback.
-
During the meeting, we wrote some examples to go through most elements of the draft design. Some ideas from the meeting:
|
Beta Was this translation helpful? Give feedback.
-
It did not occur to me during the meeting, but one motivation for the current approach was to support the way |
Beta Was this translation helpful? Give feedback.
-
#249 is now merged. For someone just starting, the documentation built by the pkg-build is probably the easiest way to get a sense of the current implementation: https://docs.racket-lang.org/rhombus/Classes_and_Interfaces_Overview.html https://docs.racket-lang.org/rhombus/Classes_and_Interfaces.html |
Beta Was this translation helpful? Give feedback.
-
I've started working on #201 using the new class system. I've written up some issues I encountered below. Views are hard to makeIn implementing an
Fields are hard to useConsider this
Each
|
Beta Was this translation helpful? Give feedback.
-
When you give a class an
|
Beta Was this translation helpful? Give feedback.
-
I've got some thoughts about properties. For starters, there's currently some inconsistencies in how properties are used. I expected this to work:
But it raises the compile error Additionally, for read-only properties, it's a bit weird I need to include the parentheses at all. Can we make this work?
For read-write properties, the current syntax for defining them is a little confusing. It wasn't obvious to me that it required using the case-arity function definition syntax, and it's a bit confusing to read because it's overloading the concepts of property mutability and function arity. I think I'd find something like this more readable:
Also, it's weird that setters can return values. I think all property setters should be required to return |
Beta Was this translation helpful? Give feedback.
-
So I'm defining a |
Beta Was this translation helpful? Give feedback.
-
I cannot make it tonight to the Zoom discussion, but here are some questions/comments I had.
Here is the toy example I've been experimenting with, and its expanded code:
https://gist.github.com/samdphillips/2ceb10fbe05e18c0c7cb00d920b48a5d
Beta Was this translation helpful? Give feedback.
All reactions