Skip to content

README improvements#18

Open
waldyrious wants to merge 1 commit into
jkrumbiegel:masterfrom
waldyrious:patch-1
Open

README improvements#18
waldyrious wants to merge 1 commit into
jkrumbiegel:masterfrom
waldyrious:patch-1

Conversation

@waldyrious
Copy link
Copy Markdown
Contributor

  • Add a simpler introductory example (inspired by this Discourse post by @Satvik)
  • Rename "Example" section to "Usage" and make the two next sections into subsections of it
  • Normalize headings to sentence case
  • Reword a couple sentences to adjust to the package rename (from PipelessPipes.jl to Chain.jl)
  • Add a link to DataFrames.jl

- Add a simpler introductory example
- Rename "Example" section to "Usage"
  and make the two next sections into subsections of it
- Normalize headings to sentence case
- Reword a couple sentences to adjust to the package rename
  (from `PipelessPipes.jl` to `Chain.jl`)
- Add a link to DataFrames.jl
Comment thread README.md

```julia
julia> @chain 1:3 begin
_ .+ 1
Copy link
Copy Markdown
Owner

@jkrumbiegel jkrumbiegel Mar 7, 2021

Choose a reason for hiding this comment

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

In principle I'm not opposed to adding a simple non-DataFrame example. But _ .+ 1 and _ .^ 2 show the same syntax twice, which doesn't show off the range of options.

This for example shows a couple different things you can do:

@chain 1:10 begin
	  _ .^ 2
	  mod.(5)
	  filter(iseven, _)
	  sum
end

Maybe there is a more didactic example than this.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

What about this:

julia> names = ["ursula", "alice", "iris", "olga", "erica"]
5-element Vector{String}:
 "ursula"
 "alice"
 "iris"
 "olga"
 "erica"

julia> @chain names begin
    filter(contains("a"), _)
    @. uppercasefirst
    sort
    join(" and ")
    "$_ have an 'A' in their name."
end
"Alice and Erica and Olga and Ursula have an 'A' in their name."

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

That's a good point — but I believe it makes sense for the very first example to aim for a demonstration of the basic structure of a chained block, rather than showcasing the variety of possibilities. With that in mind, I would maybe start with the first example you offered above, and show the second one next. This way we can keep the advantages of both. WDYT?

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