Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added documentation for all repl types #52876

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

RichieWilynnton
Copy link
Contributor

@RichieWilynnton RichieWilynnton commented Jan 12, 2024

Part of #52725.

stdlib/REPL/src/REPL.jl Outdated Show resolved Hide resolved
@stevengj stevengj added docs This change adds or pertains to documentation REPL Julia's REPL (Read Eval Print Loop) labels Jan 12, 2024
@stevengj
Copy link
Member

stevengj commented Jan 14, 2024

You'll need to update the branch (merge/rebase master) and update

julia/stdlib/REPL/test/repl.jl

Lines 1753 to 1757 in f286d44

@testset "Docstrings" begin
undoc = Docs.undocumented_names(REPL)
@test_broken isempty(undoc)
@test undoc == [:AbstractREPL, :BasicREPL, :LineEditREPL, :StreamREPL]
end
to

@testset "Docstrings" begin
    @test isempty(Docs.undocumented_names(REPL))
end

@stevengj
Copy link
Member

Looks like you had a merge problem, and a whole bunch of unrelated commits are now included in this PR. 😢

stdlib/REPL/src/REPL.jl Outdated Show resolved Hide resolved
Co-authored-by: Steven G. Johnson <[email protected]>
stdlib/REPL/src/REPL.jl Outdated Show resolved Hide resolved
"""
AbstractREPL

The abstract base type for all REPL implementations in Julia. `AbstractREPL` serves as a blueprint for defining various REPL interfaces.
Copy link
Member

Choose a reason for hiding this comment

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

No need to explain what "abstract base type" means — this is standard terminology.

Suggested change
The abstract base type for all REPL implementations in Julia. `AbstractREPL` serves as a blueprint for defining various REPL interfaces.
The abstract base type for all REPL implementations in Julia.

@stevengj
Copy link
Member

@Keno should really weigh in here, since he wrote this stuff originally.

@stevengj stevengj requested a review from Keno January 20, 2024 14:11
Copy link
Member

@Keno Keno left a comment

Choose a reason for hiding this comment

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

I think this is fine, but I think the docstrings could be more helpful. I'm a little worried that just adding minimal docstrings like this isn't really helpful in addressing the documentation shortcomings that the test_broken was supposed to mark.


The abstract base type for all REPL implementations in Julia. `AbstractREPL` serves as a blueprint for defining various REPL interfaces.

Implementations of `AbstractREPL` must define specific methods that dictate how the REPL reads input, evaluates it, and prints output.
Copy link
Member

Choose a reason for hiding this comment

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

Similar to the above, I don't think this is particularly useful either. In general abstract types should either document the interface (which is not really stable here, so probably doesn't make sense) or tell you which concrete type you should choose instead, so some of the feature comparison discussion below might help.

There could also potentially be discussions of the overall REPL architecture (frontend/backend split) or other topics that span across implementations here.

"""
BasicREPL

A mutable struct representing a basic implementation of the Julia REPL (Read-Eval-Print Loop), primarily designed for straightforward and fundamental interactive command execution.
Copy link
Member

Choose a reason for hiding this comment

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

The fact that it's a mutable struct is not really relevant. I'm also not sure the docstring as a whole is helpful. Obviously, the BasicREPL type is a basic REPL. The question that the docstring should answer is:

  1. How do I use this?
  2. When should I prefer this over other RPEL types
  3. What are the limitations of this type that the other REPL types do not have.

This REPL type integrates features such as cursor movement, text editing, command history navigation, auto-completion, and more interactive elements that facilitate a more efficient and user-friendly command-line experience.
Unlike `BasicREPL`, which provides fundamental REPL functionalities, `LineEditREPL` focuses on a richer and more interactive command-line interface.
It is particularly suited for environments where extended command-line usability is essential, offering a more sophisticated and feature-rich interface for users who perform complex and frequent interactions with the Julia REPL.
This REPL type is typically the default in standard Julia installations, reflecting its comprehensive functionality that caters to a wide range of user needs.
Copy link
Member

Choose a reason for hiding this comment

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

Should link to the manual section. https://docs.julialang.org/en/v1/stdlib/REPL/

Co-authored-by: Steven G. Johnson <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs This change adds or pertains to documentation REPL Julia's REPL (Read Eval Print Loop)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants