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

* does not allow // in map #3717

Open
p6rt opened this issue Mar 4, 2015 · 5 comments
Open

* does not allow // in map #3717

p6rt opened this issue Mar 4, 2015 · 5 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Mar 4, 2015

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

Searchable as RT123980$

@p6rt
Copy link
Author

p6rt commented Mar 4, 2015

From @Tux

$ perl6 -e '(1,Str,"a").map(*)[1].say'
(Str)
$ perl6 -e '(1,Str,"a").map(*)[1].perl.say'
Str
$ perl6 -e '(1,Str,"a").map(~*)[1].say'
use of uninitialized value of type Str in string context in block <unit> at -e​:1

$ perl6 -e '(1,Str,"a").map(~*)[1].perl.say'
use of uninitialized value of type Str in string context in block <unit> at -e​:1

""
$ perl6 -e '(1,Str,"a").map({$_//"-"})[1].say'
-
$ perl6 -e '(1,Str,"a").map({$_//"-"})[1].perl.say'
"-"
$ perl6 -e '(1,Str,"a").map(*//"-")[1].say'
(Str)
$ perl6 -e '(1,Str,"a").map(*//"-")[1].perl.say'
Str

--
H.Merijn Brand http://tux.nl Perl Monger http://amsterdam.pm.org/
using perl5.00307 .. 5.21 porting perl5 on HP-UX, AIX, and openSUSE
http://mirrors.develooper.com/hpux/ http://www.test-smoke.org/
http://qa.perl.org http://www.goldmark.org/jeff/stupid-disclaimers/

@p6rt
Copy link
Author

p6rt commented Aug 29, 2015

From @coke

On Wed Mar 04 00​:16​:25 2015, hmbrand wrote​:

$ perl6 -e '(1,Str,"a").map(*)[1].say'
(Str)
$ perl6 -e '(1,Str,"a").map(*)[1].perl.say'
Str
$ perl6 -e '(1,Str,"a").map(~*)[1].say'
use of uninitialized value of type Str in string context in block
<unit> at -e​:1

$ perl6 -e '(1,Str,"a").map(~*)[1].perl.say'
use of uninitialized value of type Str in string context in block
<unit> at -e​:1

""
$ perl6 -e '(1,Str,"a").map({$_//"-"})[1].say'
-
$ perl6 -e '(1,Str,"a").map({$_//"-"})[1].perl.say'
"-"
$ perl6 -e '(1,Str,"a").map(*//"-")[1].say'
(Str)
$ perl6 -e '(1,Str,"a").map(*//"-")[1].perl.say'
Str

06​:47 < [Tux]> [Coke] in RT#​123980, I hoped .map(*//"-") to do the same as .map({*//"-"})

--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Aug 29, 2015

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

@p6rt
Copy link
Author

p6rt commented Aug 30, 2015

From @Tux

On Sat, 29 Aug 2015 04​:09​:22 -0700, "Will Coleda via RT"
<perl6-bugs-followup@​perl.org> wrote​:

On Wed Mar 04 00​:16​:25 2015, hmbrand wrote​:

$ perl6 -e '(1,Str,"a").map(*)[1].say'
(Str)
$ perl6 -e '(1,Str,"a").map(*)[1].perl.say'
Str
$ perl6 -e '(1,Str,"a").map(~*)[1].say'
use of uninitialized value of type Str in string context in block
<unit> at -e​:1

$ perl6 -e '(1,Str,"a").map(~*)[1].perl.say'
use of uninitialized value of type Str in string context in block
<unit> at -e​:1

""
$ perl6 -e '(1,Str,"a").map({$_//"-"})[1].say'
-
$ perl6 -e '(1,Str,"a").map({$_//"-"})[1].perl.say'
"-"
$ perl6 -e '(1,Str,"a").map(*//"-")[1].say'
(Str)
$ perl6 -e '(1,Str,"a").map(*//"-")[1].perl.say'
Str

06​:47 < [Tux]> [Coke] in RT#​123980, I hoped .map(*//"-") to do the same as .map({*//"-"})

Actually​: .map(*//"-") to be the same as .map({$_//"-"})

sorry if my IRC comment caused confusion

--
H.Merijn Brand http://tux.nl Perl Monger http://amsterdam.pm.org/
using perl5.00307 .. 5.21 porting perl5 on HP-UX, AIX, and openSUSE
http://mirrors.develooper.com/hpux/ http://www.test-smoke.org/
http://qa.perl.org http://www.goldmark.org/jeff/stupid-disclaimers/

@p6rt
Copy link
Author

p6rt commented Sep 4, 2015

From @skids

This golfs down to​:

(* // "foo").WHAT.say

All the boolean ops see not to. Just to see what would happen
I applied the following patch locally​:

--- a/src/Perl6/Actions.nqp
+++ b/src/Perl6/Actions.nqp
@​@​ -7744,6 +7744,10 @​@​ Compilation unit '$file' contained the following violations​:
  %curried{'&infix​:<^..^>'} := 2;
  %curried{'&infix​:<xx>'} := 2;
  %curried{'callmethod'} := 3;
+ %curried{'if'} := 3;
+ %curried{'defor'} := 3;
+ %curried{'unless'} := 3;
+ %curried{'xor'} := 3;
  %curried{'p6callmethodhow'} := 3;
  %curried{'&postcircumfix​:<[ ]>'} := 3;
  %curried{'&postcircumfix​:<{ }>'} := 3;

This did cause //, and, &&, orelse, etc. to autocurry, with the
surprising exceptions of ^^ and xor which never seem to reach the
whatever_curry rule. Another op that does not includes infix​:<min>.

This caused no spectest failures, but needs a combined check with
design folks and implementation folks given the interaction of
conditionals with the optimizer.

@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