On 9/19/2018 4:56 AM, Neil Van Dyke wrote:
Currently, in main Racket reader, `#:` starts a keyword, as in `#:foo`.

Who on this email list would also like (or not like) `:` to start a keyword, as in `:foo`?

And, if you want the reader to also support `:foo`, would you want the writer to default to writing `:foo` rather than `#:foo` (and how much would you want that)?  And in the documentation?

(I've wanted "colon keywords" since keywords were first added to Racket, but have been dutifully enduring the "hash-colon", rather than make anyone who uses my open source packages depend on an additional package for my own variant of `#lang racket/base`. But, after many years of this, I still dislike typing and looking at `#:`.  I know some people don't understand why anyone cares (or suspect bikeshedding), but I get the impression that this is getting into cog-sci differences between individual programmers. Maybe one way to look at it is a vague "programmer preference", like light vs. dark screen background, rather than try to argue that no one should want to do it that way.  Then the question might be: how popular is this "colon keyword" programmer preference?  Which is why I'm asking the email list.)

I have a vague memory of this being discussed before.  Ah, yes ... in 2015.
https://groups.google.com/forum/#!msg/racket-users/3vOTC1FbieA/5SUP4wzKCAAJ;context-place=forum/racket-users

Much of my comment then still stands so I'll repeat it here: (more below)


On Sat, 21 Nov 2015 18:06:29 -0500, George Neuner wrote:
I actually prefer the #: syntax, but what I would like is support for
"existence" keywords - i.e. keywords with no argument - where the only
thing you care about is whether or not the keyword was provided.

Obviously, this can be done using a "rest" argument and symbols, but
the #: syntax draws attention that other symbols do not because
DrRacket, at least by default, colors keywords differently from other
symbols.

Although the keyword syntax coloring still works with a tick before a
symbol that looks like a keyword, having to remember the tick is a
PITA when you are thinking of the symbol as a keyword.  If you forget
it, you get a  nasty
    "application: missing argument expression after keyword"
error.


How much trouble would it cause to allow naked keywords and provide a
predicate based on their name?  E.g.,

(define ( test blah #:opt #:req reqvalue )
   :
  (when #:opt?  ... )
   :
  )

(test #:req 3)
(test #:req 42 #:opt)

Or even something like  (define ( test blah #:opt [] #:req req ) which
makes it more obvious that the keyword is only there to be tested?


Since then my opinion has altered slightly.  The #: syntax is less important than syntax coloring to call attention to the keyword. However the desire for purely symbolic "existence" keywords remains.

YMMV,
George

--
You received this message because you are subscribed to the Google Groups "Racket 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to