4

Why does DrRacket (kind of Scheme) IDE highlights some of the identifiers as "keywords" (for example define, lambda, send*), and the others as "symbols" (user defined identifiers, +, -, abs, send, send+, etc.)?

I am particularly confused by the difference between send* and send+. For reference, here are the beginnings of their definitions:

(define-syntax (send* stx) ...

(define-syntax (send+ stx) ...

(It is possible that I do not use the terms "identifier", "symbol", and "keyword" completely correctly, but this is how some of them seem to be used in DrRacket preferences.)

Unless this is a bug, it must be explained by the language "semantics", so I decided to ask here.

1 Answer 1

2

DrRacket maintains a list of keywords that it understands for auto-indentation, which you can find in the Preferences (under Editing->Indenting). If an identifier is listed as a keyword for indentation, then DrRacket will also highlight it differently if the chosen color scheme differentiates keywords from plain identifiers.

Identifiers like + are not highlighted because they are just names of functions, not "special forms" like if and cond. On the other hand, send+ isn't highlighted just because the default DrRacket keywords don't contain every syntactic form provided by Racket.

3
  • Is this a bug then?
    – Alexey
    Jan 6, 2014 at 17:29
  • I mean, who decides which identifiers are keywords? How should i maintain the lists of keywords?
    – Alexey
    Jan 7, 2014 at 22:18
  • You can add keywords yourself in the preferences. If you think it should go in the default list, you can submit a bug report or ask on the Racket mailing list. Jan 8, 2014 at 13:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.