Is there a way to view a function's source code from within the Racket REPL?

前端 未结 3 1615
梦谈多话
梦谈多话 2020-12-19 07:38

I\'m currently trying to dive into Racket/Scheme a bit. I have an instance of the (X)REPL running next to my editor, which helps me immensely to explore the language. Howeve

3条回答
  •  甜味超标
    2020-12-19 08:30

    Eli Barzilay notes that the Geiser project includes code to extract this documentation.


    I do have an experimental bit of source code that extracts the text out of the HTML documentation, though that code may have bitrotted.

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

    and its dependencies, which live in: https://github.com/dyoo/wescheme-docs.

    The extract-docstring.rkt library I wrote up works under Racket 5.2.1, but I'm admittedly doing some really icky, hacky things to extract text from the documentation.

    It may be worthwhile to tell the folks on the Racket Users mailing list that being able to access the text-based documentation from xrepl is an important thing; perhaps it'll get the impetus moving.

提交回复
热议问题