feat(traverse): add generate_binding and generate_binding_current_scope APIs in context#6805
Conversation
Your org has enabled the Graphite merge queue for merging into mainAdd the label “0-merge” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “hotfix” to add to the merge queue as a hot fix. You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link. |
This stack of pull requests is managed by Graphite. Learn more about stacking. |
generate_binding and generate_binding_current_scope APIs in context
CodSpeed Performance ReportMerging #6805 will not alter performanceComparing Summary
|
overlookmotel
left a comment
There was a problem hiding this comment.
I think it'd be preferable if generate_binding took an Atom instead of a CompactStr. If it's an existing var name (which it must be, otherwise we'd be using generate_uid), an Atom will already exist in the arena for this symbol name, so we'd be better off reusing it. I'll submit that change in a follow-on PR.
This business with juggling CompactStrs and Atoms is a real pain!
Merge activity
|
…scope` APIs in context (#6805) These two APIs are used to create a symbol with the provided symbol name, The difference from `generate_uid` is that we don't need to create a unique name for the symbol. If you have a better method name for this, Feel free to edit this PR directly
aad68b0 to
c96e739
Compare
…6830) Follow-up after #6805. `TraverseCtx::generate_binding` take an `Atom` instead of a `CompactStr`. If it's an existing var name (which it must be, otherwise we'd be using `TraverseCtx::generate_uid`), an `Atom` will already exist in the arena for this symbol name, so we'd be better off reusing it, rather than writing the same `Atom` into the arena again.

These two APIs are used to create a symbol with the provided symbol name, The difference from
generate_uidis that we don't need to create a unique name for the symbol.If you have a better method name for this, Feel free to edit this PR directly