< Back to IRCAM Forum

Problem with Libraries with own packages

Hi,

I have a question, but I think this is a bug.

By orientation of Mikhail Malt, I am creating a package for my library. But for some reason, I can not just be writing the name of the functions in the OM patch, because the function does not appear. I have the error “function diamond does not exist!”.

But If I put the same function (diamond) through of menu (functions->libraries->om-ji) it works normally.

It occurs in my library and Paulo’s library (OM-AIS), so I think that it is not an error of my code.

Can I do something to resolve this?

Thank you!

Hi Charles,

It’s hard to say. I doubt there is a bug in OM. It could be that your library has some issues. Could you send it so i can check?
You have by the way a template to create a library here:

Just download the project and “fill in” what you need. Some documentation here also:

Best
K

I will read these two topics!

I already saw the I using a different code!

Thank you very much for the help!

OM-JI.zip (1.7 MB)

This can be because I use om::defmethod! diamond and not defmethod! om::diamond ???

I can not understand!

But OM-SuperVP is in the second way, I will change this!

Thank you a lot Karim!

Hi Charles,

There is something wrong with the repository of the lib. in resources/imagen/ there’s a pict with a strange utf character that is problematic for me:

In the release all works fine:

Best
K

OK SORRY,
re-read your first post. You want to create your own package for this library (now i got it!)

If diamond is defined in your own package, and your package was exported to om, you can call it diamond,

Look into supervp lib and copy this:
/sources/package.lisp
;;;;;;;;;;;;;;;;;
(in-package :om)

(defpackage “MY-PACKAGE-LIB”
(:use “COMMON-LISP” “CL-USER” “OM”)
(:nicknames :my-package))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

Then in your lisp sources, all should start with (in-package :my-package)
Be carefulll if you want to call in your sources some om method, you should reference it for example, as om::om+
etc…

Hope this helps and sorry for i didn’t understand in the first place your question…

Best
K

Hi Charles and Karin.
I was having a problem with this too and I have found this code as a possible solution (Karin, please correct me if I am wrong):
After defpackage definitions commented by Karin…

(in-package :my-package-lib)
(import '(my-package-lib::function-name1 my-package-lib::function-name2
… ) :om)

Then all functions will appear in the patch by typing their names on the keyboard. But, as far as I know, this may cause conflicts with functions with the same name in OM package and I decided not to include this code in my library.

Best,
Paulo

Charles,
I forgot to say that you can access the functions of your package inside an OM session by typing on the keyboard the package name, :: and then the function name.
Example:
OM-JI::DIAMOND

Best,
Paulo

yes rightr
if function or merthod is included in a separate package in order to call it type frst packagename::nameoffuntion

best
k
ps: sorry guys hard to type with one hand

Thanks, Paulo and Karim.

I will try to rewrite this code. I will post this here when I am done.