Re: Pipe operator in Nim

2020-02-16 Thread kaushalmodi
In case you weren't aware you can indent . chaining in Nim like this too if you 
like: [https://play.nim-lang.org/#ix=2bRv](https://play.nim-lang.org/#ix=2bRv)


Re: Pipe operator in Nim

2020-02-16 Thread schmidh
It's just a styling thingy. Having every step of the pipeline on a separate 
line with same indentation just looks cleaner. Thanks for your hint, though!


Re: Pipe operator in Nim

2020-02-15 Thread schmidh
Hi Andreas, thanks for the clarification!


Re: Pipe operator in Nim

2020-02-15 Thread aredirect
because of ufcs you can use . e.g a.echo


Re: Pipe operator in Nim

2020-02-15 Thread Araq
Well operators that are also used for line continuations have to be written 
like this:


a |>
  b |>
  c


Run


Re: Pipe operator in Nim

2020-02-14 Thread schmidh
They are all single-line. 


Re: Pipe operator in Nim

2020-02-14 Thread honhon
There are already several libraries for this in Github


Pipe operator in Nim

2020-02-14 Thread schmidh
Is there any chance to get hold of the AST in a language construct where you 
define your own pipe operator as found e.g. in F#? (The point being that it 
should span multiple lines.)


"Hello"
|> echo


Run

It parses but it seems impossible to get access to the whole thing and 
manipulate it:


dumpTree:
  "Hello"
  |> echo


Run

The result is: 


StmtList
  StrLit "Hello"
  Prefix
Ident "|>"
Ident "echo"


Run