Re: How to call Clojure from Java?
Hi thelmuth Here's a fully worked example. It calls the Clojure function myco.dashed-namespace.app.core/start!. Save it to src/myco/dashed_namespace/app/Main.java. package myco.dashed_namespace.app; import clojure.java.api.Clojure; import clojure.lang.IFn; public class Main { public static void main(String[] args) { try { IFn require = Clojure.var("clojure.core", "require"); require.invoke(Clojure.read("myco.dashed-namespace.app.core")); Clojure.var("myco.dashed-namespace.app.core", "start!").invoke(); } catch (Throwable e) { System.out.println(e.getMessage()); } } } On Fri, Jun 2, 2017 at 1:24 PM James Reeves wrote: > There's a brief section on this on the Clojure website: > > https://clojure.org/reference/java_interop#_calling_clojure_from_java > > On 2 June 2017 at 01:35, thelmuth wrote: > >> What is the best way to call a Clojure function from Java? >> >> Most of the resources I have found are either very old or don't go into >> enough detail. I am a Clojure programmer with very little Java background, >> and have been having trouble with the methods I've found, especially >> classpath issues. >> >> -- >> 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 >> --- >> You received this message because you are subscribed to the Google Groups >> "Clojure" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to clojure+unsubscr...@googlegroups.com. >> For more options, visit https://groups.google.com/d/optout. >> > > > > -- > James Reeves > booleanknot.com > > -- > 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 > --- > You received this message because you are subscribed to the Google Groups > "Clojure" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to clojure+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- 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 --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: How to call Clojure from Java?
There's a brief section on this on the Clojure website: https://clojure.org/reference/java_interop#_calling_clojure_from_java On 2 June 2017 at 01:35, thelmuth wrote: > What is the best way to call a Clojure function from Java? > > Most of the resources I have found are either very old or don't go into > enough detail. I am a Clojure programmer with very little Java background, > and have been having trouble with the methods I've found, especially > classpath issues. > > -- > 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 > --- > You received this message because you are subscribed to the Google Groups > "Clojure" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to clojure+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- James Reeves booleanknot.com -- 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 --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
How to call Clojure from Java?
What is the best way to call a Clojure function from Java? Most of the resources I have found are either very old or don't go into enough detail. I am a Clojure programmer with very little Java background, and have been having trouble with the methods I've found, especially classpath issues. -- 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 --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [ANN] Eastwood, the Clojure lint tool, version 0.2.4 released
I do not know whether you (Peter) are the same as the user pedro-w on Github, but pedro-w created this Eastwood issue and added a comment with links to a related discussion on a tools.reader issue tracker: https://github.com/jonase/eastwood/issues/222 If you can find a way, with just tools.reader alone, to call clojure.tools.reader/read in such a way that it first reads and uses the contents of a data_readers.clj file, and then can successfully read the sample .clj file in that issue #222 that causes Eastwood to fail now, that sequence of API calls would be useful to know, and might be all that Eastwood needs to work for projects with a non-empty data_readers.clj file. Adding that working sequence of API calls to Eastwood issue #222 would be a good place to document that, if someone finds out how to do it. Yes, Eastwood does have source code copies of tools.reader and several other open source libraries inside of itself, renamed to different namespaces. Why do such a crazy thing, you might reasonably ask? Because then Eastwood can read, analyze, and load tools.reader itself, without conflicting with the one that Eastwood uses for its own purposes. If a project you want to lint via Eastwood is using an older version of tools.reader, missing some function or feature Eastwood relies on, and Eastwood didn't use this technique, it would fail on such a project. I started 'dolly' (https://github.com/jafingerhut/dolly) to assist with bringing new versions of libraries Eastwood depends upon into Eastwood, renaming the namespaces semi-automatically for you. It isn't in a shape that I would recommend others to use right now, and it might never be in that kind of shape, but it can do some things. Its README mentions mranderson as another similar project that might be better suited for others. Andy On Thu, Jun 1, 2017 at 8:19 AM, Peter Hull wrote: > I had a quick look at this. As I understand it, the clojure.core reader > processes data_readers.clj, but Eastwood uses tools.reader (or a version of > it, copied into the Eastwood project?) which does not. > > I thought that, for linting, we don't need to actually run the data reader > functions, so it should be possible to use the *default-data-reader-fn* > mechanism to swallow the tag + value, returning 'something' (doesn't matter > what, I used (gensym) ). > > I tried editing leiningen.eastwood/eastwood, but unfortunately couldn't > find a way to set *default-data-reader-fn* such that tools.reader could > pick it up. I am now at the limits of my clojur e knowledge! > > Does this sound reasonable? Any ideas what I am doing wrong? > > Pete > > > > On Thursday, 1 June 2017 07:19:04 UTC+1, Peter Hull wrote: >> >> On Thursday, 1 June 2017 06:55:52 UTC+1, Andy Fingerhut wrote: >>> >>> Sounds like a limitation/bug in the current Eastwood implementation that >>> it doesn't handle this. You are welcome to file an issue on Github: >>> https://github.com/jonase/eastwood/issues >>> >>> Thanks for getting back to me. I've filed #222 ( >> https://github.com/jonase/eastwood/issues/222) >> Pete >> >> > -- > 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 > --- > You received this message because you are subscribed to the Google Groups > "Clojure" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to clojure+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- 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 --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: The simplest way to publish to Clojars?
Thanks for the clarification Toby! Boot doesn’t sign JARs by default but the push task has the following GPG-related options for folks who want to: -g, --gpg-sign Sign jar using GPG private key. -k, --gpg-user-id KEY KEY sets the name or key-id used to select the signing key. -K, --gpg-keyring PATH DEPRECATED: PATH sets the path to secring.gpg file to use for signing. -p, --gpg-passphrase PASS PASS sets the passphrase to unlock GPG signing key. Sean Corfield -- (970) FOR-SEAN -- (904) 302-SEAN An Architect's View -- http://corfield.org/ "If you're not annoying somebody, you're not really alive." -- Margaret Atwood On 6/1/17, 5:03 AM, "Toby Crawley" wrote: On Thu, Jun 1, 2017 at 12:01 AM, Sean Corfield wrote: > All the SSH keys and PGP/GPG stuff is unnecessary now, unless you want to > store your username/password credentials locally in encrypted form. There’s > no longer any signing or promotion of JARs. Jar promotion no longer exists on Clojars, but jar signing is still supported. By default, lein attempts to sign jars, but this can be disabled (run `lein sample` and search for `:sign-releases`). I don't know what boot does by default with respect to signing. -- 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 --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- 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 --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[ANN] com.walmartlabs/lacinia-pedestal 0.2.0
lacinia-pedestal provides the Pedestal support to expose web endpoints backed by Lacinia's GraphQL. This release improves async behavior, and upgrades the Lacinia dependency to the latest, 0.17.0. https://github.com/walmartlabs/lacinia-pedestal -- Howard M. Lewis Ship Senior Mobile Developer at Walmart Labs Creator of Apache Tapestry (971) 678-5210 http://howardlewisship.com @hlship -- 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 --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [ANN] Eastwood, the Clojure lint tool, version 0.2.4 released
I had a quick look at this. As I understand it, the clojure.core reader processes data_readers.clj, but Eastwood uses tools.reader (or a version of it, copied into the Eastwood project?) which does not. I thought that, for linting, we don't need to actually run the data reader functions, so it should be possible to use the *default-data-reader-fn* mechanism to swallow the tag + value, returning 'something' (doesn't matter what, I used (gensym) ). I tried editing leiningen.eastwood/eastwood, but unfortunately couldn't find a way to set *default-data-reader-fn* such that tools.reader could pick it up. I am now at the limits of my clojur e knowledge! Does this sound reasonable? Any ideas what I am doing wrong? Pete On Thursday, 1 June 2017 07:19:04 UTC+1, Peter Hull wrote: > > On Thursday, 1 June 2017 06:55:52 UTC+1, Andy Fingerhut wrote: >> >> Sounds like a limitation/bug in the current Eastwood implementation that >> it doesn't handle this. You are welcome to file an issue on Github: >> https://github.com/jonase/eastwood/issues >> >> Thanks for getting back to me. I've filed #222 ( > https://github.com/jonase/eastwood/issues/222) > Pete > > -- 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 --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: clojure.spec merge+or bug?
You can file a bug on the s/merge unform - anything that doesn't roundtrip should be a bug. On the coll-of one, I thought that was just fixed in the latest spec.alpha release (see https://dev.clojure.org/jira/browse/CLJ-2076) - are you using latest there? -- 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 --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: The simplest way to publish to Clojars?
On Thu, Jun 1, 2017 at 12:01 AM, Sean Corfield wrote: > All the SSH keys and PGP/GPG stuff is unnecessary now, unless you want to > store your username/password credentials locally in encrypted form. There’s > no longer any signing or promotion of JARs. Jar promotion no longer exists on Clojars, but jar signing is still supported. By default, lein attempts to sign jars, but this can be disabled (run `lein sample` and search for `:sign-releases`). I don't know what boot does by default with respect to signing. -- 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 --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.