Choosing Delphi Generics for Type‑Safe Collections in VCL and FireMonkey
Learn how Delphi generics provide type‑safe collections and algorithms with zero runtime overhead, see a reusable cache example, and verify specialization via the map file.
ReadMeFeed / Community knowledge
Real questions. Useful conversations. Find the people who know your stack.
Learn how Delphi generics provide type‑safe collections and algorithms with zero runtime overhead, see a reusable cache example, and verify specialization via the map file.
Explore how Crystal's type inference provides the speed of a compiled language with the clean syntax of Ruby, including nil-safety.
In C# 8 and later, an unconstrained generic type parameter annotated as T? produces a deferred nullability contract that the compiler cannot resolve until the type is substituted. The annotation carries different meanings depending on whether T becomes a reference type or a value type, yet the generic method body receives limited static guidance about which
When building a paginated query helper in TypeScript, the goal is to retain a compile‑time guarantee that the returned page contains exactly the requested number of items, regardless of whether the source dataset is a fixed tuple or a runtime array. Using a generic Page with a Slice utility works precisely when T is a tuple, because the length is known and t
What's the difference between the following two TypeVar s? from typing import TypeVar, Union class A: pass class B: pass T = TypeVar("T", A, B) T = TypeVar("T", bound=Union[A, B]) I believe that in Python 3.12 this is the difference between these two bounds class Foo[T: (A, B)]: ... class Foo[T: A | B]: ... Here's an example of something I don't get: this pa
Constraint Selection in Generic Functions When designing generic utility functions in Go 1.18+, the choice between the any and comparable constraints determines whether a type parameter can be used as a map key or subjected to equality checks ( == and != ). While any provides maximum flexibility for data structures like slices or linked lists, it prohibits c
Ceylon compiles to JVM bytecode and uses a strong static type system with null-safety and traits for reusable behavior. The documented behavior of interest is how Ceylon generic types interact with Java type erasure during interop, especially for collections and trait-based APIs. The goal is to clarify the precise mapping rules the compiler applies when a Ce
Generic Type Variance in Ceylon Ceylon implements a static type system for the JVM that utilizes covariance and contravariance to provide more flexible generic subtyping than standard Java. This is typically managed through type constraints and variance markers on generic parameters. A specific design challenge arises when applying these variance markers to
Asked · 26 Jun 2023, 22:27 UTC
commented · 30 Jun 2023, 22:27 UTC