-
Notifications
You must be signed in to change notification settings - Fork 2
Generic sample function #2
Comments
Please check the reply. |
Templates still don't work because of module error. |
Thank you for helping me in this question @Delta456 The following independent code works:
I can't really test the module version any more because I have an another issue with module building. I will open another issue for that. |
If you adjust your answer accordingly ( |
There are some problems with public generics function and method. It is similar to vlang/v#2547 and vlang/v#2528 |
Ah - I see. Generics currently seem to be a hot topic anyway. I guess it's best to just wait until this is sorted out. |
As generics are back in the new backend. Your function works. Here my implementation of sample in V which is better. |
Excellent! Thanks for keeping me in the loop. I guess your module |
@nevrome You can improve and keep this. Someone will use it. |
Maybe I will come back to it eventually, but right now I have enough side projects. If you find some code in here that you find useful, then feel free to steal it. 😄 |
@nevrome You should archive it for now. Don't forget to make more modules with V! Its way better now!! |
I would like to implement a generic sample function for arrays in V. The inspiration for this is base::sample() in R.
Related stackoverflow question: https://stackoverflow.com/questions/57997114/how-to-write-a-generic-sample-function-in-v
The text was updated successfully, but these errors were encountered: