girving / duck

a functional language built around overloading
http://groups.google.com/group/duck-lang
Other
10 stars 2 forks source link

Allow | (pipe) as an infix operator #6

Closed girving closed 13 years ago

girving commented 15 years ago

It would be nice to preserve as many standard C operations as we can. Bit twiddling is important stuff, so it needs to look nice.

Pipe currently appears in the following places in Haskell and Duck:

  1. data declarations - both
  2. case statements - Duck
  3. pattern guards - Haskell
  4. list comprehensions - Haskell

We're going to switch to { ; } for data declarations and case statements soon. I think using pipe in pattern guards doesn't introduce any new ambiguities as long as pipe doesn't appear in patterns. For list comprehensions we could go the python way and use "for".

We're definitely going to want to grow pattern guards and list comprehensions at some point, though.

dylex commented 13 years ago

We no longer use | for syntax anywhere, but were still lexing it specially. Removed all references to it and now single pipe works fine as an operator. b25d5fc6b7fff0834490a72014f46d835fe7c873