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

Add explicit use statement for non-prelude functions to examples #604

Merged
merged 1 commit into from
Oct 8, 2024

Conversation

Bzero
Copy link
Contributor

@Bzero Bzero commented Oct 8, 2024

Resolves #602.

Copy link
Owner

@sharkdp sharkdp left a comment

Choose a reason for hiding this comment

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

Thank you!

@sharkdp sharkdp merged commit a823d62 into sharkdp:master Oct 8, 2024
15 checks passed
@sharkdp
Copy link
Owner

sharkdp commented Oct 8, 2024

Should we maybe add an additional >>> here?

image

@Bzero
Copy link
Contributor Author

Bzero commented Oct 9, 2024

We can do that. Would you do it for all multi-line examples or only here with the use statements?

@Goju-Ryu
Copy link
Contributor

Goju-Ryu commented Oct 9, 2024

I’m thinking all of the multi line examples to make it clear what is input and what is output.

@sharkdp
Copy link
Owner

sharkdp commented Oct 9, 2024

Just be aware that there might be multi-line expressions which should not be formatted this way. So something like

fn f(x) =
  x² + 1

should not be rendered as

>>> fn f(x) =
>>>  x² + 1

because it needs to be entered as a single line.

The easiest (and possibly best?) option might be to get rid of the >>> prompts all-together?

@Bzero
Copy link
Contributor Author

Bzero commented Oct 10, 2024

Yes, it would not be straight forward to distinguish those cases.

The easiest (and possibly best?) option might be to get rid of the >>> prompts all-together?

I think the >>> prompts help to distinguish in and output in the examples, especially for the many one-liners we have so I would prefer to keep them. How about adding additional whitespace to the start of the lines to get a common indentation?

@sharkdp
Copy link
Owner

sharkdp commented Oct 10, 2024

I think the >>> prompts help to distinguish in and output in the examples, especially for the many one-liners we have so I would prefer to keep them.

But we also have an indented equals sign for the outputs. So we would go from

>>> floor_in(m, 5.7 m)

    = 5 m    [Length]

to

floor_in(m, 5.7 m)

    = 5 m    [Length]

I don't really see a problem with that. I think I even prefer the latter one. Some users might not immediately understand that >>> is supposed to be a prompt.

@Bzero
Copy link
Contributor Author

Bzero commented Oct 10, 2024

Yes that's true as well, I think it's fine to remove it then.

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.

Cannot find quadratic_equation on numbat.dev
3 participants