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

extending the documentation of DEPRECATED #2938

Open
MARTIMM opened this issue Aug 5, 2019 · 3 comments
Open

extending the documentation of DEPRECATED #2938

MARTIMM opened this issue Aug 5, 2019 · 3 comments
Labels
docs Documentation issue (primary issue type) NOTSPECCED need roast tests before documenting
Milestone

Comments

@MARTIMM
Copy link
Contributor

MARTIMM commented Aug 5, 2019

The problem

Missing information about DEPRECATED as a routine. I file this issue as suggested by JJ Merelo in the e-mail discussion 'DEPRECATED routine' on the perl6-users@perl.org list.

My first mail which started the discussion;

Studying GTK::Simple I found about the existence of a routine DEPRECATED which I couldn't find in the Perl6 documents. Reading from the code I see that it needs 3 arguments, start version of deprecation, version when it will be removed and a string like the one in 'is DEPRECATED()' trait.

A example like

sub gtk_builder_add_from_file ( ... ) {
  DEPRECATED(
    'other multi version of gtk_builder_add_from_file', '0.17.10', '0.20.0'
  );
  ...
}

Gives a result like;

Saw 1 occurrence of deprecated code.
================================================================================
Sub gtk_builder_add_from_file (from Gnome::Gtk3::Builder) seen at:
/home/marcel/Languages/Perl6/Projects/perl6-gnome-gtk3/../perl6-gnome-native/lib/Gnome/N/X.pm6 (Gnome::N::X), line 109
Deprecated since v0.17.10, will be removed with release v0.20.0!
Please use other version of gtk_builder_add_from_file instead.

Brad Gilbert said;

The `DEPRECATED` function is a feature of Rakudo, not Perl6.
Which means that how it works, and even its existence could be changed without warning.

It was added so that the compiler and runtime can mark features of itself as deprecated.
Because of the design of the compiler and runtime, it leaks out into the userspace.
It is not in ROAST so it is not Perl6.
`is DEPRECATED` is https://github.com/perl6/roast/blob/master/S02-types/isDEPRECATED.t

    my $a;
    my $awith;
    sub a     is DEPRECATED              { $a++     };
    sub awith is DEPRECATED("'fnorkle'") { $awith++ };

The only thing this use of `DEPRECATED` shows, is that `is DEPRECATED` could use a new
feature for indicating versions.

Suggestions

Update according to JJ Merelo;

Still, it's better to mention it in the documentation with all possible caveats.
I'd appreciate if you opened an issue, linking this question.
@lizmat
Copy link
Collaborator

lizmat commented Aug 5, 2019

FWIW, I consider the &DEPRECATED sub as an implementation detail that can be moved as soon as someone has the time to move it. I would therefore consider it a bad idea to document it. If the documentation of the is DEPRECATED trait is insufficient, then that should be improved!

@JJ
Copy link
Contributor

JJ commented Aug 5, 2019

@lizmat we should probably do both. An undocumented feature is simply an undocumented feature, and only causes confusion and questions in the mailing list. An implementation detail can be documented as such, with all necessary caveats. After all, there's nothing more apt to be deprecated than DEPRECATED.

@JJ JJ added docs Documentation issue (primary issue type) easy to resolve update part of "docs" - indicates this is an update for an existing section; rewrite, clarification, etc. labels Aug 5, 2019
@coke
Copy link
Collaborator

coke commented Nov 14, 2022

We should not, in general, be documenting implementation details in the language spec site.

I think the best place for this would be someplace like https://github.com/rakudo/rakudo/wiki/Implementation+Details.

We could definitely add a one liner link under 'is DEPRECATED' to that wiki if it existed, but that's it.

@coke coke added NOTSPECCED need roast tests before documenting and removed easy to resolve update part of "docs" - indicates this is an update for an existing section; rewrite, clarification, etc. labels Nov 14, 2022
@coke coke added this to the backlog milestone Mar 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation issue (primary issue type) NOTSPECCED need roast tests before documenting
Projects
None yet
Development

No branches or pull requests

4 participants