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

Precedence of prefix ops used as functions (e.g. not(3)) #988

Closed
p6rt opened this issue May 11, 2009 · 5 comments
Closed

Precedence of prefix ops used as functions (e.g. not(3)) #988

p6rt opened this issue May 11, 2009 · 5 comments

Comments

@p6rt
Copy link

p6rt commented May 11, 2009

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

Searchable as RT65556$

@p6rt
Copy link
Author

p6rt commented May 11, 2009

From @skids

According to S03, when used in a functional manner, precedence
for prefix ops should behave as if the operator were a function.

S03​: "not($x) + 1 # means (not $x) + 1"

Currently the examples in S03 produce different results than specced.

See IRC discussion here​:

http://irclog.perlgeek.de/text.pl?channel=perl6;date=2009-05-11

@p6rt
Copy link
Author

p6rt commented Oct 11, 2009

From @kyleha

This is an automatically generated mail to inform you that tests are now available in t/spec/S03-operators/not.t

commit c10b7c5a53c3857fdb648052a80478d16ddf52aa
Author​: kyle <kyle@​c213334d-75ef-0310-aa23-eaa082d1ae64>
Date​: Sun Oct 11 23​:19​:00 2009 +0000

  [t/spec] Test for RT #​65556
 
  git-svn-id​: http://svn.pugscode.org/pugs@&#8203;28766 c213334d-75ef-0310-aa23-eaa082d1ae64

Inline Patch
diff --git a/t/spec/S03-operators/not.t b/t/spec/S03-operators/not.t
index 35856d8..7784e84 100644
--- a/t/spec/S03-operators/not.t
+++ b/t/spec/S03-operators/not.t
@@ -1,6 +1,6 @@
 use v6;
 use Test;
-plan 13;
+plan *;
 
 sub not_ok($cond,$desc) {
     if $cond {
@@ -21,12 +21,17 @@ not_ok(not "x",   'not "x" is false');
 my $a = 1; not_ok(not $a,    'not $not_var is false');
 my $b = 0; not_ok(!(not $b), 'not $false_var is not false');
 
+#?rakudo todo 'RT 65556'
+is (not($b) + 1), ((not $b) + 1), 'not($b) is (not $b)';
+
 ok( not(not 42), "not(not 42) is true");
-ok(!not(not  0), "not(not  0) is true");
+ok(!not(not  0), "not(not  0) is false");
 
 is(not Bool::True, Bool::False, "'Bool::True' is not 'Bool::False'");
 is(not Bool::True, False,       "'Bool::True' is not 'False'");
 is(not True, False,             "'True' is not 'False'");
 is(not True, Bool::False,       "'True' is not 'Bool::False'");
 
+done_testing;
+
 # vim: ft=perl6

@p6rt
Copy link
Author

p6rt commented Oct 11, 2009

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

@p6rt
Copy link
Author

p6rt commented Mar 18, 2010

From @moritz

Brian S. Julin (via RT) wrote​:

# New Ticket Created by "Brian S. Julin"
# Please include the string​: [perl #​65556]
# in the subject line of all future correspondence about this issue.
# <URL​: http://rt.perl.org/rt3/Ticket/Display.html?id=65556 >

According to S03, when used in a functional manner, precedence
for prefix ops should behave as if the operator were a function.

S03​: "not($x) + 1 # means (not $x) + 1"

Currently the examples in S03 produce different results than specced.

See IRC discussion here​:

http://irclog.perlgeek.de/text.pl?channel=perl6;date=2009-05-11

The test now passes, so I guess the problem is now solved.

@p6rt
Copy link
Author

p6rt commented Mar 18, 2010

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

@p6rt p6rt closed this as completed Mar 18, 2010
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