Raku / problem-solving

🦋 Problem Solving, a repo for handling problems that require review, deliberation and possibly debate
Artistic License 2.0
70 stars 16 forks source link

Allow declarator docs on phasers? #409

Open rcmlz opened 11 months ago

rcmlz commented 11 months ago

Reading the discussion about RakuDoc and decorators in the advent calendar 2023, I am wondering if there could be an option to get decorators attached to e.g. PRE and POST phasers of methods or subs - in a similar way the leading and tailing decorators can be fetched from methods/subs.

I am thinking towards the way that the special sub MAIN is handled (very conveniently from a users perspective) … to e.g. enable auto generated ToolTips for instance in Jupyter, or autogenerated documentation, which might be a USP for Raku, especially in educational environments.

IF there is added value in attaching somewhat standardized documentation to objects/methods/subs etc. (e.g. Editor support) THEN people consider making this extra effort.

Same as for MAIN - I assume you see a lot of developers using the convenience features for specifying the signature, because it gives an immediate added value to the developer.

So if this magic would not just happen for MAIN but for all ordinary objects/subs/methods/Phasers etc., then ….

lizmat commented 11 months ago

OOC, why would this be applied to PRE and POST phasers only? Why not to KEEP and UNDO as well?

FWIW, I don't see a use case for the other phasers, but I could be missing something :-)

rcmlz commented 11 months ago

Aggree, there seems to be no reason why to limit decorators only to PRE and POST.

raiph commented 11 months ago

Hi @rcmlz

I'd like to suggest you consider further fleshing out some things related to this issue you've started. I've written a gist about that.

rcmlz commented 11 months ago

I added a few thoughts and some illustrative code to the gist. My base-line is: as long as Raku has no or only basic support in editors/IDE's, it might be more important to focus on syntax highlighting, auto completion and exploiting the already existing features/concepts of Raku. Putting in another feature into Raku that does not easily reach the target audience, is at best questionable.