in reply to How to bring in multimethods

Which of those modules listed export SIG ?

Or are you asking how to implement SIG ?

edit

after looking into the source of Logic::Easy (which has no POD) it seems that SIG is implemented by source filter.

I can't see any mention of multi-methods there ¹ but since Perl doesn't do any static parameter checks when calling a sub², you'll have to construct one single sub frobnicate() which checks the arguments against patterns and delegates via dispatch table to specific sub implementations.

Maybe message the author?

HTH! :)

Cheers Rolf
(addicted to the 𐍀𐌴𐍂𐌻 Programming Language :)
Wikisyntax for the Monastery

updates

1) well I didn't spend much more guessing effort into this undocumented 0.02 version from MAR 26, 2005

2) well, it does prototype checks when compiling, but that's another thing

Replies are listed 'Best First'.
Re^2: How to bring in multimethods
by karlgoethebier (Abbot) on Sep 20, 2023 at 15:17 UTC

    1. Logic
    2. No1)

    I just want to write frobnicate($object) and not Methods::frobnicate($object). With use Exporter qw(import); our @EXPORT_OK =qw(frobnicate); and use Methods qw(frobnicate); only one frobnicate is found2) and with Methods->frobnicate() nothings happens.

    1) I could read the sources for this (could take a while ;-).
    2) This yields "Logic::Easy multi dispatch failed" from Logic::Easy line 94.

    «The Crux of the Biscuit is the Apostrophe»

Re^2: How to bring in multimethods
by karlgoethebier (Abbot) on Sep 20, 2023 at 15:48 UTC