problem-solving icon indicating copy to clipboard operation
problem-solving copied to clipboard

Expand DEPRECATED functionality.

Open 0rir opened this issue 2 years ago • 6 comments

Looking at Raku user code on Github, I stumbled across usage of Rakudo::Deprecations::DEPRECATED much like this.

#!/usr/bin/env raku
sub d(--> Str) {
    DEPRECATED(  'Me', '-Since', '-Gone', :what('sub d') );
    return 'd';
}
d();

This seems a large increase of utility beyond its sanctioned use as a trait. So I suggest that such usage be defined in Raku rather than be an implementation detail.

Such definition could allow future enhancements (or expose functionality I missed):

  • Optional customized output.
  • Redirection and silencing of notices so a repairer may fix in peace.
  • Specification and overriding of the entity expressed by the output 'author'. Any or all of a Raku implementer, a library author, and a using-application author may wish end-user responses to go to the application author. When a contact is named, it should not imply authorship.
  • A named product could be added as a sister to a named contact.
  • Loosening of version number constraints/manipulation for non-Raku implementers' convenience.

Be well.

0rir avatar Jan 13 '23 15:01 0rir

Hi @0rir,

let me ask if I have this straight: is this about deprecation within the Raku language specification or any deprecation that can happen in code?

2colours avatar Jan 14 '23 12:01 2colours

@2colours, this is about making existing behavior into defined behavior in the Raku spec.

Just throwing it into roast is good, but the existing code has some expectation of a specific style of version numbers.

0rir avatar Jan 14 '23 14:01 0rir

I would also support stabilizing a more powerful version of DEPRECIATED. For comparison, this is pretty similar to how Rust handles depreciation and it ends up being pretty useful in Rust user code.

codesections avatar Feb 22 '23 03:02 codesections

Though I did propose a mess of features, I think there is one most necessary: Decoupling the Raku version style to allow any kind of version string.

Then multis should allow a smooth expansion of functionality.

And my 'contact' and 'author' thoughts were ill-thought--passing a generic and a more specific message would be more flexible.

0rir avatar Feb 24 '23 00:02 0rir

Decoupling the Raku version style to allow any kind of version string.

Sorry, would you elaborate on this? I don't quite get what is it about and how you see it.

vrurg avatar Feb 24 '23 15:02 vrurg

@vrurg, thanks.

My '-Since', '-Gone' in the above code require the hyphens to avoid an initial letter 'v' being added because the they become Version objects. I did not explore this aspect--it just seemed clear that, for general use, plain strings are appropriate.

0rir avatar Feb 24 '23 23:02 0rir