Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to view the source code of a method in a standard library of Racket?

Tags:

racket

For example, there is a on-char method on the editor-canvas% class in racket/gui/base. It handles the 'wheel-up and 'wheel-down events and passes other events to the on-char method on canvas%.

I would like to view the source code and see how it does that.

I wish there are some tools like the Ruby API documentation, but now I do not even know where the source code of racket/gui/base is.

Array#each

like image 307
Domon Avatar asked Apr 13 '15 14:04

Domon


Video Answer


2 Answers

In DrRacket IDE you can hover over every imported symbol and right click. In the menu you have "Open defining file". After clicking on this you right click over the same symbol again and look where you clicked last time you'll see it says "Jump to definition (in other file)".

Note that in the same menu you also have "View documentation for symbol from packet" which opens a browser with the documentation.

like image 72
Sylwester Avatar answered Sep 28 '22 15:09

Sylwester


In DrRacket click the "Check Syntax" button (the one with the blue check mark and the magnifying glass). Then right click the identifier in question (here on-char) and choose the menu item "Open Defining File". This will open the file in which on-char is defined.

like image 20
soegaard Avatar answered Sep 28 '22 16:09

soegaard