Skip to content
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

Sized arrays can now handle infinite ranges and :map #217

Merged
merged 652 commits into from Nov 8, 2013

Conversation

Arcterus
Copy link

This lets statements such as my @array[10] = 1..*; work properly (where properly means the array now contains the first 10 elements in the range 1..*). Additionally, when assigning a parcel to a shaped array that is too small, the parcel will be truncated during assignment. The :map argument is also now supported.

FROGGS and others added 30 commits September 21, 2013 23:18
…rdingly

This will now also properly notice invalid combinations, and unknown named
params.
This should bring complete [] and {} adverb support using sub calls rather than
method calls to nom.  Possible adverbs are:
  :delete :exists :kv :p :k :v
and many combinations of these (see S02:2525 for a list).  Other adverbs will
cause an exception, as will combinations that are not supported.
@moritz
Copy link
Member

moritz commented Oct 28, 2013

Thank you for your work!

Sorry for taking so long to review this change, somehow I get lots of merge conflicts. Could you please merge latest nom into your branch and resolve the conflicts? I've tried my hands on it myself, but had no success so far.

Benabik and others added 11 commits October 28, 2013 15:05
do not discard the desired minimum version so early
This provides support for giving threads names, getting a thread ID,
provides a sensible stringification and enables $*THREAD as a way to
get a Thread instance for the currently executing thread (including
making it work on the initial thread, so that isn't a special case).
Conflicts:
	src/Perl6/Grammar.nqp
	src/Perl6/Metamodel/BOOTSTRAP.nqp
	src/core/Array.pm
	src/vm/jvm/runtime/org/perl6/rakudo/RakOps.java
@Arcterus
Copy link
Author

Sorry for the mess. I'm not sure how to keep everyone else's commits from showing up.

@moritz
Copy link
Member

moritz commented Oct 30, 2013

I think I've figured it out, no worries. I'll test it, and merge if it works on my machine.

@moritz
Copy link
Member

moritz commented Oct 30, 2013

Ok, my tests found: it doesn't work like this. There is no attribute $!shape, and thus the patch doesn't compile. Sorry.

@Arcterus
Copy link
Author

That's very odd. I just freshly cloned it and it worked on my computer, so I have no idea what's going wrong.

@Arcterus
Copy link
Author

Arcterus commented Nov 7, 2013

I've tried it every way I can think of, and I'm still not able to reproduce your issue. Is it perhaps an issue with your copy? Or are you trying it on MoarVM (if this is the case, it definitely won't work right now)?

@moritz
Copy link
Member

moritz commented Nov 8, 2013

Try cherry-picking commit 0099b25 to a current version of rakudo/nom. The problem is that there doesn't seem to be a $!shape attribute anywhere in current nom.

@FROGGS
Copy link
Member

FROGGS commented Nov 8, 2013

moritz: this PR is against the sized-arrays branch...

Here you can see that this one has the $!shape:
https://github.com/rakudo/rakudo/compare/sized-arrays

I checked out this PR, merged nom into it, and will run a spectest...

FROGGS added a commit that referenced this pull request Nov 8, 2013
Sized arrays can now handle infinite ranges and :map
@FROGGS FROGGS merged commit 2bba525 into rakudo:sized-arrays Nov 8, 2013
@FROGGS
Copy link
Member

FROGGS commented Nov 8, 2013

Parrot:

Test Summary Report
-------------------
t/spec/S02-types/array.rakudo.parrot                          (Wstat: 0 Tests: 99 Failed: 2)
  Failed tests:  93, 97
t/spec/S02-types/lazy-lists.t                                 (Wstat: 256 Tests: 0 Failed: 0)
  Non-zero exit status: 1
  Parse errors: Bad plan.  You planned 19 tests but ran 0.
t/spec/S03-metaops/zip.rakudo.parrot                          (Wstat: 256 Tests: 7 Failed: 0)
  Non-zero exit status: 1
  Parse errors: Bad plan.  You planned 24 tests but ran 7.
t/spec/S03-metaops/reduce.rakudo.parrot                       (Wstat: 256 Tests: 5 Failed: 0)
  Non-zero exit status: 1
  Parse errors: No plan found in TAP output
t/spec/S04-declarations/our.rakudo.parrot                     (Wstat: 256 Tests: 5 Failed: 0)
  Non-zero exit status: 1
  Parse errors: Bad plan.  You planned 33 tests but ran 5.
t/spec/S05-mass/charsets.rakudo.parrot                        (Wstat: 0 Tests: 16 Failed: 1)
  Failed test:  10
t/spec/S05-substitution/subst.rakudo.parrot                   (Wstat: 0 Tests: 141 Failed: 1)
  Failed test:  83
t/spec/S06-other/main-usage.rakudo.parrot                     (Wstat: 256 Tests: 3 Failed: 0)
  Non-zero exit status: 1
  Parse errors: Bad plan.  You planned 22 tests but ran 3.
t/spec/S12-attributes/instance.rakudo.parrot                  (Wstat: 0 Tests: 140 Failed: 1)
  Failed test:  102
t/spec/S12-introspection/WHAT.rakudo.parrot                   (Wstat: 256 Tests: 28 Failed: 0)
  Non-zero exit status: 1
  Parse errors: Bad plan.  You planned 37 tests but ran 28.
t/spec/S14-traits/attributes.t                                (Wstat: 0 Tests: 8 Failed: 3)
  Failed tests:  2-4
t/spec/S32-array/delete-adverb-native.t                       (Wstat: 0 Tests: 138 Failed: 10)
  Failed tests:  2, 5, 7, 9, 11, 13, 23, 25, 37, 39
t/spec/S32-array/delete-adverb.t                              (Wstat: 0 Tests: 216 Failed: 5)
  Failed tests:  3, 14, 19, 64, 75
t/spec/S32-array/perl.t                                       (Wstat: 256 Tests: 4 Failed: 0)
  Non-zero exit status: 1
  Parse errors: Bad plan.  You planned 6 tests but ran 4.
t/spec/S32-array/pop.t                                        (Wstat: 256 Tests: 35 Failed: 0)
  Non-zero exit status: 1
  Parse errors: Bad plan.  You planned 36 tests but ran 35.
t/spec/S32-basics/warn.rakudo.parrot                          (Wstat: 256 Tests: 5 Failed: 0)
  Non-zero exit status: 1
  Parse errors: Bad plan.  You planned 7 tests but ran 5.
t/spec/S12-methods/chaining.t                                 (Wstat: 9 Tests: 15 Failed: 0)
  Non-zero wait status: 9
  Parse errors: Bad plan.  You planned 17 tests but ran 15.
t/spec/integration/error-reporting.t                          (Wstat: 0 Tests: 16 Failed: 1)
  Failed test:  11
Files=765, Tests=29368, 881 wallclock secs ( 9.78 usr  1.26 sys + 3144.86 cusr 210.00 csys = 3365.90 CPU)
Result: FAIL

@FROGGS
Copy link
Member

FROGGS commented Nov 8, 2013

JVM:

Test Summary Report
-------------------
t/spec/S02-magicals/pid.rakudo.jvm                         (Wstat: 0 Tests: 1 Failed: 0)
  TODO passed:   1
t/spec/S02-types/array.rakudo.jvm                          (Wstat: 0 Tests: 99 Failed: 2)
  Failed tests:  93, 97
t/spec/S02-types/deprecations.t                            (Wstat: 0 Tests: 0 Failed: 0)
  Parse errors: Bad plan.  You planned 23 tests but ran 0.
t/spec/S02-types/lazy-lists.t                              (Wstat: 0 Tests: 0 Failed: 0)
  Parse errors: Bad plan.  You planned 19 tests but ran 0.
t/spec/S02-types/isDEPRECATED.rakudo.jvm                   (Wstat: 0 Tests: 0 Failed: 0)
  Parse errors: Bad plan.  You planned 20 tests but ran 0.
t/spec/S03-metaops/zip.rakudo.jvm                          (Wstat: 0 Tests: 7 Failed: 0)
  Parse errors: Bad plan.  You planned 24 tests but ran 7.
t/spec/S03-metaops/reduce.rakudo.jvm                       (Wstat: 0 Tests: 5 Failed: 0)
  Parse errors: No plan found in TAP output
t/spec/S04-declarations/our.rakudo.jvm                     (Wstat: 0 Tests: 5 Failed: 0)
  Parse errors: Bad plan.  You planned 33 tests but ran 5.
t/spec/S05-mass/charsets.t                                 (Wstat: 0 Tests: 16 Failed: 2)
  Failed tests:  9-10
t/spec/S05-substitution/subst.rakudo.jvm                   (Wstat: 0 Tests: 141 Failed: 1)
  Failed test:  83
t/spec/S12-attributes/instance.rakudo.jvm                  (Wstat: 0 Tests: 140 Failed: 1)
  Failed test:  102
t/spec/S12-introspection/WHAT.rakudo.jvm                   (Wstat: 0 Tests: 28 Failed: 0)
  Parse errors: Bad plan.  You planned 37 tests but ran 28.
t/spec/S14-traits/attributes.t                             (Wstat: 0 Tests: 8 Failed: 3)
  Failed tests:  2-4
t/spec/S32-array/delete-adverb-native.t                    (Wstat: 0 Tests: 138 Failed: 10)
  Failed tests:  2, 5, 7, 9, 11, 13, 23, 25, 37, 39
t/spec/S32-array/delete-adverb.t                           (Wstat: 0 Tests: 216 Failed: 5)
  Failed tests:  3, 14, 19, 64, 75
t/spec/S32-array/perl.t                                    (Wstat: 0 Tests: 4 Failed: 0)
  Parse errors: Bad plan.  You planned 6 tests but ran 4.
t/spec/S32-array/pop.t                                     (Wstat: 0 Tests: 35 Failed: 0)
  Parse errors: Bad plan.  You planned 36 tests but ran 35.
t/spec/S32-io/io-spec-unix.t                               (Wstat: 0 Tests: 119 Failed: 0)
  Parse errors: Bad plan.  You planned 129 tests but ran 119.
t/spec/S12-methods/chaining.t                              (Wstat: 0 Tests: 15 Failed: 0)
  Parse errors: Bad plan.  You planned 17 tests but ran 15.
t/spec/S32-io/io-spec-win.t                                (Wstat: 0 Tests: 32 Failed: 0)
  Parse errors: Bad plan.  You planned 209 tests but ran 32.
Files=765, Tests=29163, 6257 wallclock secs ( 9.97 usr  1.43 sys + 26.95 cusr  5.13 csys = 43.48 CPU)
Result: FAIL

@FROGGS
Copy link
Member

FROGGS commented Nov 8, 2013

Some of these might fail in nom too, so you'd have to compare to get the actual regressions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet