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

The use of 'use' before 'class Foo is Bar' in Rakudo #652

Closed
p6rt opened this issue Jan 25, 2009 · 5 comments
Closed

The use of 'use' before 'class Foo is Bar' in Rakudo #652

p6rt opened this issue Jan 25, 2009 · 5 comments

Comments

@p6rt
Copy link

p6rt commented Jan 25, 2009

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

Searchable as RT62738$

@p6rt
Copy link
Author

p6rt commented Jan 25, 2009

From @masak

<masak> TimToady​: sometimes I'm unhappy about how restrictive the
'class Foo;' syntax is. the idea is very sound, to remove a level of
indentation that encompasses practically the whole file. but I can't
do 'class Foo is Bar;', because there's no way to put a use statement
before that statement. putting the 'is Bar;' statement on its own line
(after the use statement) feels inelegant in another way. the
class-semicolon syntax is both full of promise and a straitjacket
right now.
<TimToady> masak​: yes, STD allows use before class Foo is Bar;
<TimToady> however it's not clear the p6 autorecognizer will work in that case
<TimToady> so you might have to start with 'use v6'
<masak> TimToady​: I consider starting with 'use v6' good style anyway.
thanks for the good news. submitting rakudobug. :)

So, um, the bug is... that Rakudo currently doesn't allow 'use' before
'class Foo is Bar', whereas STD.pm does.

@p6rt
Copy link
Author

p6rt commented Jan 27, 2009

From @pmichaud

On Sun, Jan 25, 2009 at 07​:41​:04AM -0800, Carl Mäsak wrote​:

[...]
<TimToady> masak​: yes, STD allows use before class Foo is Bar;
<TimToady> however it's not clear the p6 autorecognizer will work in that case
<TimToady> so you might have to start with 'use v6'
<masak> TimToady​: I consider starting with 'use v6' good style anyway.
thanks for the good news. submitting rakudobug. :)

So, um, the bug is... that Rakudo currently doesn't allow 'use' before
'class Foo is Bar', whereas STD.pm does.

STD.pm currently (r25059) allows _any_ statement to occur prior to a
"class Foo is Bar;" declaration, which seems to contradict S11​:

  A module is declared with the C<module> keyword. There are
  two basic declaration syntaxes​:
  module Foo; # rest of scope is in module Foo
  ...
  module Bar {...} # block is in module Bar
  The first form is allowed only as the first statement in the file.

Rakudo is currently following the S11 definition. Perhaps we need
a bit of clarification on the synopsis or STD.pm here.

Pm

@p6rt
Copy link
Author

p6rt commented Jan 27, 2009

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

@p6rt
Copy link
Author

p6rt commented Aug 19, 2009

From @masak

On Sun Jan 25 07​:41​:03 2009, masak wrote​:

<masak> TimToady​: sometimes I'm unhappy about how restrictive the
'class Foo;' syntax is. the idea is very sound, to remove a level of
indentation that encompasses practically the whole file. but I can't
do 'class Foo is Bar;', because there's no way to put a use statement
before that statement. putting the 'is Bar;' statement on its own line
(after the use statement) feels inelegant in another way. the
class-semicolon syntax is both full of promise and a straitjacket
right now.

Rakudo now does what STD.pm does​: allow at most one statement-form
declarator per file, and not necessarily in the beginning. I'm not
unhappy anymore; resolving ticket.

@p6rt
Copy link
Author

p6rt commented Aug 19, 2009

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

@p6rt p6rt closed this as completed Aug 19, 2009
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