3434)
3535from mathics .core .expression import Expression
3636from mathics .core .list import ListExpression
37- from mathics .core .symbols import Symbol , SymbolNull
37+ from mathics .core .symbols import Symbol
3838from mathics .core .systemsymbols import (
3939 SymbolAborted ,
40+ SymbolAbsoluteTime ,
4041 SymbolAutomatic ,
4142 SymbolInfinity ,
4243 SymbolRowBox ,
@@ -109,11 +110,9 @@ def total_seconds(td):
109110else :
110111 total_seconds = timedelta .total_seconds
111112
112- SymbolAbsoluteTime = Symbol ("AbsoluteTime" )
113113SymbolDateObject = Symbol ("DateObject" )
114114SymbolDateString = Symbol ("DateString" )
115115SymbolGregorian = Symbol ("Gregorian" )
116- SymbolPause = Symbol ("Pause" )
117116
118117
119118class _Date :
@@ -1026,39 +1025,6 @@ def eval(self, year, evaluation):
10261025 return ListExpression (year , Integer (month ), Integer (day ))
10271026
10281027
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-
10621028class SystemTimeZone (Predefined ):
10631029 """
10641030 <url>
@@ -1103,7 +1069,7 @@ def evaluate(self, evaluation):
11031069 return Expression (SymbolDateObject .evaluate (evaluation ))
11041070
11051071
1106- if sys .platform != "win32" and not hasattr ( sys , "pyston_version_info" ) :
1072+ if sys .platform != "emscripten" :
11071073
11081074 class TimeConstrained (Builtin ):
11091075 """
@@ -1124,23 +1090,6 @@ class TimeConstrained(Builtin):
11241090 the state of the Mathics3 kernel.
11251091 """
11261092
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-
11441093 attributes = A_HOLD_ALL | A_PROTECTED
11451094 messages = {
11461095 "timc" : (
0 commit comments