Skip to content

Conversation

JaroslavTulach
Copy link
Member

@JaroslavTulach JaroslavTulach commented Sep 24, 2025

Pull Request Description

Important Notes

  • coming from Java with its Object.toString - one might be fine with to_text in Any
    • however pretty and to_display_text clearly seem weird
  • moreover my object oriented roots are in Turbo Pascal 5.5
    • the root object there - the TObject had no methods at all!
    • while clean (e.g. Turbo Pascal was no "something oriented language", but trully just an object oriented language) - I don't call for that in case of Enso
    • ultimatelly I'd like Enso to be "conversion oriented language" - e.g. Any.to is perfectly fine in the root type
  • with all the extension method capabilities Enso has, I believe moving to_display_text, pretty out of Any is a completely legitimate goal

Checklist

Please ensure that the following checklist has been satisfied before submitting the PR:

  • The documentation has been updated, if necessary.
  • Screenshots/screencasts have been attached, if there are any visual changes. For interactive or animated visual changes, a screencast is preferred.
  • All code follows the
    Scala,
    Java,
    TypeScript,
    and
    Rust
    style guides. In case you are using a language not listed above, follow the Rust style guide.
  • Unit tests have been written where possible.
  • If meaningful changes were made to logic or tests affecting Enso Cloud integration in the libraries,
    or the Snowflake database integration, a run of the Extra Tests has been scheduled.
    • If applicable, it is suggested to paste a link to a successful run of the Extra Tests.

@JaroslavTulach JaroslavTulach self-assigned this Sep 24, 2025
@JaroslavTulach JaroslavTulach changed the title Defining to_text & co. as extension methods Defining to_text & co. as extension methods Sep 24, 2025
@github-actions github-actions bot added the -libs-API-change-Base Marks a PR that changes the public API of Standard.Base label Sep 24, 2025
Copy link
Member

@jdunkerley jdunkerley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Going to need to add from project.Data.Text.Extensions import all to a lot of files in Standard.Base.
Think about 57 files need it added,

@JaroslavTulach
Copy link
Member Author

Going to need to add from project.Data.Text.Extensions import all to a lot of files in Standard.Base. Think about 57 files need it added,

  • why do we need to add such imports?
  • all the tests seem to be green?
  • is there some other test that's failing and I should fix it?

@jdunkerley
Copy link
Member

Going to need to add from project.Data.Text.Extensions import all to a lot of files in Standard.Base. Think about 57 files need it added,

  • why do we need to add such imports?
  • all the tests seem to be green?
  • is there some other test that's failing and I should fix it?

Take Random.enso it has a call to make a uuid: uuid self = UUID.randomUUID.to_text
Guessing we don't have a test on this method (our coverage is slowly improving but far from 100%).

This would have worked previously but will now error as this code does not import Text extensions.

@jdunkerley
Copy link
Member

jdunkerley commented Sep 26, 2025

