Advertisement
Guest User

Untitled

a guest
Jun 21st, 2011
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 22.11 KB | None | 0 0
  1. diff --git a/src/core/Any.pm b/src/core/Any.pm
  2. index 59787a6..cf9e0c8 100644
  3. --- a/src/core/Any.pm
  4. +++ b/src/core/Any.pm
  5. @@ -14,11 +14,10 @@ my class Any {
  6. method join($separator = ' ') {
  7. my $list = (self,).flat.eager;
  8. my Mu $rsa := pir::new__Ps('ResizableStringArray');
  9. - pir::push__vPS($rsa, pir::repr_unbox_str__SP($list.shift.Stringy))
  10. + pir::push__vPS($rsa, nqp::unbox_s($list.shift.Stringy))
  11. while $list.gimme(0);
  12. pir::push__vPS($rsa, '...') if $list.infinite;
  13. - pir::perl6_box_str__PS(
  14. - pir::join(pir::repr_unbox_str__SP($separator.Stringy), $rsa))
  15. + nqp::p6box_s(pir::join(nqp::unbox_s($separator.Stringy), $rsa))
  16. }
  17.  
  18. method map($block) is rw {
  19. diff --git a/src/core/Attribute.pm b/src/core/Attribute.pm
  20. index ea1e5ee..95dec63 100644
  21. --- a/src/core/Attribute.pm
  22. +++ b/src/core/Attribute.pm
  23. @@ -11,7 +11,7 @@ my class Attribute {
  24. pir::getattribute__PPPs(
  25. pir::perl6_decontainerize__PP($self),
  26. $dcpkg,
  27. - pir::repr_unbox_str__SP($name))
  28. + nqp::unbox_s($name))
  29. }
  30. !!
  31. method (Mu $self:) {
  32. @@ -19,10 +19,10 @@ my class Attribute {
  33. pir::getattribute__PPPs(
  34. pir::perl6_decontainerize__PP($self),
  35. $dcpkg,
  36. - pir::repr_unbox_str__SP($name)))
  37. + nqp::unbox_s($name)))
  38. };
  39. $package.HOW.add_method($package, pir::substr__SSI(
  40. - pir::repr_unbox_str__SP($name), pir::repr_unbox_int__IP(2)),
  41. + nqp::unbox_s($name), nqp::unbox_i(2)),
  42. $meth);
  43. }
  44. }
  45. diff --git a/src/core/Bool.pm b/src/core/Bool.pm
  46. index 3c60d1f..c62631d 100644
  47. --- a/src/core/Bool.pm
  48. +++ b/src/core/Bool.pm
  49. @@ -24,6 +24,6 @@ multi prefix:<so>(Mu \$a) { $a.Bool }
  50.  
  51. # XXX These should use Bool::True and Bool::False eventually.
  52. proto prefix:<!>(|$) { *}
  53. -multi prefix:<!>(Bool \$a) { pir::perl6_booleanize__PI($a ?? 0 !! 1) }
  54. -multi prefix:<!>(Mu \$a) { pir::perl6_booleanize__PI($a.Bool ?? 0 !! 1) }
  55. +multi prefix:<!>(Bool \$a) { nqp::p6bool($a ?? 0 !! 1) }
  56. +multi prefix:<!>(Mu \$a) { nqp::p6bool($a.Bool ?? 0 !! 1) }
  57.  
  58. diff --git a/src/core/Cool.pm b/src/core/Cool.pm
  59. index abb560b..ca85200 100644
  60. --- a/src/core/Cool.pm
  61. +++ b/src/core/Cool.pm
  62. @@ -1,12 +1,10 @@
  63. my class Cool {
  64. method bytes() {
  65. - pir::perl6_box_int__PI(
  66. - pir::bytelength__IS(pir::repr_unbox_str__SP(self.Str)));
  67. + nqp::p6box_i(pir::bytelength__IS(nqp::unbox_s(self.Str)));
  68. }
  69.  
  70. method chars() {
  71. - pir::perl6_box_int__PI(
  72. - pir::length__IS(pir::repr_unbox_str__SP(self.Str)));
  73. + nqp::p6box_i(pir::length__IS(nqp::unbox_s(self.Str)));
  74. }
  75.  
  76. method substr($start as Int, $length?) {
  77. @@ -24,22 +22,18 @@ my class Cool {
  78. # return Mu;
  79. #}
  80.  
  81. - pir::perl6_box_str__PS(pir::substr(
  82. - pir::repr_unbox_str__SP($str),
  83. - pir::repr_unbox_int__IP($start),
  84. - pir::repr_unbox_int__IP($len)));
  85. + nqp::p6box_s(pir::substr(
  86. + nqp::unbox_s($str),
  87. + nqp::unbox_i($start),
  88. + nqp::unbox_i($len)));
  89. }
  90.  
  91. method uc() {
  92. - pir::perl6_box_str__PS(pir::upcase__SS(
  93. - pir::repr_unbox_str__SP(self.Str)
  94. - ));
  95. + nqp::p6box_s(pir::upcase__SS(nqp::unbox_s(self.Str)))
  96. }
  97.  
  98. method lc() {
  99. - pir::perl6_box_str__PS(pir::downcase__SS(
  100. - pir::repr_unbox_str__SP(self.Str)
  101. - ));
  102. + nqp::p6box_s(pir::downcase__SS(nqp::unbox_s(self.Str)))
  103. }
  104.  
  105. method ucfirst() {
  106. @@ -53,21 +47,19 @@ my class Cool {
  107. }
  108.  
  109. method ord() {
  110. - pir::perl6_box_int__PI(pir::ord__IS(pir::repr_unbox_str__SP(self.Str)));
  111. + nqp::p6box_i(pir::ord__IS(nqp::unbox_s(self.Str)))
  112. }
  113.  
  114. method flip() {
  115. - pir::perl6_box_str__PS(
  116. - pir::box__PS(pir::repr_unbox_str__SP(self.Str)).reverse
  117. - );
  118. + nqp::p6box_s(pir::box__PS(nqp::unbox_s(self.Str)).reverse)
  119. }
  120.  
  121. proto method index(|$) {*}
  122. multi method index(Cool \$needle, Cool $pos = 0) {
  123. - my $result := pir::perl6_box_int__PI(pir::index__ISSI(
  124. - pir::repr_unbox_str__SP(self.Str),
  125. - pir::repr_unbox_str__SP($needle.Str),
  126. - pir::repr_unbox_int__IP($pos.Int)
  127. + my $result := nqp::p6box_i(pir::index__ISSI(
  128. + nqp::unbox_s(self.Str),
  129. + nqp::unbox_s($needle.Str),
  130. + nqp::unbox_i($pos.Int)
  131. ));
  132. # TODO: fail() instead of returning Str
  133. $result < 0 ?? Str !! $result;
  134. @@ -75,10 +67,10 @@ my class Cool {
  135.  
  136. proto method rindex(|$) {*}
  137. multi method rindex(Cool \$needle, Cool $pos = self.chars) {
  138. - my $result := pir::perl6_box_int__PI(
  139. - pir::box__PS(pir::repr_unbox_str__SP(self.Str)).reverse_index(
  140. - pir::repr_unbox_str__SP($needle.Str),
  141. - pir::repr_unbox_int__IP($pos.Int)
  142. + my $result := nqp::p6box_i(
  143. + pir::box__PS(nqp::unbox_s(self.Str)).reverse_index(
  144. + nqp::unbox_s($needle.Str),
  145. + nqp::unbox_i($pos.Int)
  146. )
  147. );
  148. # TODO: fail() instead of returning Str
  149. diff --git a/src/core/EnumMap.pm b/src/core/EnumMap.pm
  150. index c87fb96..d7bdde5 100644
  151. --- a/src/core/EnumMap.pm
  152. +++ b/src/core/EnumMap.pm
  153. @@ -3,9 +3,9 @@ my class EnumMap {
  154. # has $!storage; # Parrot Hash PMC of key->value mappings
  155.  
  156. method exists(Str \$key) {
  157. - pir::perl6_booleanize__PI(
  158. + nqp::p6bool(
  159. pir::defined($!storage)
  160. - && pir::exists__IQs($!storage, pir::repr_unbox_str__SP($key))
  161. + && pir::exists__IQs($!storage, nqp::unbox_s($key))
  162. )
  163. }
  164.  
  165. @@ -28,7 +28,7 @@ my class EnumMap {
  166.  
  167. method at_key(Str \$key) {
  168. self.exists($key)
  169. - ?? pir::set__PQs($!storage, pir::repr_unbox_str__SP($key))
  170. + ?? pir::set__PQs($!storage, nqp::unbox_s($key))
  171. !! Any
  172. }
  173.  
  174. @@ -37,7 +37,7 @@ my class EnumMap {
  175. pir::defined($!storage) ||
  176. pir::setattribute__vPPsP(self, EnumMap, '$!storage',
  177. pir::new__Ps('Hash'));
  178. - pir::set__2QsP($!storage, pir::repr_unbox_str__SP($key), $value)
  179. + pir::set__2QsP($!storage, nqp::unbox_s($key), $value)
  180. }
  181. }
  182.  
  183. diff --git a/src/core/GatherIter.pm b/src/core/GatherIter.pm
  184. index 45dec94..1d03db9 100644
  185. --- a/src/core/GatherIter.pm
  186. +++ b/src/core/GatherIter.pm
  187. @@ -29,7 +29,7 @@ class GatherIter is Iterator {
  188. $P2 = getattribute $P0, $P1, '$!coro'
  189. %r = $P2()
  190. };
  191. - $end = pir::perl6_booleanize__PI(pir::isnull__IP($parcel));
  192. + $end = nqp::p6bool(pir::isnull__IP($parcel));
  193. pir::push__vPP($rpa, $parcel) unless $end;
  194. $n = $n - 1;
  195. }
  196. diff --git a/src/core/Int.pm b/src/core/Int.pm
  197. index efbad91..25248e5 100644
  198. --- a/src/core/Int.pm
  199. +++ b/src/core/Int.pm
  200. @@ -1,21 +1,21 @@
  201. my class Int {
  202. method Bool() {
  203. - pir::perl6_booleanize__PI(
  204. - pir::isne__III(pir::repr_unbox_int__IP(self), pir::repr_unbox_int__IP(0)))
  205. + nqp::p6bool(
  206. + nqp::isne_i(nqp::unbox_i(self), nqp::unbox_i(0)))
  207. }
  208.  
  209. method Int() { self }
  210.  
  211. multi method Str(Int:D:) {
  212. - pir::perl6_box_str__PS(pir::repr_unbox_int__IP(self));
  213. + nqp::p6box_s(nqp::unbox_i(self));
  214. }
  215.  
  216. method Num() {
  217. - pir::perl6_box_num__PN(pir::repr_unbox_int__IP(self));
  218. + nqp::p6box_n(nqp::unbox_i(self));
  219. }
  220.  
  221. method abs() {
  222. - pir::perl6_box_int__PI(pir::abs__II(pir::repr_unbox_int__IP(self)));
  223. + nqp::p6box_i(nqp::abs_i(nqp::unbox_i(self)));
  224. }
  225.  
  226. method Bridge() {
  227. @@ -23,7 +23,7 @@ my class Int {
  228. }
  229.  
  230. method chr() {
  231. - pir::perl6_box_str__PS(pir::chr(pir::repr_unbox_int__IP(self)));
  232. + nqp::p6box_s(pir::chr(nqp::unbox_i(self)));
  233. }
  234.  
  235. proto method succ(|$) {*}
  236. @@ -126,43 +126,26 @@ multi infix:«>=»(Int \$a, Int \$b) {
  237. }
  238.  
  239. multi infix:<+|>(Int \$a, Int \$b) {
  240. - pir::perl6_box_int__PI(pir::bor__III(
  241. - pir::repr_unbox_int__ip($a),
  242. - pir::repr_unbox_int__ip($b)
  243. - ));
  244. + nqp::p6box_i(pir::bor__III(nqp::unbox_i($a), nqp::unbox_i($b)))
  245. }
  246.  
  247. multi infix:<+&>(Int \$a, Int \$b) {
  248. - pir::perl6_box_int__PI(pir::band__III(
  249. - pir::repr_unbox_int__ip($a),
  250. - pir::repr_unbox_int__ip($b)
  251. - ));
  252. + nqp::p6box_i(pir::band__III(nqp::unbox_i($a), nqp::unbox_i($b)))
  253. }
  254.  
  255. multi infix:<+^>(Int \$a, Int \$b) {
  256. - pir::perl6_box_int__PI(pir::bxor__III(
  257. - pir::repr_unbox_int__ip($a),
  258. - pir::repr_unbox_int__ip($b)
  259. - ));
  260. + nqp::p6box_i(pir::bxor__III(nqp::unbox_i($a), nqp::unbox_i($b)))
  261. }
  262.  
  263. multi infix:«+<»(Int \$a, Int \$b) {
  264. - pir::perl6_box_int__PI(pir::shl__III(
  265. - pir::repr_unbox_int__ip($a),
  266. - pir::repr_unbox_int__ip($b)
  267. - ));
  268. + nqp::p6box_i(pir::shl__III(nqp::unbox_i($a), nqp::unbox_i($b)))
  269. }
  270.  
  271. multi infix:«+>»(Int \$a, Int \$b) {
  272. - pir::perl6_box_int__PI(pir::shr__III(
  273. - pir::repr_unbox_int__ip($a),
  274. - pir::repr_unbox_int__ip($b)
  275. - ));
  276. + nqp::p6box_i(pir::shr__III(nqp::unbox_i($a), nqp::unbox_i($b)))
  277. }
  278.  
  279. multi prefix:<+^>(Int \$a) {
  280. - pir::perl6_box_int__PI(pir::bnot__II(
  281. - pir::repr_unbox_int__ip($a)
  282. - ));
  283. + nqp::p6box_i(pir::bnot__II(nqp::unbox_i($a)))
  284. }
  285.  
  286. diff --git a/src/core/List.pm b/src/core/List.pm
  287. index 174a23f..e7184fa 100644
  288. --- a/src/core/List.pm
  289. +++ b/src/core/List.pm
  290. @@ -16,7 +16,7 @@ class List {
  291.  
  292. method at_pos(\$pos) {
  293. self.exists($pos)
  294. - ?? pir::set__PQi($!items, pir::repr_unbox_int__IP($pos))
  295. + ?? pir::set__PQi($!items, nqp::unbox_i($pos))
  296. !! Mu
  297. }
  298.  
  299. @@ -26,13 +26,12 @@ class List {
  300. # Get as many elements as we can. If gimme stops before
  301. # reaching the end of the list, assume the list is infinite.
  302. my $n = self.gimme(*);
  303. - $!nextiter.defined ?? pir::perl6_box_num__PN('Inf') !! $n
  304. + $!nextiter.defined ?? nqp::p6box_n('Inf') !! $n
  305. }
  306.  
  307. method exists(\$pos) {
  308. self.gimme($pos + 1);
  309. - pir::perl6_booleanize__PI(
  310. - pir::exists__IQI($!items, pir::repr_unbox_int__IP($pos)))
  311. + nqp::p6bool(pir::exists__IQI($!items, nqp::unbox_i($pos)))
  312. }
  313.  
  314. method flat() {
  315. @@ -45,14 +44,14 @@ class List {
  316. pir::setattribute__3PPsP(self, List, '$!items', pir::new__Ps('ResizablePMCArray'));
  317.  
  318. # loop through iterators until we have at least $n elements
  319. - my $count = pir::perl6_box_int__PI(pir::elements($!items));
  320. + my $count = nqp::p6box_i(pir::elements($!items));
  321. my $eager = Whatever.ACCEPTS($n);
  322. while $!nextiter.defined && ($eager
  323. ?? !$!nextiter.infinite
  324. !! ($count < $n)) {
  325. $!nextiter.reify($eager ?? Whatever !! $n - $count);
  326. pir::setattribute__vPPsP(self, List, '$!nextiter', $!nextiter.nextiter);
  327. - $count = pir::perl6_box_int__PI(pir::elements($!items));
  328. + $count = nqp::p6box_i(pir::elements($!items));
  329. }
  330.  
  331. # return the number of elements we have now
  332. @@ -100,7 +99,7 @@ class List {
  333. }
  334.  
  335. method STORE_AT_POS(\$pos, Mu \$v) {
  336. - pir::set__1QiP($!items, pir::repr_unbox_int__IP($pos), $v)
  337. + pir::set__1QiP($!items, nqp::unbox_i($pos), $v)
  338. }
  339.  
  340. method RPA() {
  341. diff --git a/src/core/Mu.pm b/src/core/Mu.pm
  342. index 357b823..a84b4ca 100644
  343. --- a/src/core/Mu.pm
  344. +++ b/src/core/Mu.pm
  345. @@ -5,11 +5,11 @@ my class Mu {
  346.  
  347. proto method ACCEPTS(|$) { * }
  348. multi method ACCEPTS(Mu:U: \$topic) {
  349. - pir::perl6_booleanize__PI(pir::type_check__IPP($topic, self))
  350. + nqp::p6bool(pir::type_check__IPP($topic, self))
  351. }
  352.  
  353. method WHERE() {
  354. - pir::perl6_box_int__PI(pir::get_addr__IP(self))
  355. + nqp::p6box_i(pir::get_addr__IP(self))
  356. }
  357.  
  358. method Bool() {
  359. @@ -17,7 +17,7 @@ my class Mu {
  360. }
  361.  
  362. method defined() {
  363. - pir::perl6_booleanize__PI(pir::repr_defined__IP(self))
  364. + nqp::p6bool(pir::repr_defined__IP(self))
  365. }
  366.  
  367. method CREATE() {
  368. @@ -63,7 +63,7 @@ sub DUMP(|$) {
  369. my Mu $topic := pir::shift__PP($args);
  370. if pir::isnull__IP($topic) { '(null)' }
  371. elsif pir::isa__IPs($topic, 'ResizablePMCArray') {
  372. - my $s = 'RPA<' ~ pir::perl6_box_str__Ps(pir::get_addr__IP($topic)) ~ '>(';
  373. + my $s = 'RPA<' ~ nqp::p6box_s(pir::get_addr__IP($topic)) ~ '>(';
  374. my $t = '';
  375. $topic := pir::clone__PP($topic);
  376. while $topic {
  377. diff --git a/src/core/Num.pm b/src/core/Num.pm
  378. index cb023d2..700d28d 100644
  379. --- a/src/core/Num.pm
  380. +++ b/src/core/Num.pm
  381. @@ -2,19 +2,19 @@
  382. # XXX: Temporary definition of $Inf and $NaN until we have constants available
  383. # constant Inf = ...
  384. # constant NaN = ...
  385. -my $Inf = pir::perl6_box_num__PN(pir::set__Ns('Inf'));
  386. -my $NaN = pir::perl6_box_num__PN(pir::set__Ns('NaN'));
  387. +my $Inf = nqp::p6box_n(pir::set__Ns('Inf'));
  388. +my $NaN = nqp::p6box_n(pir::set__Ns('NaN'));
  389.  
  390. my class Num {
  391. method Num() { self }
  392. method Bridge() { self }
  393.  
  394. method Int() {
  395. - pir::perl6_box_int__PI(pir::repr_unbox_num__NP(self));
  396. + nqp::p6box_i(nqp::unbox_n(self));
  397. }
  398.  
  399. multi method Str(Num:D:) {
  400. - pir::perl6_box_str__PS(pir::repr_unbox_num__NP(self));
  401. + nqp::p6box_s(nqp::unbox_n(self));
  402. }
  403.  
  404. proto method succ(|$) {*}
  405. @@ -30,12 +30,12 @@ my class Num {
  406. }
  407.  
  408. method abs() {
  409. - pir::perl6_box_num__PN(pir::abs__NN(pir::repr_unbox_num__NP(self)));
  410. + nqp::p6box_n(nqp::abs_n(nqp::unbox_n(self)));
  411. }
  412.  
  413. proto method log(|$) {*}
  414. multi method log() {
  415. - pir::perl6_box_num__PN(pir::ln__NN(pir::repr_unbox_num__NP(self)));
  416. + nqp::p6box_n(pir::ln__NN(nqp::unbox_n(self)));
  417. }
  418. multi method log(Num \$base) {
  419. self.log() / $base.log();
  420. @@ -43,67 +43,67 @@ my class Num {
  421.  
  422. proto method sqrt(|$) {*}
  423. multi method sqrt() {
  424. - pir::perl6_box_num__PN(pir::sqrt__NN(pir::repr_unbox_num__NP(self)));
  425. + nqp::p6box_n(pir::sqrt__NN(nqp::unbox_n(self)));
  426. }
  427.  
  428. method rand() {
  429. - pir::perl6_box_num__PN(pir::rand__NN(pir::repr_unbox_num__NP(self)));
  430. + nqp::p6box_n(pir::rand__NN(nqp::unbox_n(self)));
  431. }
  432.  
  433. method ceil() {
  434. - pir::perl6_box_num__PN(pir::ceil__NN(pir::repr_unbox_num__NP(self)));
  435. + nqp::p6box_n(pir::ceil__NN(nqp::unbox_n(self)));
  436. }
  437. method floor() {
  438. - pir::perl6_box_num__PN(pir::floor__NN(pir::repr_unbox_num__NP(self)));
  439. + nqp::p6box_n(pir::floor__NN(nqp::unbox_n(self)));
  440. }
  441.  
  442. proto method sin(|$) {*}
  443. multi method sin() {
  444. - pir::perl6_box_num__PN(pir::sin__NN(pir::repr_unbox_num__NP(self)));
  445. + nqp::p6box_n(pir::sin__NN(nqp::unbox_n(self)));
  446. }
  447. proto method asin(|$) {*}
  448. multi method asin() {
  449. - pir::perl6_box_num__PN(pir::asin__NN(pir::repr_unbox_num__NP(self)));
  450. + nqp::p6box_n(pir::asin__NN(nqp::unbox_n(self)));
  451. }
  452. proto method cos(|$) {*}
  453. multi method cos() {
  454. - pir::perl6_box_num__PN(pir::cos__NN(pir::repr_unbox_num__NP(self)));
  455. + nqp::p6box_n(pir::cos__NN(nqp::unbox_n(self)));
  456. }
  457. proto method acos(|$) {*}
  458. multi method acos() {
  459. - pir::perl6_box_num__PN(pir::acos__NN(pir::repr_unbox_num__NP(self)));
  460. + nqp::p6box_n(pir::acos__NN(nqp::unbox_n(self)));
  461. }
  462. proto method tan(|$) {*}
  463. multi method tan() {
  464. - pir::perl6_box_num__PN(pir::tan__NN(pir::repr_unbox_num__NP(self)));
  465. + nqp::p6box_n(pir::tan__NN(nqp::unbox_n(self)));
  466. }
  467. proto method atan(|$) {*}
  468. multi method atan() {
  469. - pir::perl6_box_num__PN(pir::atan__NN(pir::repr_unbox_num__NP(self)));
  470. + nqp::p6box_n(pir::atan__NN(nqp::unbox_n(self)));
  471. }
  472. proto method sec(|$) {*}
  473. multi method sec() {
  474. - pir::perl6_box_num__PN(pir::sec__NN(pir::repr_unbox_num__NP(self)));
  475. + nqp::p6box_n(pir::sec__NN(nqp::unbox_n(self)));
  476. }
  477. proto method asec(|$) {*}
  478. multi method asec() {
  479. - pir::perl6_box_num__PN(pir::asec__NN(pir::repr_unbox_num__NP(self)));
  480. + nqp::p6box_n(pir::asec__NN(nqp::unbox_n(self)));
  481. }
  482. proto method sinh(|$) {*}
  483. multi method sinh() {
  484. - pir::perl6_box_num__PN(pir::sinh__NN(pir::repr_unbox_num__NP(self)));
  485. + nqp::p6box_n(pir::sinh__NN(nqp::unbox_n(self)));
  486. }
  487. proto method cosh(|$) {*}
  488. multi method cosh() {
  489. - pir::perl6_box_num__PN(pir::cosh__NN(pir::repr_unbox_num__NP(self)));
  490. + nqp::p6box_n(pir::cosh__NN(nqp::unbox_n(self)));
  491. }
  492. proto method tanh(|$) {*}
  493. multi method tanh() {
  494. - pir::perl6_box_num__PN(pir::tanh__NN(pir::repr_unbox_num__NP(self)));
  495. + nqp::p6box_n(pir::tanh__NN(nqp::unbox_n(self)));
  496. }
  497. proto method sech(|$) {*}
  498. multi method sech() {
  499. - pir::perl6_box_num__PN(pir::sech__NN(pir::repr_unbox_num__NP(self)));
  500. + nqp::p6box_n(pir::sech__NN(nqp::unbox_n(self)));
  501. }
  502. }
  503.  
  504. diff --git a/src/core/Parameter.pm b/src/core/Parameter.pm
  505. index 1588f24..cf1d366 100644
  506. --- a/src/core/Parameter.pm
  507. +++ b/src/core/Parameter.pm
  508. @@ -23,7 +23,7 @@ my class Parameter {
  509. }
  510.  
  511. method positional() {
  512. - pir::perl6_booleanize__PI(
  513. + nqp::p6bool(
  514. ($!flags +& ($SIG_ELEM_SLURPY_POS +| $SIG_ELEM_SLURPY_NAMED)) == 0 &&
  515. pir::isnull__IP($!named_names)
  516. )
  517. diff --git a/src/core/Str.pm b/src/core/Str.pm
  518. index 3f8a73b..57020d2 100644
  519. --- a/src/core/Str.pm
  520. +++ b/src/core/Str.pm
  521. @@ -4,11 +4,11 @@ my class Str {
  522. multi method Str(Str:D:) { self }
  523.  
  524. method Int() {
  525. - pir::perl6_box_int__PI(pir::repr_unbox_str__SP(self));
  526. + nqp::p6box_i(nqp::unbox_s(self));
  527. }
  528.  
  529. method Num() {
  530. - pir::perl6_box_num__PN(pir::repr_unbox_str__SP(self));
  531. + nqp::p6box_n(nqp::unbox_s(self));
  532. }
  533.  
  534. method Numeric() { self.Num }
  535. @@ -21,94 +21,56 @@ my class Str {
  536. }
  537.  
  538. multi infix:<cmp>(Str \$a, Str \$b) {
  539. - pir::perl6_box_int__PI(
  540. - pir::cmp__ISS(
  541. - pir::repr_unbox_str__SP($a),
  542. - pir::repr_unbox_str__SP($b)))
  543. + nqp::p6box_i(pir::cmp__ISS(nqp::unbox_s($a), nqp::unbox_s($b)))
  544. }
  545.  
  546. proto infix:<x>(|$) {*}
  547. multi infix:<x>(Str $s, Int $repetition) {
  548. - pir::perl6_box_str__PS(
  549. - pir::repeat__SSI(
  550. - pir::repr_unbox_str__SP($s),
  551. - pir::repr_unbox_int__IP($repetition),
  552. - )
  553. - );
  554. + nqp::p6box_s(pir::repeat__SSI(nqp::unbox_s($s), nqp::unbox_i($repetition)))
  555. }
  556. multi infix:<x>($s, $repetition) { $s.Stringy x $repetition.Numeric }
  557.  
  558. multi prefix:<~>(Str \$a) { $a }
  559.  
  560. multi infix:<~>(Str \$a, Str \$b) {
  561. - pir::perl6_box_str__PS(
  562. - pir::concat__SSS(
  563. - pir::repr_unbox_str__SP($a),
  564. - pir::repr_unbox_str__SP($b)))
  565. + nqp::p6box_s(pir::concat__SSS(nqp::unbox_s($a), nqp::unbox_s($b)))
  566. }
  567.  
  568. multi infix:<eq>(Str \$a, Str \$b) {
  569. - pir::perl6_booleanize__PI(
  570. - pir::iseq__ISS(
  571. - pir::repr_unbox_str__SP($a),
  572. - pir::repr_unbox_str__SP($b)))
  573. + nqp::p6bool(pir::iseq__ISS(nqp::unbox_s($a), nqp::unbox_s($b)))
  574. }
  575.  
  576. multi infix:<ne>(Str \$a, Str \$b) {
  577. - pir::perl6_booleanize__PI(
  578. - pir::isne__ISS(
  579. - pir::repr_unbox_str__SP($a),
  580. - pir::repr_unbox_str__SP($b)))
  581. + nqp::p6bool(pir::isne__ISS(nqp::unbox_s($a), nqp::unbox_s($b)))
  582. }
  583.  
  584. multi infix:<lt>(Str \$a, Str \$b) {
  585. - pir::perl6_booleanize__PI(
  586. - pir::islt__ISS(
  587. - pir::repr_unbox_str__SP($a),
  588. - pir::repr_unbox_str__SP($b)))
  589. + nqp::p6bool(pir::islt__ISS(nqp::unbox_s($a), nqp::unbox_s($b)))
  590. }
  591.  
  592. multi infix:<le>(Str \$a, Str \$b) {
  593. - pir::perl6_booleanize__PI(
  594. - pir::isle__ISS(
  595. - pir::repr_unbox_str__SP($a),
  596. - pir::repr_unbox_str__SP($b)))
  597. + nqp::p6bool(pir::isle__ISS(nqp::unbox_s($a), nqp::unbox_s($b)))
  598. }
  599.  
  600. multi infix:<gt>(Str \$a, Str \$b) {
  601. - pir::perl6_booleanize__PI(
  602. - pir::isgt__ISS(
  603. - pir::repr_unbox_str__SP($a),
  604. - pir::repr_unbox_str__SP($b)))
  605. + nqp::p6bool(pir::isgt__ISS(nqp::unbox_s($a), nqp::unbox_s($b)))
  606. }
  607.  
  608. multi infix:<ge>(Str \$a, Str \$b) {
  609. - pir::perl6_booleanize__PI(
  610. - pir::isge__ISS(
  611. - pir::repr_unbox_str__SP($a),
  612. - pir::repr_unbox_str__SP($b)))
  613. + nqp::p6bool(pir::isge__ISS(nqp::unbox_s($a), nqp::unbox_s($b)))
  614. }
  615.  
  616.  
  617. multi infix:<~|>(Str \$a, Str \$b) {
  618. - pir::perl6_box_str__PS(
  619. - pir::bors__SSS(
  620. - pir::repr_unbox_str__SP($a),
  621. - pir::repr_unbox_str__SP($b)))
  622. + nqp::p6box_s(pir::bors__SSS(nqp::unbox_s($a), nqp::unbox_s($b)))
  623. }
  624.  
  625. multi infix:<~&>(Str \$a, Str \$b) {
  626. - pir::perl6_box_str__PS(
  627. - pir::bands__SSS(
  628. - pir::repr_unbox_str__SP($a),
  629. - pir::repr_unbox_str__SP($b)))
  630. + nqp::p6box_s(pir::bands__SSS(nqp::unbox_s($a), nqp::unbox_s($b)))
  631. }
  632.  
  633. multi infix:<~^>(Str \$a, Str \$b) {
  634. - pir::perl6_box_str__PS(
  635. - pir::bxors__SSS(
  636. - pir::repr_unbox_str__SP($a),
  637. - pir::repr_unbox_str__SP($b)))
  638. + nqp::p6box_s(pir::bxors__SSS(nqp::unbox_s($a), nqp::unbox_s($b)))
  639. }
  640.  
  641. multi prefix:<~^>(Str \$a) {
  642. diff --git a/src/core/terms.pm b/src/core/terms.pm
  643. index 34b70f0..c1d290c 100644
  644. --- a/src/core/terms.pm
  645. +++ b/src/core/terms.pm
  646. @@ -1,2 +1,2 @@
  647. -sub term:<time>() { pir::perl6_box_int__PI(pir::time__I()) }
  648. +sub term:<time>() { nqp::p6box_i(pir::time__I()) }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement