Is there a way to view the source code of a function from the Racket REPL?

I'm currently trying to dive a bit into Racket / Scheme. I have an instance (X) REPL that works next to my editor, which helps me a lot to learn the language. However, I cannot find the XREPL command or the macro (or something else) that will show me the source code of the function.

It seems all the necessary parts:

The XREPL command describeknows the file:

-> ,describe string-join
; `string-join' is a bound identifier,
;   defined in racket/string.rkt
;   required directly

and get-collects-search-dirsknows the way:

-> (require setup/dirs)
-> (get-collects-search-dirs)
'(#<path:/home/richard/.racket/5.2.1/collects>
  #<path:/usr/local/lib/racket/collects>)

And on the side of the reflection of things we have:

-> (procedure-arity string-join)
2

But all this ceases to be useful if all you want to know is a function call. Is there a way to access the implementation of a function, or at least parameter names?

Or, what will also work for me - some equivalent textual equivalent in REPL that opens help?

+3
3

XREPL ,describe ; .

" " Racket - , Racket 6 CSS; :).

, Racket HEAD. 6.1.

, , Scribble .

+3

, Geiser code, .


, HTML, bitrotted.

: https://github.com/dyoo/wescheme-docs/blob/master/test-extract-docstring.rkt

, : https://github.com/dyoo/wescheme-docs.

extract-docstring.rkt, , Racket 5.2.1, , , icky, , .

, , xrepl ; , .

+4

, Racket, MIT- , . ( proc )

  • (procedure-arity proc), ,
  • (pa proc)
  • (pp proc)

, , , , define set!, .

+3

Source: https://habr.com/ru/post/1544626/


All Articles