Skip to content

Rename @linq macro? #177

@CameronBieganek

Description

@CameronBieganek

I'm not sure if the current plan is to keep @linq or not, but if it is kept, I think a different name would make more sense. @linq only makes sense if you're a former C# programmer. Perhaps @query instead?

Also, I'd like to argue in favor of keeping @linq, or rather @query. Here's a query from the README that uses Pipe.jl (except I've changed :a to a, etc).

using Pipe
out = @pipe df |>
    @transform(_, y = 10 * x) |>
    @where(_, a .> 2) |>
    @by(_, b, meanX = mean(x), meanY = mean(y)) |>
    @orderby(_, meanX) |>
    @select(_, meanX, meanY, var = b)

What I would prefer is a begin block syntax like this:

using Pipe
out = @query df begin
    transform(y = 10 * x)
    where(a .> 2)
    by(b, meanX = mean(x), meanY = mean(y))
    orderby(meanX)
    select(meanX, meanY, var = b)
end

I think the begin-block syntax is much easier to read. The second example avoids the noise from all the @, _, and |> symbols.

Actually, I already have an open issue for begin-block syntax for the @linq macro: #136

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions