Originally posted by **radeusgd** May 25, 2023
The [discussion](https://github.com/enso-org/enso/pull/6817#discussion_r1205810671) on #6817 showed that our number type names and `Value_Type` are misaligned:
> Unfortunately with `Value_Type` with have a bit of inconsistency between it and the Enso types.
>
>
>
>
Value Type
>
Enso Type
>
>
Value_Type.Integer
>
Integer
>
>
Value_Type.Float
>
Decimal
>
>
Value_Type.Decimal
>
(currently not supported) BigDecimal
>
>
> The names for value type were chosen to be close to the SQL type names. Maybe we should rename Enso `Decimal` into `Float`?? It is indeed a bit confusing to have this inconsistency. Also indeed, `Decimal` often suggests precise decimals, where we have IEEE-754 floating points.
>
As discussed, we decided that we want to rename the `Decimal` type to `Float`.
- [ ] Rename the `Decimal` type in Enso code into `Float`.
- [ ] Also in error messages and docs.
- [ ] Rename any references to the `Decimal` type name in the Java engine code.
- [ ] Ensure that tests are still passing.
- [ ] Rename any utilities in the Java engine, like nodes - `ToDecimalNode` should now be `ToFloatNode`, the `decimal` packages should be renamed to `float` etc.
I found the following snippets in your repository. I will now analyze these snippets and come up with a plan.
Some code snippets I looked at (click to expand). If some file is missing from here, you can mention the path in the ticket description.
https://github.com/sweepai-dev/enso/blob/828d160c565e3ee2f25030a87fee795243e91379/docs/semantics/numbers.md#L1-L66
https://github.com/sweepai-dev/enso/blob/828d160c565e3ee2f25030a87fee795243e91379/distribution/lib/Standard/Base/0.0.0-dev/src/Data/Numbers.enso#L331-L513
https://github.com/sweepai-dev/enso/blob/828d160c565e3ee2f25030a87fee795243e91379/distribution/lib/Standard/Base/0.0.0-dev/src/Data/Numbers.enso#L592-L697
https://github.com/sweepai-dev/enso/blob/828d160c565e3ee2f25030a87fee795243e91379/docs/syntax/naming.md#L1-L88
https://github.com/sweepai-dev/enso/blob/828d160c565e3ee2f25030a87fee795243e91379/engine/runtime/src/test/scala/org/enso/compiler/test/semantic/ImportExportTest.scala#L185-L256
Step 2: π§ Snippet Analysis
From looking through the relevant snippets, I decided to make the following modifications:
I have created a plan for writing the pull request. I am now working my plan and coding the required changes to address this issue. Here is the planned pull request:
Rename Decimal type to Floatsweep/rename-decimal-to-float
Description
This PR renames the Decimal type to Float in the Enso codebase. It also updates error messages, documentation, and references to the Decimal type in the Java engine code. Additionally, utilities in the Java engine, such as nodes and packages, are renamed accordingly. Finally, tests are updated to reflect the renaming of Decimal to Float.
Summary of Changes
Renamed the Decimal type to Float in the Enso codebase.
Updated error messages and documentation to reflect the renaming of Decimal to `Float.
Renamed references to the Decimal type in the Java engine code.
Renamed utilities in the Java engine, such as nodes and packages, to reflect the renaming of Decimal to Float.
Updated tests to reflect the renaming of Decimal to Float.
Step 4: β¨οΈ Coding
I have finished coding the issue. I am now reviewing it for completeness.
Step 5: π Code Review
Success! π
I'm a bot that handles simple bugs and feature requests but I might make mistakes. Please be kind!
Join Our Discord
Discussed in https://github.com/orgs/enso-org/discussions/6858
Here's the PR! https://github.com/sweepai-dev/enso/pull/6.
π Sweep Pro: I used GPT-4 to create this ticket. You have 1041 GPT-4 tickets left.
Step 1: π Code Search
I found the following snippets in your repository. I will now analyze these snippets and come up with a plan.
Some code snippets I looked at (click to expand). If some file is missing from here, you can mention the path in the ticket description.
https://github.com/sweepai-dev/enso/blob/828d160c565e3ee2f25030a87fee795243e91379/docs/semantics/numbers.md#L1-L66 https://github.com/sweepai-dev/enso/blob/828d160c565e3ee2f25030a87fee795243e91379/distribution/lib/Standard/Base/0.0.0-dev/src/Data/Numbers.enso#L331-L513 https://github.com/sweepai-dev/enso/blob/828d160c565e3ee2f25030a87fee795243e91379/distribution/lib/Standard/Base/0.0.0-dev/src/Data/Numbers.enso#L592-L697 https://github.com/sweepai-dev/enso/blob/828d160c565e3ee2f25030a87fee795243e91379/docs/syntax/naming.md#L1-L88 https://github.com/sweepai-dev/enso/blob/828d160c565e3ee2f25030a87fee795243e91379/engine/runtime/src/test/scala/org/enso/compiler/test/semantic/ImportExportTest.scala#L185-L256Step 2: π§ Snippet Analysis
From looking through the relevant snippets, I decided to make the following modifications:
distribution/lib/Standard/Base/0.0.0-dev/src/Data/Numbers.enso
Decimal
type toFloat
and update all its usages in this file.docs/semantics/numbers.md
Decimal
withFloat
.engine/runtime/src/main/java/org/enso/interpreter/node/expression/builtin/number/Decimal.java
Float.java
and update the class name inside the file fromDecimal
toFloat
.engine/runtime/src/main/java/org/enso/interpreter/node/expression/builtin/number/decimal/ToDecimalNode.java
ToFloatNode.java
and update the class name inside the file fromToDecimalNode
toToFloatNode
.engine/runtime/src/test/scala/org/enso/compiler/test/semantic/ImportExportTest.scala
Decimal
withFloat
.Step 3: π Planning
I have created a plan for writing the pull request. I am now working my plan and coding the required changes to address this issue. Here is the planned pull request:
Rename
Decimal
type toFloat
sweep/rename-decimal-to-float
Step 4: β¨οΈ Coding
I have finished coding the issue. I am now reviewing it for completeness.
Step 5: π Code Review
Success! π
I'm a bot that handles simple bugs and feature requests but I might make mistakes. Please be kind! Join Our Discord