types and generic function performance
"bob eob" <[email protected]>
| Newsgroups | gmane.lisp.scheme.bigloo |
|---|---|
| Message-ID | <trinity-6be008a8-6f32-4ad8-803d-90d8b1530d2d-1470911111383@3capp-mailcom-bs13> |
Hello and thanks for writing Bigloo! I have a question about performance ... I wrote this program: ;------------------------ (module test (main scm-main) (export (class TestClass) )) (define-generic (test-func obj) (print "GENERIC METHOD")) (define-method (test-func obj::TestClass) (print "TEST METHOD")) (define (scm-main argv) (let ((tc::TestClass (instantiate::TestClass))) (test-func tc))) ;------------------------ Which works as expected, producing the output "TEST METHOD", but if I look at the generated C code it looks like it is calling test-func dynamically even though I have specified the class type with tc::TestClass. Is there some way to make such generic functions faster by calling the correct define-method function directly if the type is known? Thanks, Bob