-
Notifications
You must be signed in to change notification settings - Fork 23
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
support one liners with #? braces
syntax
#5
Comments
@AndreiRegiani I think this should be closed because syntax skins were removed from Nim (devel), so they'll not be available in the next Nim stable version. |
@Yardanico Thanks for the insight! @timotheecour from your example, currently we can do it: >>> proc fun(a: int): auto = return a*2
>>> fun(10)
20 : int Can also do multiple statements using >>> echo 1; echo 2; echo 3
1
2
3 e.g. >>> proc moreFun(a, b: int): auto = echo 1; echo 2; echo 3; return a * b
>>> moreFun(2, 5)
10 : int it seems we don't need syntax skins, right? |
@AndreiRegiani well, you wouldn't be able to write two procedures on one line, but I don't think someone will try that. |
I think with arrow function from future you can write 2 proc on 1 line. I didnt know skins gonna be removed. |
@juancarlospaco |
This should be closed, the braces skin is dead. |
1 liners are very useful for REPL, otherwise cmd recall is kind of broken.
braces syntax allow arbitrary nim code to fit in 1 line.
eg:
>>> proc fun(a:int): auto {return a*2}
implementation:
using undocumented(?) ``#? braces` syntax
eg:
foo.nim
this mode could be enabled via a meta option, see #6, eg :brace=on or :brace=off
The text was updated successfully, but these errors were encountered: