Skip to content

Commit d1baf04

Browse files
author
Carl Masak
committed
remove Val::Int
1 parent e592694 commit d1baf04

File tree

2 files changed

+0
-43
lines changed

2 files changed

+0
-43
lines changed

lib/_007/Runtime/Builtins.pm

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -194,10 +194,6 @@ sub builtins(:$input!, :$output!, :$opscope!) is export {
194194
die X::TypeCheck.new(:operation<~~>, :got($rhs), :expected(Val::Type))
195195
unless $rhs ~~ Val::Type;
196196

197-
if $lhs ~~ _007::Object && $rhs.type === Val::Int {
198-
return True;
199-
}
200-
201197
return wrap($lhs ~~ $rhs.type);
202198
},
203199
:qtype(Q::Infix::TypeMatch),

lib/_007/Val.pm

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -145,44 +145,6 @@ class Val::Bool does Val {
145145
}
146146
}
147147

148-
### ### Int
149-
###
150-
### An whole number value, such as -8, 0, or 16384.
151-
###
152-
### Implementations are required to represent `Int` values either as 32-bit
153-
### or as arbitrary-precision bigints.
154-
###
155-
### The standard arithmetic operations are defined in the language, with the
156-
### notable exception of division.
157-
###
158-
### say(-7); # --> `-7`
159-
### say(3 + 2); # --> `5`
160-
### say(3 * 2); # --> `6`
161-
### say(3 % 2); # --> `1`
162-
###
163-
### Division is not defined, because there's no sensible thing to return for
164-
### something like `3 / 2`. Returning `1.5` is not an option, because the
165-
### language does not have a built-in rational or floating-point type.
166-
### Returning `1` (truncating to an integer) would be possible but
167-
### unsatisfactory and a source of confusion.
168-
###
169-
### There are also a few methods defined on `Int`:
170-
###
171-
### say((-7).abs()); # --> `7`
172-
### say(97.chr()); # --> `a`
173-
###
174-
class Val::Int does Val {
175-
has Int $.value;
176-
177-
submethod BUILD(:$value) {
178-
die "Not supposed to use this class anymore";
179-
}
180-
181-
method truthy {
182-
?$.value;
183-
}
184-
}
185-
186148
### ### Str
187149
###
188150
### A piece of text. Strings are frequent whenever a program does text-based
@@ -602,7 +564,6 @@ class Helper {
602564
our sub Str($_) {
603565
when Val::NoneType { "None" }
604566
when Val::Bool { .value.Str }
605-
when Val::Int { .value.Str }
606567
when Val::Str { .value }
607568
when Val::Regex { .quoted-Str }
608569
when Val::Array { .quoted-Str }

0 commit comments

Comments
 (0)