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 SBCL-style trace method for method combinations #15

Closed
camsaul opened this issue Sep 10, 2019 · 0 comments · Fixed by #65
Closed

Add SBCL-style trace method for method combinations #15

camsaul opened this issue Sep 10, 2019 · 0 comments · Fixed by #65
Labels
enhancement New feature or request high-priority! more important than the other issues
Milestone

Comments

@camsaul
Copy link
Owner

camsaul commented Sep 10, 2019

SBCL lets you trace method combinations:

(defgeneric foo (x)
  (:method (x) 3))
(defmethod foo :around ((x fixnum))
  (1+ (call-next-method)))
(defmethod foo ((x integer))
  (* 2 (call-next-method)))
(defmethod foo ((x float))
  (* 3 (call-next-method)))
(defmethod foo :before ((x single-float))
  'single)
(defmethod foo :after ((x double-float))
 'double)

(trace foo :methods t)

(foo 2.0d0)
  0: (FOO 2.0d0)
    1: ((SB-PCL::COMBINED-METHOD FOO) 2.0d0)
      2: ((METHOD FOO (FLOAT)) 2.0d0)
        3: ((METHOD FOO (T)) 2.0d0)
        3: (METHOD FOO (T)) returned 3
      2: (METHOD FOO (FLOAT)) returned 9
      2: ((METHOD FOO :AFTER (DOUBLE-FLOAT)) 2.0d0)
      2: (METHOD FOO :AFTER (DOUBLE-FLOAT)) returned DOUBLE
    1: (SB-PCL::COMBINED-METHOD FOO) returned 9
  0: FOO returned 9
9

We should add debugging facilities to Methodical to add the same functionality

@camsaul camsaul added the enhancement New feature or request label Sep 11, 2019
@camsaul camsaul added the high-priority! more important than the other issues label Jun 9, 2021
@camsaul camsaul added this to the 0.11.4 milestone Jun 11, 2021
@camsaul camsaul linked a pull request Jun 11, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request high-priority! more important than the other issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant