New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Trivial implementation of 'pop' for List #98
Labels
Comments
From @bacekHello. There is trivial implementation of 'pop' operator form for List. -- |
From @bacekpop.diffIndex: src/classes/List.pir
===================================================================
--- src/classes/List.pir (revision 27778)
+++ src/classes/List.pir (working copy)
@@ -1118,8 +1157,15 @@
.return list.'uniq'()
.end
-## TODO: join map reduce sort zip
+.sub 'pop' :multi('List')
+ .param pmc list
+ .return list.'pop'()
+.end
+
+
+## TODO: zip
+
=back
=cut
|
From @bacekRefined test suite for 'pop'. |
From @bacekpop_t.diffIndex: t/passing_spec
===================================================================
--- t/passing_spec (revision 27778)
+++ t/passing_spec (working copy)
@@ -18,6 +18,7 @@
S29-array/keys_values.t
S29-array/kv.t
S29-array/pairs.t
+S29-array/pop.t
S29-list/mutating_listops.t
S29-num/abs.t
S29-num/complex.t
Index: t/spec/S29-array/pop.t
===================================================================
--- t/spec/S29-array/pop.t (revision 20514)
+++ t/spec/S29-array/pop.t (working copy)
@@ -43,6 +43,7 @@
is(+@pop, 3, 'we have 3 elements in the array');
#?rakudo skip 'arity trouble'
is(pop @pop, 3, 'inline pop @pop works');
+#?rakudo emit pop @pop;
is(+@pop, 2, 'we have 2 elements in the array');
is(@pop.pop(), 2, 'inline @pop.pop() works');
@@ -70,9 +71,13 @@
# testing some error cases
{
my @pop = 1 .. 5;
+#?rakudo skip 'dies_ok not implemented'
dies_ok({ pop() }, 'pop() requires arguments');
+#?rakudo skip 'dies_ok not implemented'
dies_ok({ pop(@pop, 10) }, 'pop() should not allow extra arguments');
+#?rakudo skip 'dies_ok not implemented'
dies_ok({ @pop.pop(10) }, 'pop() should not allow extra arguments');
+#?rakudo skip 'dies_ok not implemented'
dies_ok({ 42.pop }, '.pop should not work on scalars');
}
Index: t/passing_spec
===================================================================
--- t/passing_spec (revision 27778)
+++ t/passing_spec (working copy)
@@ -18,6 +18,7 @@
S29-array/keys_values.t
S29-array/kv.t
S29-array/pairs.t
+S29-array/pop.t
S29-list/mutating_listops.t
S29-num/abs.t
S29-num/complex.t
|
@bacek - Status changed from 'new' to 'open' |
From @pmichaudApplied in r27876, thanks! Pm |
@pmichaud - Status changed from 'open' to 'resolved' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Migrated from rt.perl.org#54746 (status was 'resolved')
Searchable as RT54746$
The text was updated successfully, but these errors were encountered: