On Thu 23 Jul 2015 at 09:33:13PM -0700, Keith Irwin wrote:
> There are some handy additions committed to the tools.cli project at:
>
> https://github.com/clojure/tools.cli
>
> but there hasn’t been a release in ~1.5 years (not even a snapshot
> release).
>
> In fact, these commits have been si
On Mon 9 Jun 2014 at 07:07:42PM -0700, Taegyoon Kim wrote:
> And you can't do this:
> user=> (let [x 1 (comment y 2)] x)
Alex Miller (?) once pointed out that the #_ reader macro can be chained
like this:
(let [x 1 #_#_y 2] x)
Pretty nifty.
guns
pgpn7C26ipuE0.pgp
De
ormance boost.
guns
pgpL2Biq3LnWB.pgp
Description: PGP signature
vm/analyze already sets up the right bindings for you.
Ah, I should have looked at the source of jvm/analyze. That's much
friendlier.
Thank you for the reply!
guns
pgpp_1NFoctow.pgp
Description: PGP signature
"x"))?
If not, does it make sense to ensure that the metadata of the (fis "x")
node is constant regardless of its context?
And finally, while we're on the topic, what is the difference between
the :tag, :o-tag, and :class entries? I have a vague idea based on a
quick
; s)))
Doing this in a multilingual setting, as Ben Wolfson points out, would
properly require a second parameter: the set of acceptable "vowels" in a
given Language/Locale/Script (which are all different things).
guns
pgpCjnJtOko9u.pgp
Description: PGP signature
n a flag will be treated as a boolean explicit
> and obvious, and make this library a little less frustrating and
> foot-gunish.
You are suggesting that "options require arguments by default" is less
implicit than "options are boolean toggles by default". This is unclear
to me.
As to which default is preferable and less surprising, I prefer the
latter since it matches the conventions in C, bash, Perl, and Ruby. My
understanding is that the former is the default on Python. Perhaps this
is the source of our disagreement?
I do agree that the documentation is not clear enough on this matter; I
will ameliorate this later today.
guns
pgp60HSRLzVmo.pgp
Description: PGP signature
but apparently not.
Set {:repl-options {:init (set! *print-length* 40)}} in your :user
profile in ~/.lein/profiles.clj.
https://github.com/technomancy/leiningen/blob/master/sample.project.clj#L311
guns
pgpSx2dX6LKDq.pgp
Description: PGP signature
with-meta calls .withMeta on its argument at runtime, so everything that
implements IObj works.
What's interesting is that
(meta ^:x inc) ; -> nil
does not work. I suppose this is because the reader cannot know if the
symbol `inc` represents an object that implements IMeta.
Hope this is accurate.
guns
pgpAjaltFssRA.pgp
Description: PGP signature
On Fri 2 May 2014 at 05:16:41PM -0700, Oskar Kvist wrote:
> Hi guns, thanks for your input!
>
> I see, but it only happens from within Vim, not if I run `ctnr/refresh` in
> the repl outside vim. I made an issue on fireplace's github that describes
> how to reproduce
should be able to work around this by creating the
namespace manually from a namespace that does exist, like the `user` ns:
user=> (create-ns 'my.broken-ns)
The namespace will still be broken, but you should now at least see
compiler errors.
HTH
guns
pgpDW8xGdWbno.pgp
Description: PGP signature
? Declare that it must satisfy clojure.lang.Associative.
And so on. Together with Java type hierarchies, I have found it quite
easy to declare polymorphic function signatures using Schema.
guns
pgpbQdkXAUa7G.pgp
Description: PGP signature
e it's not using a PushbackReader). So I come back to my first
> question: how do I detect the end of a file?
Use clojure.core/read with three params: [stream eof-error? eof-value]
From the Slamhound source:
(take-while #(not= ::done %) (repeatedly #(read rdr false ::done)))
guns
pgpOWqGF7SNcJ.pgp
Description: PGP signature
opts]
clojure.java.io/output-stream [x & opts]
clojure.java.io/reader [x & opts]
clojure.java.io/resource [n] [n loader]
clojure.java.io/writer [x & opts]
Combine (cheat-sheet) with a regex filter on (all-ns), and presto, you
have instant, up
tter performance now.
guns
pgpQEvfXJVwDk.pgp
Description: PGP signature
On Mon 24 Mar 2014 at 10:24:11AM -0700, ian.tegebo wrote:
> I found a stackoverflow question discussing :const metadata, but I can't
> seem to find any official clojure docs about it. Are you aware of any?
>
> Well, to be fair, I see it mentioned on the cheatsheet but I can't find any
> further ex
idiomatic approach.
FWIW, the `compare` function works well in this particular case.
(["neg" "zero" "pos"] (inc (compare x 0)))
guns
pgpnKxNxu6_4y.pgp
Description: PGP signature
for the
> hardware realities. I think this can get lost when we stray too far.
cf. the C10M project:
http://c10m.robertgraham.com/p/blog-page.html
tl;dr
The kernel gets in the way of extreme hi-throughput, so if that's
what you want, don't lean on the kernel to do your p
agree on a single way to structure command
line programs. Therefore, it my hope that `parse-opts` can at least
serve as a common base between such libraries and for Clojurists
interested in rolling their own.¹
If a clear favorite does emerge in the future, then that will be a great
candidate
efmacro go-loop
> "Like (go (loop ...))"
> [bindings & body]
> `(go (loop ~bindings ~@body)))
go-loop needs to be a macro to capture the unevaluated let bindings:
(go-loop [i 0] …)
If go-loop were a function, this code would throw an error because i is
undefined.
gun
, but simply
$ cmd
is not.
If you would like require that --port must be specified in every
invocation, you can assert its existence/value in the options map:
(let [{:keys [options errors …]} (parse-opts argv cli-options)]
…
(assert (:port options) "`--port` must be
soft of alias / abbrevraviation
> that is used in namespaces at will?
Have you taken a look at Slamhound?
https://github.com/technomancy/slamhound
You can avoid the onus of manually managing ns references while
retaining the advantages of explicit declaration.
guns
pgpTA26r2eu4H.pgp
Description: PGP signature
On Sat 28 Dec 2013 at 05:12:24AM -0600, guns wrote:
> (defn +. [precision & xs] …)
> (defn *. [precision & xs] …)
> …
> (defmacro with-precision [precision & body]
> `(let [~'+ ~(partial +. precision)
> …]
> ~@body
is also pretty convenient.
> Can we do better?
Overall, it seems to me that you are looking for a better way to
manage implicit parameters¹. However, I imagine a sizable part of this
community is here precisely because of negative experiences with systems
with large amounts of implicit data. T
On Fri 27 Dec 2013 at 11:23:22PM -0500, Lee Spector wrote:
>
> On Dec 27, 2013, at 11:18 PM, guns wrote:
> >
> > I personally use the following macro from my user.clj:
> >
> > (defmacro dump-locals []
> > `(clojure.pprint/pprint
> > ~(into {}
y does the trick.
I find that my desires for a stepping debugger are mostly absent with
Clojure as data is immutable, and the reference types may be monitored
with add-watch.
guns
pgpGmxZq3WqAn.pgp
Description: PGP signature
structor, while still allowing easy
access from the REPL via a single var bound to the current running
instance of the application.
I encourage everyone to look into it; I have had great success with it
so far. (Thanks Stuart!)
guns
pgp8B_Qd2JTzv.pgp
Description: PGP signature
On Fri 20 Dec 2013 at 05:04:13PM -0800, Dave Tenny wrote:
> Is there any alternative I'm missing short of writing my own macro to
> allow non-string forms for docstrings?
Use the ^ reader macro to set the :doc entry:
(def my-docstring "foo bar")
(defn ^{:doc my-docstri
On Tue 10 Dec 2013 at 01:54:21PM -0600, guns wrote:
> I am happy to announce the beta release of the next version of
> clojure.tools.cli:
>
> https://github.com/clojure/tools.cli
Okay, tools.cli 0.3.0 has been released. Thanks to everyone for trying
the beta!
I look forward
Hello everyone,
I am happy to announce the beta release of the next version of
clojure.tools.cli:
https://github.com/clojure/tools.cli#new-features
Leiningen dependency information:
[org.clojure/tools.cli "0.3.0-beta1"]
Maven dependency information:
org.clojure
tools.
On Mon 2 Dec 2013 at 12:42:46AM -0800, Patrick Kristiansen wrote:
> On Sun, Dec 1, 2013, at 05:16 PM, guns wrote:
>
> > I hope you find this information useful. Exactly one year ago I
> > became very unsatisfied with Vim for working with Clojure, and toyed
> > with Emacs f
do complete it, I plan on announcing it to the
VimClojure mailing list⁵, which is recommend for discussions specific to
Vim and Clojure.
I hope you find this information useful. Exactly one year ago I became
very unsatisfied with Vim for working with Clojure, and toyed with Emacs
for a bit
te for a hypothetical
future version of Slamhound that uses static analysis.
I hope to give this a try in the future, if someone else doesn't get to
it first!
guns
pgp9YKuS_RKFV.pgp
Description: PGP signature
to the namespaces are excellent!
I'm glad to hear there is some good news!
guns
pgpKzv1zuBJH4.pgp
Description: PGP signature
HANGES
Finally, for Vim users there is a new plugin for Slamhound integration:
https://github.com/guns/vim-slamhound
It was always easy to use Slamhound from fireplace.vim, but now it's
just a Pathogen infect away.
Cheers,
guns
pgprTWW8hPLqL.pgp
Description: PGP signature
take it from there.
> It's nice to see you thought about subcommand support as well. Thank
> you for your contribution!
The gist I linked to earlier¹ contains a detailed proposal for how I'd
like to advance tools.cli. If you are interested, comments on that are
much appreciated.
C
On Wed 20 Nov 2013 at 06:32:49PM -0600, guns wrote:
> The formatting is a bit ugly, so here is a plain text version:
>
> https://gist.github.com/guns/7573819/raw/26fc5a741d78b9cf1753fcde1a071dd467d44b4f/tools.cli.proposal.mail
Sorry for the double post. The url above should b
org/jira/browse/TCLI-6
The formatting is a bit ugly, so here is a plain text version:
https://gist.github.com/guns/7573819/raw/26fc5a741d78b9cf1753fcde1a071dd467d44b4f/tools.cli.proposal.mail
Comments are appreciated. If this is acceptable to all, then I will
happily begin work on
On Wed 28 Aug 2013 at 12:50:19PM +0900, Alan Busby wrote:
> On Wed, Aug 28, 2013 at 12:18 PM, guns wrote:
>
> > Oh, I was confused; I was thinking about sentinel values in user
> > code. Yes, I imagine a single private (Object.) would work just
> > fine, with very little
On Tue 27 Aug 2013 at 07:42:53PM -0700, Mikera wrote:
> On Wednesday, 28 August 2013 09:54:51 UTC+8, guns wrote:
> >
> > On Wed 28 Aug 2013 at 09:38:06AM +0800, Mike Anderson wrote:
> >
> > > Of course, if anyone has an actual technical argument why it is
> >
ith you that a configurable sentinel value
is best (I like using ::namespaced-keywords myself), but the existing
machinery has already decided on null, so that's what we have.
guns
pgp6xD5GT3rVU.pgp
Description: PGP signature
is rumoured to pass to Clojure developers.
:)
guns
pgpNErNn80zRF.pgp
Description: PGP signature
On Fri 23 Aug 2013 at 05:02:50PM -0700, Paul deGrandis wrote:
> Guns,
>
> Have you signed a Clojure CA yet? I'd love to help get this merged
> into tools.cli
Okay, since there is interest, I will mail a CA on Monday morning.
Paul, if you are a maintainer or committer of tool
On Wed 7 Aug 2013 at 10:53:00AM -0500, guns wrote:
> I'd like to announce optparse-clj, a command line options parser that
> supports GNU option parsing conventions:
>
> https://github.com/guns/optparse-clj
Hello again,
optparse-clj 1.1.1 now supports ClojureScript and
ee to swipe the parser from optparse-clj! I
would be happy to see it.
guns
pgpz00_ZBkWC_.pgp
Description: PGP signature
Hello,
I'd like to announce optparse-clj, a command line options parser that
supports GNU option parsing conventions:
https://github.com/guns/optparse-clj
[guns.cli/optparse "1.0.0"]
The interface is modelled after clojure.tools.cli¹, but the parser is
more flexibl
a
namespace after refactoring.
I have the call to slam.hound bound to a key sequence in my editor², so
I do not have to suffer a context switch:
https://gist.github.com/guns/6144732
There remain a few small problems (and one admittedly large one WRT
macros), but I think automated ns management is a kill
in org-mode format would be pretty nice for
emacs.
My apologies if you've already considered this. If you haven't, I hope
you find the suggestion useful.
guns
--
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to th
48 matches
Mail list logo