Ones I suspect (but maybe false positives):

  • distribution/lib/Standard/Base/0.0.0-dev/src/Any.enso
  • distribution/lib/Standard/Base/0.0.0-dev/src/Data.enso
  • distribution/lib/Standard/Base/0.0.0-dev/src/Data/Array.enso
  • distribution/lib/Standard/Base/0.0.0-dev/src/Data/Decimal.enso
  • distribution/lib/Standard/Base/0.0.0-dev/src/Data/Index_Sub_Range.enso
  • distribution/lib/Standard/Base/0.0.0-dev/src/Data/Interval.enso
  • distribution/lib/Standard/Base/0.0.0-dev/src/Data/List.enso
  • distribution/lib/Standard/Base/0.0.0-dev/src/Data/Maybe.enso
  • distribution/lib/Standard/Base/0.0.0-dev/src/Data/Number_Utils.enso
  • distribution/lib/Standard/Base/0.0.0-dev/src/Data/Numbers.enso
  • distribution/lib/Standard/Base/0.0.0-dev/src/Data/Range.enso
  • distribution/lib/Standard/Base/0.0.0-dev/src/Data/Read/Many_Files_List.enso
  • distribution/lib/Standard/Base/0.0.0-dev/src/Data/Read/Return_As.enso
  • distribution/lib/Standard/Base/0.0.0-dev/src/Data/Regression.enso
  • distribution/lib/Standard/Base/0.0.0-dev/src/Data/Statistics.enso
  • distribution/lib/Standard/Base/0.0.0-dev/src/Data/Text/Case_Sensitivity.enso
  • distribution/lib/Standard/Base/0.0.0-dev/src/Data/Text/Encoding.enso
  • distribution/lib/Standard/Base/0.0.0-dev/src/Data/Text/Text_Ordering.enso
  • distribution/lib/Standard/Base/0.0.0-dev/src/Data/Text/Text_Sub_Range.enso
  • distribution/lib/Standard/Base/0.0.0-dev/src/Data/Time/Date_Range.enso
  • distribution/lib/Standard/Base/0.0.0-dev/src/Data/Time/Date_Time_Formatter.enso
  • distribution/lib/Standard/Base/0.0.0-dev/src/Data/Time/Time_Zone.enso
  • distribution/lib/Standard/Base/0.0.0-dev/src/Data/Vector.enso
  • distribution/lib/Standard/Base/0.0.0-dev/src/Enso_Cloud/Enso_User.enso
  • distribution/lib/Standard/Base/0.0.0-dev/src/Enso_Cloud/Errors.enso
  • distribution/lib/Standard/Base/0.0.0-dev/src/Enso_Cloud/Public_Utils.enso
  • distribution/lib/Standard/Base/0.0.0-dev/src/Error.enso
  • distribution/lib/Standard/Base/0.0.0-dev/src/Errors/Common.enso
  • distribution/lib/Standard/Base/0.0.0-dev/src/Errors/Empty_Error.enso
  • distribution/lib/Standard/Base/0.0.0-dev/src/Errors/File_Error.enso
  • distribution/lib/Standard/Base/0.0.0-dev/src/Errors/No_Such_Key.enso
  • distribution/lib/Standard/Base/0.0.0-dev/src/Errors/Time_Error.enso
  • distribution/lib/Standard/Base/0.0.0-dev/src/Errors/Wrapped_Error.enso
  • distribution/lib/Standard/Base/0.0.0-dev/src/Function.enso
  • distribution/lib/Standard/Base/0.0.0-dev/src/Internal/Array_Like_Helpers.enso
  • distribution/lib/Standard/Base/0.0.0-dev/src/Internal/Context_Helpers.enso
  • distribution/lib/Standard/Base/0.0.0-dev/src/Internal/Instrumentor.enso
  • distribution/lib/Standard/Base/0.0.0-dev/src/Internal/Rounding_Helpers.enso
  • distribution/lib/Standard/Base/0.0.0-dev/src/Internal/Time/Format/Analyzer.enso
  • distribution/lib/Standard/Base/0.0.0-dev/src/Internal/Time/Format/As_Java_Formatter_Interpreter.enso
  • distribution/lib/Standard/Base/0.0.0-dev/src/Meta.enso
  • distribution/lib/Standard/Base/0.0.0-dev/src/Metadata.enso
  • distribution/lib/Standard/Base/0.0.0-dev/src/Network/HTTP/HTTP_Error.enso
  • distribution/lib/Standard/Base/0.0.0-dev/src/Panic.enso
  • distribution/lib/Standard/Base/0.0.0-dev/src/Random.enso
  • distribution/lib/Standard/Base/0.0.0-dev/src/Runtime/Source_Location.enso
  • distribution/lib/Standard/Base/0.0.0-dev/src/System/Advanced/Restartable_Input_Stream.enso
  • distribution/lib/Standard/Base/0.0.0-dev/src/System/Encoding/Encoding_Resolver.enso
  • distribution/lib/Standard/Base/0.0.0-dev/src/System/File.enso
  • distribution/lib/Standard/Base/0.0.0-dev/src/System/File/Advanced/Temporary_File.enso
  • distribution/lib/Standard/Base/0.0.0-dev/src/System/File/File_Access.enso
  • distribution/lib/Standard/Base/0.0.0-dev/src/System/File/Generic/File_Like.enso
  • distribution/lib/Standard/Base/0.0.0-dev/src/System/File/Generic/Writable_File.enso
  • distribution/lib/Standard/Base/0.0.0-dev/src/System/File/Local_File_Write_Strategy.enso
  • distribution/lib/Standard/Base/0.0.0-dev/src/System/Process/Exit_Code.enso
  • distribution/lib/Standard/Base/0.0.0-dev/src/System/Process/Process_Builder.enso
  • distribution/lib/Standard/Base/0.0.0-dev/src/Widget_Helpers.enso

@JaroslavTulach
Copy link
Member Author

Ones I suspect (but maybe false positives):

  • I was also expecting bunch of failures
  • but apparently the CI is green enough
  • somehow the Any.to_text method must become available without changing the imports...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
-libs-API-change-Base Marks a PR that changes the public API of Standard.Base
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants