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

Spooky capture with native int (is cached trait) #3403

Open
p6rt opened this issue Jun 1, 2014 · 6 comments
Open

Spooky capture with native int (is cached trait) #3403

p6rt opened this issue Jun 1, 2014 · 6 comments

Comments

@p6rt
Copy link

p6rt commented Jun 1, 2014

Migrated from rt.perl.org#122004 (status was 'open')

Searchable as RT122004$

@p6rt
Copy link
Author

p6rt commented Jun 1, 2014

From @lizmat

[07​:39​:51] <Timbus> m​: sub a(int $i) is cached { return unless $i; a($i-1) }; say a(4);
[07​:39​:53] <+camelia> rakudo-moar ce6acf​: OUTPUT«Cannot find method 'gist'​: no method cache and no .^find_method␤ in method gist at src/gen/m-CORE.setting​:7121␤ in block at src/gen/m-CORE.setting​:3357␤ in any enter at src/gen/m-Metamodel.nqp​:3089␤ in method postcircumfix​:<( )> at src/gen/m-C…»
[11​:52​:00] <lizmat> Timbus​: seems there is some confusion as to what gets passed to the sub
[11​:52​:13] <lizmat> is cached uses the gist of the signature to creata a key
[11​:52​:22] <lizmat> for caching the return value
[11​:52​:34] <lizmat> m​: sub a(int $i) is cached { return unless $i; a(($i-1).Int) }; say a(4)
[11​:52​:35] <+camelia> rakudo-moar ce6acf​: OUTPUT«(Any)␤»
[11​:53​:00] <lizmat> either defining $i as an Int, or making sure we pass an Int, is a workaround for now
[11​:56​:39] <Timbus> yeah. just thought it was an odd one

Feels like the Capture is not set up at all with a recursive call. Any direct calls seem to work ok.

@p6rt
Copy link
Author

p6rt commented Jun 1, 2014

From @lizmat

On 01 Jun 2014, at 12​:05, perl6 via RT <perl6-bugs-followup@​perl.org> wrote​:

Greetings,

This message has been automatically generated in response to the
creation of a trouble ticket regarding​:
"Spooky capture with native int",
a summary of which appears below.

There is no need to reply to this message right now. Your ticket has been
assigned an ID of [perl #​122004].

Please include the string​:

    \[perl #&#8203;122004\]

in the subject line of all future correspondence about this issue. To do so,
you may reply to this message.

                   Thank you,
                   perl6\-bugs\-followup@&#8203;perl\.org

-------------------------------------------------------------------------
[07​:39​:51] <Timbus> m​: sub a(int $i) is cached { return unless $i; a($i-1) }; say a(4);
[07​:39​:53] <+camelia> rakudo-moar ce6acf​: OUTPUT«Cannot find method 'gist'​: no method cache and no .^find_method␤ in method gist at src/gen/m-CORE.setting​:7121␤ in block at src/gen/m-CORE.setting​:3357␤ in any enter at src/gen/m-Metamodel.nqp​:3089␤ in method postcircumfix​:<( )> at src/gen/m-C…»
[11​:52​:00] <lizmat> Timbus​: seems there is some confusion as to what gets passed to the sub
[11​:52​:13] <lizmat> is cached uses the gist of the signature to creata a key
[11​:52​:22] <lizmat> for caching the return value
[11​:52​:34] <lizmat> m​: sub a(int $i) is cached { return unless $i; a(($i-1).Int) }; say a(4)
[11​:52​:35] <+camelia> rakudo-moar ce6acf​: OUTPUT«(Any)␤»
[11​:53​:00] <lizmat> either defining $i as an Int, or making sure we pass an Int, is a workaround for now
[11​:56​:39] <Timbus> yeah. just thought it was an odd one

Feels like the Capture is not set up at all with a recursive call. Any direct calls seem to work ok.

As a further datapoint​: it only happens on Moar and JVM, not on parrot.

@p6rt
Copy link
Author

p6rt commented Jun 1, 2014

From @lizmat

On 01 Jun 2014, at 12​:07, Elizabeth Mattijsen <liz@​dijkmat.nl> wrote​:

On 01 Jun 2014, at 12​:05, perl6 via RT <perl6-bugs-followup@​perl.org> wrote​:

Greetings,

This message has been automatically generated in response to the
creation of a trouble ticket regarding​:
"Spooky capture with native int",
a summary of which appears below.

There is no need to reply to this message right now. Your ticket has been
assigned an ID of [perl #​122004].

Please include the string​:

   \[perl #&#8203;122004\]

in the subject line of all future correspondence about this issue. To do so,
you may reply to this message.

                  Thank you,
                  perl6\-bugs\-followup@&#8203;perl\.org

-------------------------------------------------------------------------
[07​:39​:51] <Timbus> m​: sub a(int $i) is cached { return unless $i; a($i-1) }; say a(4);
[07​:39​:53] <+camelia> rakudo-moar ce6acf​: OUTPUT«Cannot find method 'gist'​: no method cache and no .^find_method␤ in method gist at src/gen/m-CORE.setting​:7121␤ in block at src/gen/m-CORE.setting​:3357␤ in any enter at src/gen/m-Metamodel.nqp​:3089␤ in method postcircumfix​:<( )> at src/gen/m-C…»
[11​:52​:00] <lizmat> Timbus​: seems there is some confusion as to what gets passed to the sub
[11​:52​:13] <lizmat> is cached uses the gist of the signature to creata a key
[11​:52​:22] <lizmat> for caching the return value
[11​:52​:34] <lizmat> m​: sub a(int $i) is cached { return unless $i; a(($i-1).Int) }; say a(4)
[11​:52​:35] <+camelia> rakudo-moar ce6acf​: OUTPUT«(Any)␤»
[11​:53​:00] <lizmat> either defining $i as an Int, or making sure we pass an Int, is a workaround for now
[11​:56​:39] <Timbus> yeah. just thought it was an odd one

Feels like the Capture is not set up at all with a recursive call. Any direct calls seem to work ok.

As a further datapoint​: it only happens on Moar and JVM, not on parrot.

[12​:09​:15] <Timbus> its an optimizer thing
[12​:11​:23] <lizmat> Timbus​: ah, indeed, with MVM_SPESH_DISABLE=1 no problems

@p6rt
Copy link
Author

p6rt commented Aug 28, 2017

From @AlexDaniel

We no longer seem to care about “is cached”, so… I don't think we should reject this (because it may be a nice test case once we start supporting cached trait), but at the same time this ticket is kinda useless.

On 2014-06-01 03​:12​:32, elizabeth wrote​:

On 01 Jun 2014, at 12​:07, Elizabeth Mattijsen <liz@​dijkmat.nl> wrote​:

On 01 Jun 2014, at 12​:05, perl6 via RT <perl6-bugs-followup@​perl.org>
wrote​:

Greetings,

This message has been automatically generated in response to the
creation of a trouble ticket regarding​:
"Spooky capture with native int",
a summary of which appears below.

There is no need to reply to this message right now. Your ticket
has been
assigned an ID of [perl #​122004].

Please include the string​:

[perl #​122004]

in the subject line of all future correspondence about this issue.
To do so,
you may reply to this message.

Thank you,
perl6-bugs-followup@​perl.org

-------------------------------------------------------------------------
[07​:39​:51] <Timbus> m​: sub a(int $i) is cached { return unless $i;
a($i-1) }; say a(4);
[07​:39​:53] <+camelia> rakudo-moar ce6acf​: OUTPUT«Cannot find
method 'gist'​: no method cache and no .^find_method␤ in method gist
at src/gen/m-CORE.setting​:7121␤ in block at src/gen/m-
CORE.setting​:3357␤ in any enter at src/gen/m-Metamodel.nqp​:3089␤
in method postcircumfix​:<( )> at src/gen/m-C…»
[11​:52​:00] <lizmat> Timbus​: seems there is some confusion as to
what gets passed to the sub
[11​:52​:13] <lizmat> is cached uses the gist of the signature to
creata a key
[11​:52​:22] <lizmat> for caching the return value
[11​:52​:34] <lizmat> m​: sub a(int $i) is cached { return unless $i;
a(($i-1).Int) }; say a(4)
[11​:52​:35] <+camelia> rakudo-moar ce6acf​: OUTPUT«(Any)␤»
[11​:53​:00] <lizmat> either defining $i as an Int, or making sure
we pass an Int, is a workaround for now
[11​:56​:39] <Timbus> yeah. just thought it was an odd one

Feels like the Capture is not set up at all with a recursive call.
Any direct calls seem to work ok.

As a further datapoint​: it only happens on Moar and JVM, not on
parrot.

[12​:09​:15] <Timbus> its an optimizer thing
[12​:11​:23] <lizmat> Timbus​: ah, indeed, with MVM_SPESH_DISABLE=1
no problems

@p6rt
Copy link
Author

p6rt commented Aug 28, 2017

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Aug 29, 2017

From @AlexDaniel

Well, it was clearly wrong to say that we don't care about it, sorry about that. Maybe it's not the top priority thing (for example, there is a module to do this​: https://github.com/azawawi/perl6-memoize), but there are still plans to get it done eventually.

I'll change the title a little bit so that it is easier to find this ticket.

On 2017-08-28 15​:17​:02, alex.jakimenko@​gmail.com wrote​:

We no longer seem to care about “is cached”, so… I don't think we
should reject
this (because it may be a nice test case once we start supporting
cached
trait), but at the same time this ticket is kinda useless.

On 2014-06-01 03​:12​:32, elizabeth wrote​:

On 01 Jun 2014, at 12​:07, Elizabeth Mattijsen <liz@​dijkmat.nl> wrote​:

On 01 Jun 2014, at 12​:05, perl6 via RT <perl6-bugs-
followup@​perl.org>
wrote​:

Greetings,

This message has been automatically generated in response to the
creation of a trouble ticket regarding​:
"Spooky capture with native int",
a summary of which appears below.

There is no need to reply to this message right now. Your ticket
has been
assigned an ID of [perl #​122004].

Please include the string​:

[perl #​122004]

in the subject line of all future correspondence about this issue.
To do so,
you may reply to this message.

Thank you,
perl6-bugs-followup@​perl.org

-------------------------------------------------------------------------
[07​:39​:51] <Timbus> m​: sub a(int $i) is cached { return unless $i;
a($i-1) }; say a(4);
[07​:39​:53] <+camelia> rakudo-moar ce6acf​: OUTPUT«Cannot find
method 'gist'​: no method cache and no .^find_method␤ in method
gist
at src/gen/m-CORE.setting​:7121␤ in block at src/gen/m-
CORE.setting​:3357␤ in any enter at src/gen/m-Metamodel.nqp​:3089␤
in method postcircumfix​:<( )> at src/gen/m-C…»
[11​:52​:00] <lizmat> Timbus​: seems there is some confusion as to
what gets passed to the sub
[11​:52​:13] <lizmat> is cached uses the gist of the signature to
creata a key
[11​:52​:22] <lizmat> for caching the return value
[11​:52​:34] <lizmat> m​: sub a(int $i) is cached { return unless $i;
a(($i-1).Int) }; say a(4)
[11​:52​:35] <+camelia> rakudo-moar ce6acf​: OUTPUT«(Any)␤»
[11​:53​:00] <lizmat> either defining $i as an Int, or making sure
we pass an Int, is a workaround for now
[11​:56​:39] <Timbus> yeah. just thought it was an odd one

Feels like the Capture is not set up at all with a recursive call.
Any direct calls seem to work ok.

As a further datapoint​: it only happens on Moar and JVM, not on
parrot.

[12​:09​:15] <Timbus> its an optimizer thing
[12​:11​:23] <lizmat> Timbus​: ah, indeed, with MVM_SPESH_DISABLE=1
no problems

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

No branches or pull requests

1 participant