Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Access to method source #10187

Closed
0x75 opened this issue Feb 13, 2015 · 7 comments
Closed

Access to method source #10187

0x75 opened this issue Feb 13, 2015 · 7 comments

Comments

@0x75
Copy link

0x75 commented Feb 13, 2015

Hello Julia Dev Team,

please implement the ability to access the sourcecode of a function by typing in the
function name. R has this ability and it is incredibly helpfull to read good, performant code
and understand the system.
Article about the matter:
http://dorophone.blogspot.de/2011/07/duckspeak-vs-smalltalk.html

regards 0x75

@simonbyrne
Copy link
Contributor

You can use the @less macro for this, for example:

@less factor(10)

For future reference, this sort of question would best be asked on the julia-users mailing list.

@StefanKarpinski
Copy link
Member

For what it's worth, I kind of want this too. One can't, for example, see what the source of functions entered in the REPL were – only functions where the source exists in a file somewhere and hasn't changed. One potential (clever) way to do this is to record the source lines of the inputs to the REPL as the ~/.julia_history file since we are recording what people enter there.

@quinnj
Copy link
Member

quinnj commented Feb 13, 2015

It's something I've been meaning to play around with, see #7536

@simonbyrne
Copy link
Contributor

It would also be nice to be able to access the actual AST of a method, pre-lowering: i.e. obtain an AST that could be re-evaluated to give the same method. The method here no longer works.

@Jutho
Copy link
Contributor

Jutho commented Feb 13, 2015

I agree, very useful also in the context of stagedfunctions.

@StefanKarpinski
Copy link
Member

Let's reopen this for further discussion. I agree that pre-lowered AST would be great to have and with good enough pretty printing would suffice for most purposes.

@simonbyrne simonbyrne reopened this Feb 13, 2015
@simonbyrne simonbyrne changed the title adopt smalltalks Access to method source Feb 13, 2015
@JeffBezanson
Copy link
Member

duplicate of #2625

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants