Menu ▾ ▴

#5774 block(...) arguments are simplified when block is not evaluated

None
closed
nobody
5
5 days ago
5 days ago
No

This came up in the discussion over at bug #5722. The arguments of block (likewise (...), i.e., MPROGN expressions) are simplified when the block is not evaluated.

(%i2) '(block (1, 1 + 1, 1 + 1 + 1));
(%o2)                    block(1, 2, 3)
(%i3) 'block (1, 1 + 1, 1 + 1 + 1);
(%o3)                    block(1, 2, 3)
(%i4) '((1, 1 + 1, 1 + 1 + 1));
(%o4)                       (1, 2, 3)
(%i5) '(1, 1 + 1, 1 + 1 + 1);
(%o5)                       (1, 2, 3)

The correct result are block(1, 1 + 1, 1 + 1 + 1), 'block(1,1 + 1, 1 + 1 + 1), (1, 1 + 1, 1 + 1 + 1), and '(1, 1 + 1, 1 + 1 + 1), respectively.

The way to fix this is to give MPROG (block) and MPROGN do-nothing simplifiers in the manner of SIMPLAMBDA.

Discussion

  • David Scherfgen

    David Scherfgen - 5 days ago
    • status: open --> closed
     
  • David Scherfgen

    David Scherfgen - 5 days ago

    Your proposed fix works, apparently without any unwanted side-effects, and has been committed as [45469d].

     

    Related

    Commit: [45469d]


Log in to post a comment.