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.

Rainer Joswig
  • 2,190
  • 11
  • 17
Alexey
  • 932
  • 7
  • 19

1 Answers1

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.