Changeset 15201 for src/Pugs/Prim.hs
- Timestamp:
- 02/06/07 21:28:57 (22 months ago)
- Files:
-
- 1 modified
-
src/Pugs/Prim.hs (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Pugs/Prim.hs
r15165 r15201 153 153 op1 "sqrt" = op1Floating sqrt 154 154 op1 "atan" = op1Floating atan 155 op1 "post:i" = \x -> do 156 n <- fromVal x 157 return $ VComplex (0 :+ n) 155 158 op1 "post:++" = \x -> atomicEval $ do 156 159 ref <- fromVal x … … 590 593 op1 "hex" = fail "hex() is not part of Perl 6 - use :16() instead." 591 594 op1 "oct" = fail "oct() is not part of Perl 6 - use :8() instead." 592 op1 "log" = op1 Cast (VNum . log)593 op1 "log10" = op1 Cast (VNum .logBase 10)595 op1 "log" = op1Floating log 596 op1 "log10" = op1Floating (logBase 10) 594 597 op1 "from" = op1Cast (castV . matchFrom) 595 598 op1 "to" = op1Cast (castV . matchTo) … … 940 943 op2 "cmp"= op2OrdNumStr 941 944 op2 "leg"= op2Ord vCastStr 942 op2 "<=>"= op2Ord vCastRat945 op2 "<=>"= op2OrdNumeric compare 943 946 op2 ".." = op2Range 944 947 op2 "..^" = op2RangeExclRight 945 948 op2 "^.." = op2RangeExclLeft 946 949 op2 "^..^" = op2RangeExclBoth 947 op2 "!=" = op2 Cmp vCastRat(/=)948 op2 "==" = op2 Cmp vCastRat(==)949 op2 "<" = op2 Cmp vCastRat(<)950 op2 "<=" = op2 Cmp vCastRat(<=)951 op2 ">" = op2 Cmp vCastRat(>)952 op2 ">=" = op2 Cmp vCastRat(>=)950 op2 "!=" = op2OrdNumeric (/=) 951 op2 "==" = op2OrdNumeric (==) 952 op2 "<" = op2OrdNumeric (<) 953 op2 "<=" = op2OrdNumeric (<=) 954 op2 ">" = op2OrdNumeric (>) 955 op2 ">=" = op2OrdNumeric (>=) 953 956 op2 "ne" = op2Cmp vCastStr (/=) 954 957 op2 "eq" = op2Cmp vCastStr (==) … … 1058 1061 op2 "exp" = \x y -> if defined y 1059 1062 then op2Num (**) x y 1060 else op1 Cast (VNum . exp)x1063 else op1Floating exp x 1061 1064 op2 "Pugs::Internals::sprintf" = \x y -> do 1062 1065 -- a single argument is all Haskell can really handle. … … 1512 1515 op2OrdNumStr x y 1513 1516 | isNumeric x && isNumeric y = op2Ord vCastRat x y 1514 | otherwise = op2Ord vCastStrx y1517 | otherwise = op2OrdNumeric compare x y 1515 1518 1516 1519 op3Caller :: Type -> Int -> Val -> Eval Val … … 1861 1864 \\n Num post ++ safe (rw!Num)\ 1862 1865 \\n Num post -- safe (rw!Num)\ 1866 \\n Complex post i safe (Num)\ 1863 1867 \\n Str spre ++ safe (rw!Str)\ 1864 1868 \\n Str spre -- safe (rw!Str)\
