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

Add Mu.Callable($method) "coercer" #5513

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Add Mu.Callable($method) "coercer" #5513

wants to merge 6 commits into from

Commits on Jan 14, 2024

  1. Add Mu.Sub($method) "coercer"

    The idea being that *Raku* should provide a HLL interface to obtain
    a Sub object for the given method name on the invocant.
    
        $ raku -e 'say Int.Sub("Str")(687, :subscript)'
        ₆₈₇
    
    In place of the .^find_method logic, which is *not* Raku specific
    according to the documentation:
    
      https://docs.raku.org/type/Metamodel/DefiniteHOW#method_find_method
    lizmat committed Jan 14, 2024
    1 Configuration menu
    Copy the full SHA
    8ffce7c View commit details
    Browse the repository at this point in the history
  2. Mark Mu.Sub($method) as pure

    lizmat committed Jan 14, 2024
    Configuration menu
    Copy the full SHA
    d71d911 View commit details
    Browse the repository at this point in the history
  3. Handle failed search better

    - use nqp::tryfindmethod instead of nqp::findmethod
    - use nqp::ifnull instead of // to handle VMnull values
    lizmat committed Jan 14, 2024
    Configuration menu
    Copy the full SHA
    b23f0e5 View commit details
    Browse the repository at this point in the history

Commits on Jan 15, 2024

  1. Rename .Sub to .Callable

    In hindsight, this is probably better, as .Sub may be considered
    premature huffmanization.  And what is being returned, is usually
    *not* a Sub object anyway.
    lizmat committed Jan 15, 2024
    Configuration menu
    Copy the full SHA
    7ba540d View commit details
    Browse the repository at this point in the history

Commits on Jan 16, 2024

  1. Remove "is pure", return Failure on fail instead of Nil

    As suggested by vrurg++
    lizmat committed Jan 16, 2024
    Configuration menu
    Copy the full SHA
    7716947 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ae17c7d View commit details
    Browse the repository at this point in the history