Skip to content

Commit

Permalink
Remove uniprop-(int|str|bool) (#4308)
Browse files Browse the repository at this point in the history
They appear to have been added at some point, but they are not tested
nor are they documented, nor are they needed in the setting nor any
core modules.

Their functionality seems to intended as a performance shortcut for the
more general "uniprop" and "uniprops" functions.  My argument would be
that *if* one knows about these, one might as well use the underlying
nqp::ops as these appear to be a very thin HLL wrapper for them.

This functionality is now available in the uniprop distribution:
     https://raku.land/zef:lizmat/uniprop
  • Loading branch information
lizmat committed Jan 3, 2022
1 parent 90a04ac commit 2b355dc
Show file tree
Hide file tree
Showing 11 changed files with 6 additions and 72 deletions.
42 changes: 0 additions & 42 deletions src/core.c/unicodey.pm6
Expand Up @@ -628,10 +628,6 @@ proto sub uniparse($, *%) {*}
proto sub uniprop($, $?, *%) is pure {*}
proto sub uniprops($, $?, *%) is pure {*}

proto sub uniprop-bool($, $, *%) is pure {*}
proto sub uniprop-int($, $, *%) is pure {*}
proto sub uniprop-str($, $, *%) is pure {*}

proto sub unival($, *%) is pure {*}
proto sub univals($, *%) is pure {*}
#-------------------------------------------------------------------------------
Expand Down Expand Up @@ -664,44 +660,6 @@ multi sub uniprops(\what, Str:D $propname) { what.uniprops($propname) }
multi sub unival(\what) { what.unival }
multi sub univals(\what) { what.univals }

#?if jvm
multi sub uniprop-int(|) { die 'uniprop-int NYI on jvm backend' }
multi sub uniprop-bool(|) { die 'uniprop-bool NYI on jvm backend' }
multi sub uniprop-str(|) { die 'uniprop-str NYI on jvm backend' }
#?endif

#?if js
multi sub uniprop-int(|) { die 'uniprop-int NYI on js backend' }
multi sub uniprop-bool(|) { die 'uniprop-bool NYI on js backend' }
multi sub uniprop-str(Int:D $code, Stringy:D $propname) {
nqp::getuniprop_str($code,nqp::unipropcode($propname));
}
#?endif

#?if moar

# Unicode functions
multi sub uniprop-int(Str:D $str, Stringy:D $propname) {
$str ?? uniprop-int($str.ord, $propname) !! Nil }
multi sub uniprop-int(Int:D $code, Stringy:D $propname) {
nqp::getuniprop_int($code,nqp::unipropcode($propname));
}

multi sub uniprop-bool(Str:D $str, Stringy:D $propname) {
$str ?? uniprop-bool($str.ord, $propname) !! Nil
}
multi sub uniprop-bool(Int:D $code, Stringy:D $propname) {
nqp::hllbool(nqp::getuniprop_bool($code,nqp::unipropcode($propname)));
}

multi sub uniprop-str(Str:D $str, Stringy:D $propname) {
$str ?? uniprop-str($str.ord, $propname) !! Nil
}
multi sub uniprop-str(Int:D $code, Stringy:D $propname) {
nqp::getuniprop_str($code,nqp::unipropcode($propname));
}
#?endif

#?if !jvm
multi sub infix:<unicmp>(Str:D $a, Str:D $b) {
ORDER(nqp::unicmp_s($a,$b,85,0,0))
Expand Down
3 changes: 0 additions & 3 deletions t/02-rakudo/03-corekeys-6c.t
Expand Up @@ -471,9 +471,6 @@ my @expected = (
Q{&uninames},
Q{&uniparse},
Q{&uniprop},
Q{&uniprop-bool},
Q{&uniprop-int},
Q{&uniprop-str},
Q{&uniprops},
Q{&unique},
Q{&unival},
Expand Down
3 changes: 0 additions & 3 deletions t/02-rakudo/03-corekeys-6d.t
Expand Up @@ -471,9 +471,6 @@ my @expected = (
Q{&uninames},
Q{&uniparse},
Q{&uniprop},
Q{&uniprop-bool},
Q{&uniprop-int},
Q{&uniprop-str},
Q{&uniprops},
Q{&unique},
Q{&unival},
Expand Down
3 changes: 0 additions & 3 deletions t/02-rakudo/03-corekeys-6e.t
Expand Up @@ -474,9 +474,6 @@ my @expected = (
Q{&uninames},
Q{&uniparse},
Q{&uniprop},
Q{&uniprop-bool},
Q{&uniprop-int},
Q{&uniprop-str},
Q{&uniprops},
Q{&unique},
Q{&unival},
Expand Down
3 changes: 0 additions & 3 deletions t/02-rakudo/03-corekeys.t
Expand Up @@ -474,9 +474,6 @@ my @allowed =
Q{&uninames},
Q{&uniparse},
Q{&uniprop},
Q{&uniprop-bool},
Q{&uniprop-int},
Q{&uniprop-str},
Q{&uniprops},
Q{&unique},
Q{&unival},
Expand Down
3 changes: 0 additions & 3 deletions t/02-rakudo/04-settingkeys-6c.t
Expand Up @@ -470,9 +470,6 @@ my %allowed = (
Q{&uninames},
Q{&uniparse},
Q{&uniprop},
Q{&uniprop-bool},
Q{&uniprop-int},
Q{&uniprop-str},
Q{&uniprops},
Q{&unique},
Q{&unival},
Expand Down
3 changes: 0 additions & 3 deletions t/02-rakudo/04-settingkeys-6e.t
Expand Up @@ -471,9 +471,6 @@ my %allowed = (
Q{&uninames},
Q{&uniparse},
Q{&uniprop},
Q{&uniprop-bool},
Q{&uniprop-int},
Q{&uniprop-str},
Q{&uniprops},
Q{&unique},
Q{&unival},
Expand Down
5 changes: 2 additions & 3 deletions t/02-rakudo/07-implementation-detail-6.c.t
Expand Up @@ -34,9 +34,8 @@ my @lower = ("",<<
splice split sprintf spurt sqrt squish srand subbuf-rw substr
substr-rw succeed sum symlink take take-rw tan tanh tc tclc trim
trim-leading trim-trailing truncate uc undefine unimatch uniname
uninames uniparse uniprop uniprop-bool uniprop-int uniprop-str
uniprops unique unival univals unlink unpolar unshift val values
warn wordcase words
uninames uniparse uniprop uniprops unique unival univals unlink
unpolar unshift val values warn wordcase words
>>).flat;

my @lower-not-implemented = ();
Expand Down
5 changes: 2 additions & 3 deletions t/02-rakudo/07-implementation-detail-6.d.t
Expand Up @@ -34,9 +34,8 @@ my @lower = ("",<<
splice split sprintf spurt sqrt squish srand subbuf-rw substr
substr-rw succeed sum symlink take take-rw tan tanh tc tclc trim
trim-leading trim-trailing truncate uc undefine unimatch uniname
uninames uniparse uniprop uniprop-bool uniprop-int uniprop-str
uniprops unique unival univals unlink unpolar unshift val values
warn wordcase words
uninames uniparse uniprop uniprops unique unival univals unlink
unpolar unshift val values warn wordcase words
>>).flat;

my @lower-not-implemented = ();
Expand Down
5 changes: 2 additions & 3 deletions t/02-rakudo/07-implementation-detail-6.e.t
Expand Up @@ -34,9 +34,8 @@ my @lower = ("",<<
splice split sprintf spurt sqrt squish srand subbuf-rw substr
substr-rw succeed sum symlink take take-rw tan tanh tc tclc trim
trim-leading trim-trailing truncate uc unimatch uniname
uninames uniparse uniprop uniprop-bool uniprop-int uniprop-str
uniprops unique unival univals unlink unpolar unshift val values
warn wordcase words
uninames uniparse uniprop uniprops unique unival univals unlink
unpolar unshift val values warn wordcase words
>>).flat;

my @lower-not-implemented = ();
Expand Down
3 changes: 0 additions & 3 deletions t/02-rakudo/12-proto-arity-count.t
Expand Up @@ -405,10 +405,7 @@ sub all-the-protos {
&uninames,
&uniparse,
&uniprop,
&uniprop-bool,
&uniprop-int,
&uniprops,
&uniprop-str,
&unique,
&unival,
&univals,
Expand Down

0 comments on commit 2b355dc

Please sign in to comment.