Skip to content

For-loops and do-while - #59

Open
ipapadop wants to merge 2 commits into
mainfrom
for-do-while
Open

ipapadop wants to merge 2 commits into
mainfrom
for-do-while

Conversation

@ipapadop

@ipapadop ipapadop commented Sep 8, 2026

Copy link
Copy Markdown
Owner

No description provided.

- Added deferred compound assignment operators (+=, -=, *=, /=, %=, &=, |=, ^=, <<=, >>=) in operators.hpp.
- Introduced seq_expression class to evaluate multiple expressions in sequence in seq.hpp.
- Enhanced variable class to support deferred assignment from expressions.
- Created integration tests for deferred assignment and sequence expressions in assign.cpp and seq.cpp.
- Added unit tests for assignment behavior, including immediate and deferred assignments, in assign.cpp.
- Updated visitor pattern to handle new assignment and sequence node kinds in visitor.cpp.
- Modified for loop tests to utilize deferred expressions and validate behavior.
@ipapadop ipapadop self-assigned this Sep 8, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0dad940cdf

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

operator()() noexcept(noexcept(Operation{}(m_target(), evaluate(m_value))))
{
auto value = evaluate(m_value);
return Operation{}(m_target(), std::move(value));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve copy assignment for variable RHS values

When the right-hand side is another variable whose value type is copy-assignable but has a deleted move assignment, evaluate(m_value) successfully creates the required value snapshot, but unconditionally moving that snapshot selects the deleted move-assignment operator. Consequently, the advertised i = j expression fails when evaluated even though ordinary lvalue assignment of the underlying type is valid; preserve copy semantics for variable right-hand sides rather than always forcing an rvalue.

AGENTS.md reference: AGENTS.md:L20-L24

Useful? React with 👍 / 👎.

Comment thread include/deferred/seq.hpp
Comment on lines +81 to +82
template<typename... Ex>
constexpr explicit seq_expression(Ex&&... ex) noexcept(

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Exclude seq_expression from forwarding construction

When a non-const named sequence is copied, such as auto copy = original, this unconstrained constructor deduces Ex as seq_expression& and is a better match than the implicit const& copy constructor. It then attempts to construct the operand tuple from the entire sequence and compilation fails, despite all operands being copyable; exclude the current specialization from this forwarding constructor or explicitly provide copy operations.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant