SetReplace icon indicating copy to clipboard operation
SetReplace copied to clipboard

Fail when starting from an empty state in one of the multi-rules

Open maxitg opened this issue 6 years ago • 2 comments

The following fails with messages:

In[] := SetReplace[{}, ToPatternRules[{{1} -> {}, {} -> {}}]]

image

Version (please complete the following information):

  • OS: macOS 10.15.1 (19B88)
  • Wolfram Language Version: "12.1.0 for Mac OS X x86 (64-bit) (November 6, 2019)"
  • SetReplace git sha: cb1a2de482afaa1b05ebe2c48bb00d318751f562

maxitg avatar Nov 17 '19 20:11 maxitg

In:

In[] := SetReplace[{}, ToPatternRules[{{1} -> {}, {} -> {}}]]

Is it intended that two events occur? {{{1, {} -> {}, 1}, {2, {} -> {}, 1}}}

When the input is just:

In[] := SetReplace[{}, ToPatternRules[{{} -> {}}]]

the only event that occurs is {{{1, {} -> {}, 1}}}

image

daneelsan avatar Oct 13 '20 22:10 daneelsan

No, SetReplace should do one event at a time, i.e., it's equivalent to <|"MaxEvents" -> 1|> (without the third argument).

maxitg avatar Oct 13 '20 22:10 maxitg