hylang/hy — pull request #127 by algernon (2013-04-20 16:41:34+00:00)
Title: A need for a (keyword?) function

When writing Hy code, and I want to check whether an argument is a keyword or not, a `(keyword?)` function would be very handy. I can't check for it being a HyKeyword instance, as that information is not available by that point.

A simple implementation would look like this:

```python
@builds("keyword?")
@checkargs(1)
def compile_is_keyword(self, expr):
expr.pop(0)
kw = expr.pop(0)
return kw.startswith("\uFDD0")
```

Might be better to do it as a macro, though, but for that, #126 needs to be fixed first, I believe.