Skip to content

Conversation

@rocky
Copy link
Member

@rocky rocky commented Jul 19, 2022

This now about does it. There are a couple of get_string_value's still in there in those places where we haven't ensured that we are working with String.

There was a time long long ago when you will see one of the maintainers proding contributors not to use .value and use the (more awkward) get_xxx_value().

That was then and this is now. The reason we use .value is for a couple of reasons. It is not just an artistic kind of thing, but this is actually the convention that many interpreters use. And part of it is that if you have some Object (or boxed, or wrapped) form of a primitive data type and you want the underlying primitive data, it isn't desired to make those look different: so i.value and s.value instead of i.get_int_value() and s.get_string_value(). If somehow you are upset about the accessor not reflecting the type (which in other interpreters is considered a good thing), then the way you get that back is via type annotations, not method naming.

Perhaps in the days before type annotations a better argument could be made. But again, that was then, and this is now.

@rocky rocky force-pushed the mathics-5.0-upgrade branch from 4e09ead to 30e9488 Compare July 19, 2022 15:19
@rocky rocky force-pushed the mathics-5.0-upgrade branch from 30e9488 to f05d82a Compare July 19, 2022 15:32
@rocky rocky requested review from TiagoCavalcante and mmatera July 19, 2022 15:34
@rocky rocky merged commit 29ecc61 into master Jul 19, 2022
@TiagoCavalcante TiagoCavalcante deleted the mathics-5.0-upgrade branch July 19, 2022 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants