-
Notifications
You must be signed in to change notification settings - Fork 483
Add snippets for Racket #267
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
Conversation
|
Looks good but I'm not super convinced by having snippets that take the What do you think @codingbum ? |
|
I did set $0 as the body but i am not sure about the do-loop snippet which is now
|
| # name: (for... (...) ...) | ||
| # key: for | ||
| # -- | ||
| (for$1 (${2:for-clause}) $0) No newline at end of file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is the $1 just next to the for here?
Does it mean you might want to add something to "for"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's because racket has a multitude of for/...
(for/list ...) ;; build a list
(for/vector ...) ;; build a vector
(for/sum ...) ;; sum
(for/and ...) ;; checks if all iterations return (not #f)
...
|
Well don't see why not, what's the problem with the $0 there in the do loop @codingbum ? I don't think there is a "rule" for this but normally most snippets involve maximum 3-4 tabs.. |
|
the do loop form has multiple bodies. Where shall $0 be? |
| # name: (do ([... ... ...]...) (... ...) ...) | ||
| # key: do | ||
| # -- | ||
| (do ([${1:name} ${2:init} ${3:step}]$4) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mm yeah I think that 7 expansions is way too much, I would just do something like
(do ([$1] $2)
($3)
$0)
(with the appropriate placeholder names)
Would that make sense?
|
Ok I tried the snippets again and I think it's fine, we can keep also the |
A few snippets for the Racket programming language.