-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement GTK interfaces through next concepts #130
Comments
I think you do not really mean sum types, as sum types refer to Nim's object variants. I think you mean the or types which we use in gintro as substitute for interfaces? Have you already working GTK code examples using concepts? Work they really better than our current solution? What are the advantages in detail? in 2014 concepts where considered as not very reliable, and they where even moves to the experimental section. Some people reported for long compile times when using concepts. Is all that fixed with the new concept design? |
No, this issue is for the future, now the concepts are in constant processing of ideas, as Yardanico informed me. But according to the existing RFCs, it is clear that they are most likely better suited than the or types. ( I and a few other people in the chat consider this to be generic constraints. Here's an example of what it might look like. public interface ListModel : Object {
public abstract Object? get_item (uint position);
public abstract uint get_n_items ();
public Object? get_object (uint position);
}
Nim: type
ListModel = concept
proc get_item(position: uint): Object
proc get_n_items(): uint
proc get_object(position: uint): Object
# kind of interface implementation
proc get_item[T: ListModel](self: T) =
... |
nim-lang/RFCs#168
Implement GTK interfaces through new concepts when they come out, instead of sum types.
This is an issue for the future
For example GtkBuildable now:
The text was updated successfully, but these errors were encountered: