Running seesaw and overtone libraries togethear

42 views
Skip to first unread message

Amir Teymuri

unread,
Jan 16, 2016, 9:27:15 AM1/16/16
to seesaw-clj
Hello,

i want to use the overtone and seesaw namespaces in one project. However when i load them there seems to be a function named (select) which exists in both seesaw.core and overtone.core ((seesaw.core/select) (overtone.core/select)), why  i can't load both of the libraries in the project. How could i come over this matter?

Many Thanks

abacus

unread,
Jan 16, 2016, 7:27:18 PM1/16/16
to seesaw-clj
I do not know about Overtone specifically, but in general you can introduce the seesaw.core and other namespaces with "require" instead of "use", and their symbols won't conflict.  See http://clojure.org/reference/namespaces or a more in-depth explanation at https://blog.8thlight.com/colin-jones/2010/12/05/clojure-libs-and-namespaces-require-use-import-and-ns.html

Amir Teymuri

unread,
Jan 16, 2016, 9:31:56 PM1/16/16
to seesaw-clj
Obviously (require) can't do the work, i do (require 'seesaw.core 'overtone.core 'clojure.repl), but at the next line the (native!) function can't get resolved.

Stefan Kamphausen

unread,
Jan 18, 2016, 9:53:28 AM1/18/16
to seesaw-clj
Hi,


On Sunday, January 17, 2016 at 3:31:56 AM UTC+1, Amir Teymuri wrote:
Obviously (require) can't do the work, i do (require 'seesaw.core 'overtone.core 'clojure.repl), but at the next line the (native!) function can't get resolved.

you might want to get a little more familiar with how "require" actually works.  You could use require and give the namespace you just loaded into the Clojure runtime an alias using ":as", alternatively you could refer to the functions of the required namespaces with their full name, i.e. "seesaw.core/native!".

In addition to that, you usually don't call (require...) directly but use the ":require" form in your namespace declaration.  If you look at other Clojure code e.g. on github you will find this form most often.


Kind regards,
stefan
Reply all
Reply to author
Forward
0 new messages