While toying with the Sesame2.3 library, I've come across the
following behavior for the first time.

This is taken from the api doc for
org.openrdf.repository.base.RepositoryConnectionBase:

add(Resource subject, URI predicate, Value object, Resource...
contexts)
          Adds a statement with the specified subject, predicate and
object to this repository, optionally to one or more named contexts.

But apparently, Clojure seems to think the optional args are
mandatory...

(.add con alice RDF/TYPE person)

No matching method found: add for class
org.openrdf.repository.sail.SailRepositoryConnection
  [Thrown class java.lang.IllegalArgumentException]

So I run

(grep #".add" (.getMethods (.getClass con)))

#<Method public void
org.openrdf.repository.base.RepositoryConnectionBase.add(org.openrdf.model.Resource,org.openrdf.model.URI,org.openrdf.model.Value,org.openrdf.model.Resource[])
throws org.openrdf.repository.RepositoryException>)

Finally the following works...

(.add con alice RDF/TYPE person (make-array Resource 1))
nil

Is this behavior normal? Are optional args mandatory when called with
interop?

Thanks for your help :)

Jonathan

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to