[racket] Procedure name printing in DrRacket

From: Danny Yoo (dyoo at cs.wpi.edu)
Date: Mon Apr 16 17:58:16 EDT 2012

> For:
>>stronger
> Why does DrRacket print  #<procedure:...itions\tests.rkt:6:28>
> and not #<procedure:stronger>

Hi Harry,


Racket's compiler has some special behavior to infer what the name of
a procedure value should be.  For example, at compile time, if it sees
something of the form:

    (define some-name (lambda ...))

or (let ([some-name (lambda ...)]) ...)

then it'll use "some-name" as part of the name of the lambda value.
You can see the "Inferred Value Names" section of the reference for
details:

    http://docs.racket-lang.org/reference/syntax-model.html#(part._infernames)


If we don't like the automatically-inferred name, we can override the
name of a procedure by using the 'procedure-rename' function:

    http://docs.racket-lang.org/reference/procedures.html#(def._((lib._racket/private/base..rkt)._procedure-rename))


Posted on the users mailing list.