Get the code of a method - Artefact
Hello, I'm a student at Lille 1 university, so I'm still a beginner in Pharo I'm working on Artefact to create a more understable and complete demonstration. To do that I would like to print the code of a given method. However I can find how to decompiled the given method. Any help is welcome. -- [image: --] Guillaume Ongenae [image: https://]about.me/guillaume.ongenae <https://about.me/guillaume.ongenae?promo=email_sig&utm_source=email_sig&utm_...>
( aClass >> #aSelector ) sourceCode. Ex: (Morph>>#drawOn:) sourceCode For class side methods: (Object class >> #taskbarIcon) sourceCode Best regards, Henrik From: Pharo-users [mailto:pharo-users-bounces@lists.pharo.org] On Behalf Of Guillaume Ongenae Sent: Thursday, March 10, 2016 11:14 AM To: pharo-users@lists.pharo.org Subject: [Pharo-users] Get the code of a method - Artefact Hello, I'm a student at Lille 1 university, so I'm still a beginner in Pharo I'm working on Artefact to create a more understable and complete demonstration. To do that I would like to print the code of a given method. However I can find how to decompiled the given method. Any help is welcome. -- Feil! Filnavn er ikke angitt. [Bilde er fjernet av sender.] Guillaume Ongenae Feil! Filnavn er ikke angitt.about.me/guillaume.ongenae
Hi, Do you really need to decompile the method? A CompiledMethod know his source code. See: Object methods first sourceCode But you can get the decompiled code with: Object methods first codeForNoSource I hope this help you On Thu, Mar 10, 2016 at 11:14 AM, Guillaume Ongenae < guillaume.ongenae@gmail.com> wrote:
Hello,
I'm a student at Lille 1 university, so I'm still a beginner in Pharo
I'm working on Artefact to create a more understable and complete demonstration. To do that I would like to print the code of a given method. However I can find how to decompiled the given method. Any help is welcome.
--
[image: --]
Guillaume Ongenae [image: https://]about.me/guillaume.ongenae
<https://about.me/guillaume.ongenae?promo=email_sig&utm_source=email_sig&utm_...>
-- Cheers Cyril Ferlicot
sourceCode is the best way to do it. It answers the original sources if available, and the decompiled sources if not available. 2016-03-10 11:22 GMT+01:00 Cyril Ferlicot <cyril.ferlicot@gmail.com>:
Hi,
Do you really need to decompile the method? A CompiledMethod know his source code.
See: Object methods first sourceCode
But you can get the decompiled code with:
Object methods first codeForNoSource
I hope this help you
On Thu, Mar 10, 2016 at 11:14 AM, Guillaume Ongenae < guillaume.ongenae@gmail.com> wrote:
Hello,
I'm a student at Lille 1 university, so I'm still a beginner in Pharo
I'm working on Artefact to create a more understable and complete demonstration. To do that I would like to print the code of a given method. However I can find how to decompiled the given method. Any help is welcome.
--
[image: --]
Guillaume Ongenae [image: https://]about.me/guillaume.ongenae
<https://about.me/guillaume.ongenae?promo=email_sig&utm_source=email_sig&utm_...>
-- Cheers Cyril Ferlicot
Yes, sourceCode is what what I was looking for, but couldn't find. Cyril Ferlicot, no, I don't need to decompile it, I was just thinking that it could be a solution. Anyway. Thank you. Cheers. Guillaume -- View this message in context: http://forum.world.st/Get-the-code-of-a-method-Artefact-tp4883721p4883764.ht... Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
Yes, Artefact the PDF Library. -- View this message in context: http://forum.world.st/Get-the-code-of-a-method-Artefact-tp4883721p4884089.ht... Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
participants (6)
-
Clément Bera -
Cyril Ferlicot -
g_ongenae -
Guillaume Ongenae -
Henrik Nergaard -
Stephan Eggermont