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

bare <> and <STDIN> should be disallowed in Rakudo #753

Closed
p6rt opened this issue Mar 8, 2009 · 5 comments
Closed

bare <> and <STDIN> should be disallowed in Rakudo #753

p6rt opened this issue Mar 8, 2009 · 5 comments

Comments

@p6rt
Copy link

p6rt commented Mar 8, 2009

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

Searchable as RT63710$

@p6rt
Copy link
Author

p6rt commented Mar 8, 2009

From @masak

<masak> rakudo​: <>
<p6eval> rakudo ed4cd1​: RESULT«[]»
<masak> rakudo​: <STDIN>
<p6eval> rakudo ed4cd1​: RESULT«"STDIN"»
<masak> those two were low-hanging fruit. ;)
* masak submits them

See the message below for the corresponding spec change.

---------- Forwarded message ----------
From​: <pugs-commits@​feather.perl6.nl>
Date​: Sat, Mar 7, 2009 at 7​:19 PM
Subject​: r25735 - docs/Perl6/Spec
To​: perl6-language@​perl.org

Author​: lwall
Date​: 2009-03-07 19​:19​:29 +0100 (Sat, 07 Mar 2009)
New Revision​: 25735

Modified​:
  docs/Perl6/Spec/S02-bits.pod
Log​:
disallow bare <> as probable p5ism

Modified​: docs/Perl6/Spec/S02-bits.pod

--- docs/Perl6/Spec/S02-bits.pod        2009-03-07 17​:40​:43 UTC (rev 25734)
+++ docs/Perl6/Spec/S02-bits.pod        2009-03-07 18​:19​:29 UTC (rev 25735)
@​@​ -12,9 +12,9 @​@​

  Maintainer​: Larry Wall <larry@​wall.org>
  Date​: 10 Aug 2004
-  Last Modified​: 4 Mar 2009
+  Last Modified​: 7 Mar 2009
  Number​: 2
-  Version​: 157
+  Version​: 158

 This document summarizes Apocalypse 2, which covers small-scale
 lexical items and typological issues.  (These Synopses also contain
@​@​ -2418,7 +2418,7 @​@​
    $a = \('a', 'b');

 Likewise, if bound to a scalar parameter, C<< <a b> >> will be
-treated as a single list object, but if bound to a slurpy parameter,
+treated as a single C<Capture> object, but if bound to a slurpy parameter,
 it will auto-flatten.

 But note that under the parenthesis-rewrite rule, a single value will
@​@​ -2432,6 +2432,15 @​@​
 To force a single value to become a list object in item context,
 you should use C<< ['a'] >> for clarity as well as correctness.

+The degenerate case C<< <> >> is disallowed as a probable attempt to
+do IO in the style of Perl 5; that is now written C<< =<> >>.  (C<<
+<STDIN> >> is also disallowed.)  Empty lists are better written with
+C<()> or C<Nil> in any case because C<< <> >> will often be misread
+as meaning C<('')>.  (Likewise the subscript form C<< %foo<> >>
+should be written C<%foo{}> to avoid misreading as C<@​foo{''}.)
+If you really want the angle form for stylistic reasons, you can
+suppress the error by putting a space inside​: C<< < > >>.
+
 Much like the relationship between single quotes and double quotes, single
 angles do not interpolate while double angles do.  The double angles may
 be written either with French quotes, C<«$foo @​bar[]»>, or

@p6rt
Copy link
Author

p6rt commented Mar 8, 2009

From @moritz

On Sat Mar 07 21​:46​:09 2009, masak wrote​:

<masak> rakudo​: <>
<p6eval> rakudo ed4cd1​: RESULT«[]»
<masak> rakudo​: <STDIN>
<p6eval> rakudo ed4cd1​: RESULT«"STDIN"»
<masak> those two were low-hanging fruit. ;)
* masak submits them

Tests added to t/spec/S02-literals/listquote.t

Cheers,
Moritz

@p6rt
Copy link
Author

p6rt commented Mar 8, 2009

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

@p6rt
Copy link
Author

p6rt commented Mar 24, 2010

From @jnthn

On Sun Mar 08 05​:39​:18 2009, moritz wrote​:

On Sat Mar 07 21​:46​:09 2009, masak wrote​:

<masak> rakudo​: <>
<p6eval> rakudo ed4cd1​: RESULT«[]»
<masak> rakudo​: <STDIN>
<p6eval> rakudo ed4cd1​: RESULT«"STDIN"»
<masak> those two were low-hanging fruit. ;)
* masak submits them

Tests added to t/spec/S02-literals/listquote.t

Implemented and we've been running the tests for a while; closing ticket.

Jonathan

@p6rt
Copy link
Author

p6rt commented Mar 24, 2010

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

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