summaryrefslogtreecommitdiff
path: root/lib/std/chartype.myr
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2018-01-01 21:09:50 -0800
committerOri Bernstein <ori@eigenstate.org>2018-01-11 22:16:11 -0800
commit90e26e0f687da28530b3b967df0cedf20407c071 (patch)
tree09c85ff396a5f235dbcbd5db2df911b5217bb472 /lib/std/chartype.myr
parent94448201527e0c47c2924219bf1a8d0c0c2406b7 (diff)
downloadmc-90e26e0f687da28530b3b967df0cedf20407c071.tar.gz
Move to new trait syntax.
Diffstat (limited to 'lib/std/chartype.myr')
-rw-r--r--lib/std/chartype.myr12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/std/chartype.myr b/lib/std/chartype.myr
index bf01d9a..9832fc5 100644
--- a/lib/std/chartype.myr
+++ b/lib/std/chartype.myr
@@ -25,7 +25,7 @@ pkg std =
const toupper : (c : char -> char)
const totitle : (c : char -> char)
- generic charval : (c : char, base : int -> @a::(integral,numeric))
+ generic charval : (c : char, base : int -> @a) :: integral,numeric @a
const cellwidth : (c : char -> int)
;;
@@ -1670,18 +1670,18 @@ const totitle = {c
-> c
}
-generic charval = {c, base -> @a::(numeric,integral)
+generic charval = {c, base -> @a :: numeric,integral @a
var v = -1
if c >= '0' && c <= '9'
- v = (c - '0' : @a::(integral,numeric))
+ v = (c - '0' : @a)
elif c >= 'a' && c <= 'z'
- v = (c - 'a' + 10 : @a::(integral,numeric))
+ v = (c - 'a' + 10 : @a)
elif c >= 'A' && c <= 'Z'
- v = (c - 'A' + 10 : @a::(integral,numeric))
+ v = (c - 'A' + 10 : @a)
;;
- if v < 0 || v >= (base : @a::(integral,numeric))
+ if v < 0 || v >= (base : @a)
-> -1
;;
-> v