-
Notifications
You must be signed in to change notification settings - Fork 238
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
What is your opinion about removing the curly brackets? #18
Comments
While I'm not against an indent based syntax, I personally don't like the Also, this might be too hard to implement, but that's up to the language designers. |
An indent-based syntax would make it impossible to implement one-liners with the equivalent of Edit: clarified. |
@nicolasmccurdy yea, as I was 'converting' the code, the pipe and block part seemed quite meh. A few ideas:
|
@nicolasmccurdy I feel same way, and now seeking different syntax. As @dbohdan pointed out, indentation based block is against one liners, which is bad for a shell influenced language. |
Removing curlies is exactly what makes CoffeeScript so beautiful, yet so dangerous, because:
Significant whitespace doesn't stop people from writing bad code. |
Remove the braces, remove the parens, remove the trailing |
how about
|
@disjukr I personally prefer having the pipe as the flow operator. |
What about existing FBP DSL?
|
What about
Pre-UNIX history about pipes – "The Origin of Unix Pipes", http://doc.cat-v.org/unix/pipes/ |
Even if we don't use the no-curly braces idea, I do like the idea of doing a more normal syntax for block paramaters. |
@dbohdan wrote:
Thus, indent-based syntax should not be mandatory. But Streem could still support a normal syntax and also an indent-based syntax. For example, you could implement both of these syntaxes:
|
That could cause some confusion. What if you forget one curly brace, but properly indent? |
|
I like curly brackets, and oleksandr's example in my way:
|
Regarding the block parameters...one idea would be to use Ruby 1.9 / CoffeeScript shorthand lambda -> syntax. Or the less pretty
|
I like based syntax. The
having brackets will be a guard to avoid that the parser become complex. |
(: this is true. |
seq(100) | (x) |
As I said in above, expression may contains
|
Too many pipes... kill pipes.
|
Hmm. Maybe we could do what Ruby does, except with whitespace. One-liners can use braces. But on multiple lines, you have to use whitespace? |
In LiveScript, the FizzBuzz would look like this:
|
FizzBuzz would look about the same in F# too (the F# syntax itself is further explained in http://stackoverflow.com/a/2422713/809572) [1..100]
|> Seq.map (function
| x when x % 15 = 0 -> "FizzBuzz"
| x when x % 3 = 0 -> "Fizz"
| x when x % 5 = 0 -> "Buzz"
| x -> string x)
|> Seq.iter (printfn "%s") |
Im for F# or LiveScript syntax. LiveScript looks better to me. |
While we're thinking about LiveScript, I'd highly desire to allow identifiers with dashes:
I also strongly dislike being forced to use capitalization anywhere. |
@ChristopherDumas I agree. |
@naturalethic I agree. |
|
Yup, yup, yup! |
I really like the way LiveScript handles identifiers. In Javascript, the convention is camelcase with lowercase starting letter I also dislike underscores. They are ugly and require me to hit the shift key (like capitals do). Dashes and lowercase satisfy my OCD for symmetry by keeping things in a straight line with no waves or crests. As for PascalCase for classes, if the reasoning is merely stylistic, then don't make them special. Your IDE can colorize them or make them bold if you want, but let the identifier for them be as any other identifier. These are my personal stylistic opinions, and have no real objective merit, but I want to get them in early, as they will go/no-go this language for me. |
@naturalethic Yes i agree. No special stuff for PascalCase, and I agree that dashes are much nicer. It will make the parser more complex though. |
Curly braces are fine for scoping. The C-Style will help with adoption as well. |
Indentation could be used instead.
The text was updated successfully, but these errors were encountered: