-
Notifications
You must be signed in to change notification settings - Fork 857
Simplify Zero and One Words construction and Address compression #1746
Conversation
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.
LGTM! The code looks nicer and cleaner now!
However, one_f
and zero_f
are not straightforward to me and it's easy to get confused. Give couples of hours to see if I can find a better solution. If no, then I'll approve it. 🙏
@ChihChengLiang, I didn't find any good solutions. But I was thinking to use |
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.
LGTM!
@KimiWu123 I think you're reasoning makes sense to me. I'll merge this then submit a new one for the remaining. |
Description
While reviewing #1699, I noticed some room to improve the ergonomics of the words.
Issue Link
Type of change
New feature (non-breaking change which adds functionality)
Contents
address_word_to_expr
function with thecompress
method so that we can compress a word directly without finding that function to use.zero_f
andone_f
to create zero and one forWord<F>
.Rationale
I noticed that it is hard to create a
one()
andzero()
method for bothWord<Expression<F>>
andWord<F>
. The compiler complains about implementing duplicated methods. Since we already useone()
andzero()
in many places forWord<Expression<F>>
, I namedzero_f
andone_f
for the methods forWord<F>
.