In Pipe.@pipe, |> followed by .|> Gives an error

|> followed by .|> Gives an error

@pipe 2 |>  _ .+ (1:3)                            #Works
@pipe       2 .+ (1:3)  .|>  _^2                  #Works
@pipe 2 |>  _ .+ (1:3)  .|>  _^2                  #Gives Error

Is there a way around this?
It works the other way round: .|> followed by |>
Example

@pipe (1:3)  .|>  _^2   |>   sum                  #Works
1 Like
using MacroTools
MacroTools.prettify(@macroexpand @pipe 2 |>  _ .+ (1:3)  .|>  _^2 )

gives

:((2 |> 2 .+ (1:3)) .|> (mosquito->mosquito ^ 2))

but this works

@pipe 2 |>  _ .+ (1:3)  |>  _ .^ 2 

I think it’s just a parseing bug in Pipe.jl, so should raise an issue on github.

1 Like

Many thanks xiaodai :slight_smile:

this is still giving an error. I haven’t raised an issue before. can you send a link to the place

1 Like