I was reading through the Hacklang docs on Collections, and came across this curious definition [paraphrased slightly]: interface KeyedIterable<Tk, Tv> ... interface ConstVector<+Tv> implements KeyedIterable<int, Tv> ... Of course, KeyedIterable must be read-only with respect to Tv, and indeed it is since its methods cannot modify its type. It could be specified to be covariant on at least Tv, but isn't. I was wondering what impetus there could be to do this? --- Edit: I read the definition w...| Recent Questions - Software Engineering Stack Exchange
Exploring parameter packs (the repeat-each stuff) in Swift to count how many types are in the generic argument clause, or if that’s empty.| Christian Tietze
From time to time I like to take a look at Java JDK source code to learn more about how the contributors think about various topics. While I was looking into how enum is implemented, I noticed something very familiar in the declaration of Enum class, the class which is responsible with enum implementation in […]| UnlinkedList
Discuss this post on HackerNews and /r/programming| Performance is a Feature!
While using compile-time builder generator crates, I realized that I had run into a niche problem that required lot more flexibility with generic structs and functions than I was getting. If you like, follow me down a rabbit hole and explore the builder pattern from a very generic-centric perspective.| Geo’s Notepad
本文永久链接 - https://tonybai.com/2024/08/19/some-changes-in-go-1-23 距离上一次Go 1.22版本发布又过去六个月了,我们如期迎来了Go 1.23版本的发布。 对于Go项目乃至整个Go社区而言,这个版本还有一点额外| tonybai.com
Understand Java Generics' super and extends| Gary Gregory
Using parameterized classes with static functions to make up for| A Scripter's Notes
This article explains Dart Generics and how to use them.| tech&Life
A multicast event is an event that can have multiple listeners (or event handlers). Some languages (such as .NET languages) have built-in support for multicast events. This article shows an impleme…| grijjy blog
This curious little pattern can be helpful for certain problems that involve generics. We’ll look at what it is, and at a couple of use cases for it. What is it? The Curiously Recurring Gener…| grijjy blog
Go语言的1.17版本发布了,其中开始正式支持泛型了。虽然还有一些限制(比如,不能把泛型函数export),但是,可以体验了。我的这个《Go编程模式》的系列终于有了真正的泛型编程了,再也不需要使用反射或是go generation这些难用的技术了。周末的时候,我把Go 1.17下载下来,然后,体验了一下泛型编程,还是很不错的。下面,就让我们来看一下Go的泛型编程。(注:不过,...| 酷 壳 - CoolShell
A common solution to treating a generic type as non-generic is to implement an interface or make the generic type extend from a non-generic base class. Among other reasons, this allows you to insta…| whatheco.de
When we say something like 5 + 3, we aren’t usually surprised to learn that we are speaking of 8. And when we write this as a program for a machine to execute, we expect it to evaluate this expression to 8 as well. Everyone is familiar with the sign + since we all learned it in elementary school, and we know what happens when we add two numbers together.| Terminally Undead