Re:A categorized list of all Java and JVM features since JDK...
by chrisseaton on Thursday April 01, 2021 @03:31PM
(#26665010)
Does Scala have value types?
[ Parent
| on HN ]
Re:A categorized list of all Java and JVM features since JDK...
by halfmatthalfcat on Thursday April 01, 2021 @03:35PM
(#26665053)
Re:A categorized list of all Java and JVM features since JDK...
by chrisseaton on Thursday April 01, 2021 @03:39PM
(#26665086)
Ah right - that's not really what we're talking about here, even though they have the same name.
Re:A categorized list of all Java and JVM features since JDK...
by halfmatthalfcat on Thursday April 01, 2021 @03:52PM
(#26665231)
“Codes like a class, works like an int!” - Taken from the top of the page.
This is exactly what Value Classes are in Scala. You supply an underlying value which is then interpreted as the value itself, not a reference.
Re:A categorized list of all Java and JVM features since JDK...
by chrisseaton on Thursday April 01, 2021 @04:31PM
(#26665643)
What you're talking about is just wrapping a single value. It's a type-system thing.
What we're talking about are wrapping compound values. It's a VM implementation thing.
They're not really comparable.