Mathematica execution-time bug: symbol names

后端 未结 2 1760
鱼传尺愫
鱼传尺愫 2021-02-19 10:14

There is a strange bug that has been in Mathematica for years, at least since version 5.1, and persisting through version 7.


Module[{f, L}, L = f[];
  Do[L         


        
2条回答
  •  名媛妹妹
    2021-02-19 10:59

    As to version 8: I tried 100,000 random strings of various lengths and didn't find anything out of the ordinary.

    chars = StringCases[CharacterRange["A", "z"], WordCharacter] //Flatten;
    res = Table[
           ToExpression[
            StringReplace[
             "First[AbsoluteTiming[Module[{weirdness,L},L=weirdness[];\
        \[IndentingNewLine]Do[L=weirdness[L,i],{i,10^4}]]]]", 
             "weirdness" -> 
              StringJoin[
               RandomChoice[chars, RandomInteger[{1, 20}]]]]], {100000}];
    

    enter image description here

提交回复
热议问题