-
Notifications
You must be signed in to change notification settings - Fork 80
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
Support for union types by the language? #13
Comments
That will not work, if you are interested in something like virtual functions there are plans to include them, but I haven't decided on syntax or anything on them yet. Going back to your example though, it would be possible for the compiler to say expand
Which would probably be a tad slower than virtual functions but you wouldn't have to store the function in the datatype. This would honestly be low on my list of priorities for the 1.0 release as you could just write a macro function to do the same thing:
then just call it with |
Such feature would probably have different implementation than ordinary vtable, it may be more like Smalltalk does it. Anyway, I understood the macro example, really good one. Will it be possible to invoke a macro without explicitly using its name (the |
To do that you would probably have to add that macro function as an event listener for a function/variable not found event
|
Ouch, this is still over my head. It would be very handy to replace certain existing functions, even better if only inside specific scope. E.g. inside unit tests, instead of tricks or design changes to support mocking. |
Say I have:
Does the language support "polymorphic use" through union parameters? Say I have functions:
The text was updated successfully, but these errors were encountered: