
Does Racket have anything akin to null coalescing?

which means?

Are you thinking of #f
used with or
?

Basically (if (null? x) default x)

I can’t use something like #f
in this case because that’s a valid value.

Nothing builtin. Best idea: write a macro or/null
.

@samdphillips just to let you know: I submitted a patch yesterday.

Hmm. In Python, if I ctrl-c when it’s prompting for an input (via input()
), the KeyboardInterrupt is raised immediately. For Racket, when I’m in (read-line)
, ctrl-c doesn’t take an effect until I type something and hit enter. How can I get Python’s behavior?

Nice!
The function signature in the comment should probably have been updated. https://github.com/racket/racket/blob/45968e8a3c497f384d1994a4d279888a42be76c1/racket/collects/xml/private/reader.rkt#L175

Oh, that’s a previous version that turns out to break a lot of tests (it converts integer entities in bodies too). The fix is actually here: https://github.com/racket/racket/blob/master/racket/collects/xml/private/reader.rkt#L305

Oh cool. I missed the follow up commits.