Commit 9e792843 authored by Tim Steenvoorden's avatar Tim Steenvoorden
Browse files

add primitives for min, max, upper and lower Int

parent d91e3bbb
...@@ -34,16 +34,19 @@ prim_unsetLowercaseBitChar :: !Char -> Char ...@@ -34,16 +34,19 @@ prim_unsetLowercaseBitChar :: !Char -> Char
/// # Integers /// # Integers
prim_zeroInt :: Int
prim_oneInt :: Int
prim_upperInt :: Int
prim_lowerInt :: Int
prim_eqInt :: !Int !Int -> Bool prim_eqInt :: !Int !Int -> Bool
prim_ltInt :: !Int !Int -> Bool prim_ltInt :: !Int !Int -> Bool
// prim_gtInt :: !Int !Int -> Bool // prim_gtInt :: !Int !Int -> Bool
// prim_minInt :: !Int !Int -> Int
// prim_maxInt :: !Int !Int-> Int
prim_zeroInt :: Int
prim_oneInt :: Int
prim_incInt :: !Int -> Int prim_incInt :: !Int -> Int
prim_decInt :: !Int -> Int prim_decInt :: !Int -> Int
prim_minInt :: !Int !Int -> Int
prim_maxInt :: !Int !Int-> Int
prim_negInt :: !Int -> Int prim_negInt :: !Int -> Int
prim_addInt :: !Int !Int -> Int prim_addInt :: !Int !Int -> Int
......
...@@ -107,6 +107,24 @@ prim_unsetLowercaseBitChar c = code inline { ...@@ -107,6 +107,24 @@ prim_unsetLowercaseBitChar c = code inline {
/// # Integers /// # Integers
/// ## Values
prim_zeroInt :: Int
prim_zeroInt = code inline {
pushI 0
}
prim_oneInt :: Int
prim_oneInt = code inline {
pushI 1
}
prim_upperInt :: Int
prim_upperInt = undefined
prim_lowerInt :: Int
prim_lowerInt = undefined
/// ## Ordering /// ## Ordering
prim_eqInt :: !Int !Int -> Bool prim_eqInt :: !Int !Int -> Bool
...@@ -119,19 +137,7 @@ prim_ltInt a b = code inline { ...@@ -119,19 +137,7 @@ prim_ltInt a b = code inline {
ltI ltI
} }
/// ## Basic Values /// ## Operations
prim_zeroInt :: Int
prim_zeroInt = code inline {
pushI 0
}
prim_oneInt :: Int
prim_oneInt = code inline {
pushI 1
}
/// ## Increase and Decrease
prim_incInt :: !Int -> Int prim_incInt :: !Int -> Int
prim_incInt a = code inline { prim_incInt a = code inline {
...@@ -143,6 +149,16 @@ prim_decInt a = code inline { ...@@ -143,6 +149,16 @@ prim_decInt a = code inline {
decI decI
} }
prim_minInt :: !Int !Int -> Int
prim_minInt a b = undefined // code inline {
// minI
// }
prim_maxInt :: !Int !Int -> Int
prim_maxInt a b = undefined // code inline {
// maxI
// }
/// ## Arithmetic /// ## Arithmetic
prim_negInt :: !Int -> Int prim_negInt :: !Int -> Int
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment