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

Itemized slip has invalid .perl stringification #5029

Closed
p6rt opened this issue Jan 9, 2016 · 5 comments
Closed

Itemized slip has invalid .perl stringification #5029

p6rt opened this issue Jan 9, 2016 · 5 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Jan 9, 2016

Migrated from rt.perl.org#127224 (status was 'resolved')

Searchable as RT127224$

@p6rt
Copy link
Author

p6rt commented Jan 9, 2016

From lucasbuchala@gmail.com

The ".perl"-stringification of an itemized slip has a strange dollar
sign in the middle​:

say slip(1,2).item.perl
slip$(1, 2)

Lists come in itemized and non-itemized flavours; and Slips are Lists,
but I'm not certain that the itemization concept also applies to
slips. Either way, slip's ".perl"-stringification should not have a
dollar sign in the middle, so removing that "$" would fix the problem.
If it's really intended to have an itemized slip, then maybe stringify
it as "$(slip(...))" or "slip(...).item".

@p6rt
Copy link
Author

p6rt commented Jun 12, 2016

From zefram@fysh.org

my $a = slip(2,3,4)
(2 3 4)
$a.perl
slip$(2, 3, 4)
$a.perl.EVAL
===SORRY!=== Error while compiling /home/zefram/tmp/EVAL_0
Two terms in a row
at /home/zefram/tmp/videosubs/EVAL_0​:1
------> slip^$(2, 3, 4)
  expecting any of​:
  infix
  infix stopper
  statement end
  statement modifier
  statement modifier loop

This arises from the algorithm of prefixing "slip" to a List deparse,
another problem with which I reported in [perl #​126902]. The fix that I
proposed there would kind-of fix this one​: "$(2,3,4).Slip" does yield a
Slip object, but loses the Scalar aspect represented by the "$". I don't
think that difference is important in deparsing, but since List.perl goes
to the trouble of emitting the "$" in the first place, maybe I'm wrong
about that. If it's important, Slip.perl will have to handle it itself.

-zefram

@p6rt
Copy link
Author

p6rt commented Jul 8, 2016

@coke - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Dec 14, 2016

From @zoffixznet

On Sat, 09 Jan 2016 05​:37​:07 -0800, lucasbuchala wrote​:

The ".perl"-stringification of an itemized slip has a strange dollar
sign in the middle​:

say slip(1,2).item.perl
slip$(1, 2)

Lists come in itemized and non-itemized flavours; and Slips are Lists,
but I'm not certain that the itemization concept also applies to
slips. Either way, slip's ".perl"-stringification should not have a
dollar sign in the middle, so removing that "$" would fix the problem.
If it's really intended to have an itemized slip, then maybe stringify
it as "$(slip(...))" or "slip(...).item".

Thank you for the report. This is now fixed.

Fix​: rakudo/rakudo@8eef234a5b441a
Test​: Raku/roast@7eea834e98

@p6rt
Copy link
Author

p6rt commented Dec 14, 2016

@zoffixznet - Status changed from 'open' to 'resolved'

@p6rt p6rt closed this as completed Dec 14, 2016
@p6rt p6rt added the Bug label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant