From: Raymond T. <toy...@gm...> - 2012-03-27 14:59:26
|
On 3/20/12 6:17 AM, Akshay Srinivasan wrote: > Hi, > I was thinking we could just shadow functions like sin, cos, tan.. and > replace them with generic functions and define methods for matrix > classes. I have read something about this being slow runtime-wise, not > sure though. This has been done many times in several packages. I did this for maxima in the bigfloat package. The intent was to be able to take double-float code, through an (in-package "BIGFLOAT") around it, and have it mostly work for Maxima's bigfloat. I never measured it, but I'm quite sure it is significantly slower than the original double-float code. There's the CLOS method lookup overhead and also lots of additional boxing that probably needs to be done. > I can see why this would be a bad idea, because of issues in using > Matlisp classes in other packages. Maybe we can create a package which > overloads things for better user interaction ? > Perhaps. But for me, I've concluded that it's not a good idea to just use a package in another. I prefer to keep the package prefix when referring to other symbols from other packages. Having said that, we should probably separate out the current matlisp package into at least two packages. There's the external matlisp package that exports the exposed matlisp interface, and the internal matlisp-internals package that has all the rest of the cruft for the implementation. Ray |