Comments (2)
From the Slack thread, it's notable that other languages like Python (@dataclass
: https://docs.python.org/3/library/dataclasses.html) and C# (record
: https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/record), among others, have seen fit to bring this feature into the language in some official capacity.
Suggests that some standard solution would be a benefit, even if it is not a priority.
from julia.
I think it would be great if this could be added to Julia. The first question would be if the maintainers are open to such an idea. The design would depend on the functionality one wants to implement. A very modest approach would be a macro defining ==
, isequal
and hash
for a type T
based on a list of fields that defaults to fieldnames(T)
. That wouldn't need much code.
BTW, my package https://github.com/matthias314/StructEqualHash.jl is now in the registry.
from julia.
Related Issues (20)
- [1.10] Type inference imprecision in broadcast HOT 10
- `have_bf16` always returns `false` on Nvidia Grace CPU (neoverse-v2) on Linux
- `foo(x::Tuple{Vararg})` specializes much more aggressively than `foo(x...)` HOT 8
- Encode type-/layout- vs. region-based alias info separately in LLVM IR
- Meta.parse(repr(Char(0x110000))) fails HOT 3
- Random stdlib: randstring(rand(UInt8)) errors
- Most packages with artifacts are not relocatable HOT 4
- REPL stdout output should not be highlighted in code examples HOT 1
- pivoted cholesky(I(2)) not implemented
- Bounds check inconsistency in `keepat!`/`deleteat!`
- Unreachable reached and Illegal Instruction in v1.10+ HOT 3
- `in(::Missing, ::Any)` inconsistency
- Overallocation of arrays now seems to persist through precompile serialization on 1.11+ HOT 7
- type application doesn't infer as consistent HOT 1
- Can't compute eigenvalues of Hermitian Diagonal matrix for generic types
- Heap snapshot does not seem to work anymore on 1.11 (in chrome profile loader) HOT 3
- `@inbounds` overrides `val` variable in macros. Wrong usage of `local` HOT 4
- Unwrapped Union Alls can't be added more than two times to a vector with [] syntax. Reproducible crash when using these vectors.
- Basic use of StaticArrays and `begin ... end` leads to GC error (probable corruption) HOT 6
- New `copy_string` function
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from julia.