rouge-lang/rouge — pull request #31 by noprompt (2013-01-04 10:09:43+00:00)
Title: Add tab completion to REPL

It took me a bit to cover all the edge cases and come up with a polished solution. I had to tweak things in a few places, but I think this looks good.

An empty string upon tab completion reveals all symbols in the current namespace, `rouge.core`, `rouge.builtin`, and `ruby` as well as namespace names:
```
user=>
Display all 214 possibilities? (y or n)
* *command-line-args* *ns* ...
= > and ...
...
```
Filtering results with a non-empty string:

```
user=> de
dec def defmacro defn deref ...
```
If a namespace is matched the solidus is automatically appended:
```
user=> rouge.str
user=> rouge.string/
```
From there we can continue to complete:
```
user=> rouge.string/
rouge.string/blank? rouge.string/capitalize ...
...
```
In the event a symbol in the current namespace matches the name of a namespace, the user can decide what to:
```
user=> (ns toast)
toast=> (def user "noprompt")
#'toast/user
toast=> user
user user/
toast=> user
```
I think that's basically everything, but leave it to me to forget something! :P If I did, I can get it in there.