Is there some reason --no-yield implies --version in `racket`?

I was messing around with Racket options and noticed that --no-yield always implies --version: racket/racket/src/cs/main.sps at d14920c4b4c62fe695ff00ea5a6e6a47df1d6cb3 · racket/racket · GitHub

I'm not sure why that would be and it looks like a bug to me, but I'm not sure.

It seems fairly deliberate in the implementation, but I agree that it seems strange.

My best guess at the history:

  • In v3xx and earlier, -v meant "no REPL", while a separate -m flag muted the banner that has the version number. So, running a program tended to involve both -v and -m. Of course, the fact was "no REPL" meant only a version number was shown was behind the choice of -v.

  • -V (= --no-yield) was added at some point to be a stronger kind of -v that not only skipped the REPL, but also skipped waiting on the eventspace. The banner-printing part of -v was preserved.

  • In the command-line overhaul for v4.0, the default disposition of the banner flipped, so either -v or -i was needed to show the banner. Meanwhile, the adjustment explicitly kept the banner-showing behavior of -V as a straightforward local transformation within the implementation, but maybe with not much through behind it. The fact that it's not documented supports the "not much thought" theory.

  • This state persisted because --no-yield isn't so useful.

I'm inclined to leave it alone except for documenting that -V implies -v. We could change its behavior, but maybe some script somewhere uses -V where -v was meant, and (not coincidentally) it currently has the same effect.

1 Like