-
Notifications
You must be signed in to change notification settings - Fork 56
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
Isolate some changes from #629 #663
Conversation
a3bac88
to
502e0c6
Compare
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.
Thanks a lot! This LGTM, and forms a good basis for iteration.
#[inline] | ||
fn get_allocated_const(&self, f: F) -> Result<&AllocatedNum<F>> { | ||
self.0 | ||
.get(&FWrap(f)) | ||
.ok_or_else(|| anyhow!("Global allocation not found for {}", f.hex_digits())) | ||
} | ||
|
||
#[inline] | ||
fn get_allocated_const_cloned(&self, f: F) -> Result<AllocatedNum<F>> { | ||
self.get_allocated_const(f).cloned() | ||
} |
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.
Nit: two suggestions, C-GETTER, and C-CALLER_CONTROL which hints that get_allocated_const
would perhaps suffice.
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.
Without the cloned
version, I would have to manually write clone()
outside many many times. It's better to have this shortcut to avoid repeating myself
6391af9
502e0c6
to
6391af9
Compare
Store
for synthesis (literals have to be interned beforehand)GlobalAllocator
for synthesis (global constants have to be allocated beforehand)MatchVal
for a simplerMatchSymbol
MatchVal
andMatchSymbol
Leaf
toAtom
in the context of pointersStore
ZStore
infra for LEM