On Jun 5, 9:19 am, Meikel Brandmeyer <m...@kotka.de> wrote:
> Am 05.06.2010 um 08:49 schrieb ataggart:
>
> > If I understand correctly, keywords aren't "defined" anywhere; they
> > are literal values, so your question would be akin to asking for a way
> > to retrieve all the literal integers used in the code.  That said,
> > there may be some implementation detail that maintains the set of
> > instantiated keyword values, but so far as I've seen, there's nothing
> > in the public api.

Integers (when not BigNumbers) are trivial to compare so you don't
need to keep a list. But keywords are different. In any language that
does keywords right, keywords evaluate to themselves & the same
keyword always evaluates to exactly the same object (since keywords
are also immutable in any language). This makes equality tests on
keywords very fast (you can convert from string to the object at
compile time) and implies you've got a list (or probably hash-table)
of them somewhere anyway.

> Vim has a feature that let's you complete arbitrary "keywords" (vim's 
> definition, not clojure's) which are used in an open buffer. So when you have 
> ::some-terribly-long-keyword-so-that-completion-makes-sense in one buffer, 
> then you can type ::some-te<C-n> in another buffer and Vim will happily 
> complete it. Maybe emacs has a similar feature? This would also have the 
> advantage, that you don't need a running swank in the background. Although 
> it's not completely accurate, it's a reasonable approximation.

Well, when you're working with SLIME, you've got a running swank
anyway, so doing a less accurate (and probably much more complex)
search through the source (assuming you've got all of it) is not
something I'd prefer when I've got close to 100% accurate completions
for everything else.

Joost.

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to