34
34
)
35
35
from mathics .core .expression import Expression
36
36
from mathics .core .list import ListExpression
37
- from mathics .core .symbols import Symbol , SymbolNull
37
+ from mathics .core .symbols import Symbol
38
38
from mathics .core .systemsymbols import (
39
39
SymbolAborted ,
40
+ SymbolAbsoluteTime ,
40
41
SymbolAutomatic ,
41
42
SymbolInfinity ,
42
43
SymbolRowBox ,
@@ -109,11 +110,9 @@ def total_seconds(td):
109
110
else :
110
111
total_seconds = timedelta .total_seconds
111
112
112
- SymbolAbsoluteTime = Symbol ("AbsoluteTime" )
113
113
SymbolDateObject = Symbol ("DateObject" )
114
114
SymbolDateString = Symbol ("DateString" )
115
115
SymbolGregorian = Symbol ("Gregorian" )
116
- SymbolPause = Symbol ("Pause" )
117
116
118
117
119
118
class _Date :
@@ -1026,39 +1025,6 @@ def eval(self, year, evaluation):
1026
1025
return ListExpression (year , Integer (month ), Integer (day ))
1027
1026
1028
1027
1029
- class Pause (Builtin ):
1030
- """
1031
- <url>:WMA link:https://reference.wolfram.com/language/ref/Pause.html</url>
1032
-
1033
- <dl>
1034
- <dt>'Pause[n]'
1035
- <dd>pauses for $n$ seconds.
1036
- </dl>
1037
-
1038
- >> Pause[0.5]
1039
- """
1040
-
1041
- messages = {
1042
- "numnm" : (
1043
- "Non-negative machine-sized number expected at " "position 1 in `1`."
1044
- ),
1045
- }
1046
-
1047
- summary_text = "pause for a number of seconds"
1048
-
1049
- def eval (self , n , evaluation ):
1050
- "Pause[n_]"
1051
- sleeptime = n .to_python ()
1052
- if not isinstance (sleeptime , (int , float )) or sleeptime < 0 :
1053
- evaluation .message (
1054
- "Pause" , "numnm" , Expression (SymbolPause , from_python (n ))
1055
- )
1056
- return
1057
-
1058
- time .sleep (sleeptime )
1059
- return SymbolNull
1060
-
1061
-
1062
1028
class SystemTimeZone (Predefined ):
1063
1029
"""
1064
1030
<url>
@@ -1103,7 +1069,7 @@ def evaluate(self, evaluation):
1103
1069
return Expression (SymbolDateObject .evaluate (evaluation ))
1104
1070
1105
1071
1106
- if sys .platform != "win32" and not hasattr ( sys , "pyston_version_info" ) :
1072
+ if sys .platform != "emscripten" :
1107
1073
1108
1074
class TimeConstrained (Builtin ):
1109
1075
"""
@@ -1124,23 +1090,6 @@ class TimeConstrained(Builtin):
1124
1090
the state of the Mathics3 kernel.
1125
1091
"""
1126
1092
1127
- # FIXME: these tests sometimes cause SEGVs which probably means
1128
- # that TimeConstraint has bugs.
1129
-
1130
- # Consider testing via unit tests.
1131
- # >> TimeConstrained[Integrate[Sin[x]^1000000,x],1]
1132
- # = $Aborted
1133
-
1134
- # >> TimeConstrained[Integrate[Sin[x]^1000000,x], 1, Integrate[Cos[x],x]]
1135
- # = Sin[x]
1136
-
1137
- # >> s=TimeConstrained[Integrate[Sin[x] ^ 3, x], a]
1138
- # : Number of seconds a is not a positive machine-sized number or Infinity.
1139
- # = TimeConstrained[Integrate[Sin[x] ^ 3, x], a]
1140
-
1141
- # >> a=1; s
1142
- # = Cos[x] (-5 + Cos[2 x]) / 6
1143
-
1144
1093
attributes = A_HOLD_ALL | A_PROTECTED
1145
1094
messages = {
1146
1095
"timc" : (
0 commit comments